- fix: when no selection, copy/cut should auto select whole line with the line break
This commit is contained in:
parent
0286043cd7
commit
1a0267de7b
1
NEWS.md
1
NEWS.md
|
@ -13,6 +13,7 @@ Red Panda C++ Version 1.0.0
|
|||
- fix: wrong selection when drag & dropped in editor
|
||||
- enhancement: toggle block comment
|
||||
- fix: syntax color of #include header filenames not correct
|
||||
- fix: when no selection, copy/cut should auto select whole line with the line break
|
||||
|
||||
Red Panda C++ Version 0.14.5
|
||||
- fix: the "gnu c++ 20" option in compiler set options is wrong
|
||||
|
|
|
@ -2108,7 +2108,10 @@ void SynEdit::doDeleteLine()
|
|||
void SynEdit::doSelecteLine()
|
||||
{
|
||||
setBlockBegin(BufferCoord{1,mCaretY});
|
||||
if (mCaretY==mLines->count())
|
||||
setBlockEnd(BufferCoord{lineText().length()+1,mCaretY});
|
||||
else
|
||||
setBlockEnd(BufferCoord{1,mCaretY+1});
|
||||
}
|
||||
|
||||
void SynEdit::doDuplicateLine()
|
||||
|
@ -2817,8 +2820,6 @@ void SynEdit::doCutToClipboard()
|
|||
return;
|
||||
if (!selAvail())
|
||||
doSelecteLine();
|
||||
if (!selAvail())
|
||||
return;
|
||||
mUndoList->BeginBlock();
|
||||
auto action = finally([this] {
|
||||
mUndoList->EndBlock();
|
||||
|
@ -2829,11 +2830,9 @@ void SynEdit::doCutToClipboard()
|
|||
|
||||
void SynEdit::doCopyToClipboard()
|
||||
{
|
||||
if (!selAvail())
|
||||
bool selected=selAvail();
|
||||
if (!selected)
|
||||
doSelecteLine();
|
||||
if (!selAvail()) {
|
||||
return;
|
||||
}
|
||||
bool ChangeTrim = (mActiveSelectionMode == SynSelectionMode::smColumn) &&
|
||||
mOptions.testFlag(eoTrimTrailingSpaces);
|
||||
QString sText;
|
||||
|
@ -2847,6 +2846,10 @@ void SynEdit::doCopyToClipboard()
|
|||
sText = selText();
|
||||
}
|
||||
internalDoCopyToClipboard(sText);
|
||||
if (!selected) {
|
||||
setBlockBegin(caretXY());
|
||||
setBlockEnd(caretXY());
|
||||
}
|
||||
}
|
||||
|
||||
void SynEdit::internalDoCopyToClipboard(const QString &s)
|
||||
|
|
Loading…
Reference in New Issue