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