- enhancement: if there's no selection when copy/cut, select currect line by default
This commit is contained in:
parent
5eec4ea504
commit
0e0f954bec
1
NEWS.md
1
NEWS.md
|
@ -2,6 +2,7 @@ Red Panda C++ Version 0.13.2
|
||||||
- fix: "delete and exit" button in the environtment / page option page doesn't work correctly
|
- fix: "delete and exit" button in the environtment / page option page doesn't work correctly
|
||||||
- fix: crash when closing the options dialog under Ubuntu 20.04 LTS ( no memory leak now)
|
- fix: crash when closing the options dialog under Ubuntu 20.04 LTS ( no memory leak now)
|
||||||
- enhancement: can add non-code file in templates
|
- enhancement: can add non-code file in templates
|
||||||
|
- enhancement: if there's no selection when copy/cut, select currect line by default
|
||||||
|
|
||||||
Red Panda C++ Version 0.13.1
|
Red Panda C++ Version 0.13.1
|
||||||
- enhancement: suppoort localization info in project templates
|
- enhancement: suppoort localization info in project templates
|
||||||
|
|
|
@ -2054,6 +2054,12 @@ void SynEdit::doDeleteLine()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SynEdit::doSelecteLine()
|
||||||
|
{
|
||||||
|
setBlockBegin(BufferCoord{1,mCaretY});
|
||||||
|
setBlockEnd(BufferCoord{lineText().length()+1,mCaretY});
|
||||||
|
}
|
||||||
|
|
||||||
void SynEdit::doDuplicateLine()
|
void SynEdit::doDuplicateLine()
|
||||||
{
|
{
|
||||||
if (!mReadOnly && (mLines->count() > 0)) {
|
if (!mReadOnly && (mLines->count() > 0)) {
|
||||||
|
@ -2823,7 +2829,11 @@ void SynEdit::doAddChar(QChar AChar)
|
||||||
|
|
||||||
void SynEdit::doCutToClipboard()
|
void SynEdit::doCutToClipboard()
|
||||||
{
|
{
|
||||||
if (mReadOnly || !selAvail())
|
if (mReadOnly)
|
||||||
|
return;
|
||||||
|
if (!selAvail())
|
||||||
|
doSelecteLine();
|
||||||
|
if (!selAvail())
|
||||||
return;
|
return;
|
||||||
mUndoList->BeginBlock();
|
mUndoList->BeginBlock();
|
||||||
auto action = finally([this] {
|
auto action = finally([this] {
|
||||||
|
@ -2836,7 +2846,10 @@ void SynEdit::doCutToClipboard()
|
||||||
void SynEdit::doCopyToClipboard()
|
void SynEdit::doCopyToClipboard()
|
||||||
{
|
{
|
||||||
if (!selAvail())
|
if (!selAvail())
|
||||||
|
doSelecteLine();
|
||||||
|
if (!selAvail()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
bool ChangeTrim = (mActiveSelectionMode == SynSelectionMode::smColumn) &&
|
bool ChangeTrim = (mActiveSelectionMode == SynSelectionMode::smColumn) &&
|
||||||
mOptions.testFlag(eoTrimTrailingSpaces);
|
mOptions.testFlag(eoTrimTrailingSpaces);
|
||||||
QString sText;
|
QString sText;
|
||||||
|
@ -5539,11 +5552,10 @@ void SynEdit::ExecuteCommand(SynEditorCommand Command, QChar AChar, void *pData)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SynEditorCommand::ecCut:
|
case SynEditorCommand::ecCut:
|
||||||
if (!mReadOnly && selAvail())
|
if (!mReadOnly)
|
||||||
doCutToClipboard();
|
doCutToClipboard();
|
||||||
break;
|
break;
|
||||||
case SynEditorCommand::ecCopy:
|
case SynEditorCommand::ecCopy:
|
||||||
if (selAvail())
|
|
||||||
doCopyToClipboard();
|
doCopyToClipboard();
|
||||||
break;
|
break;
|
||||||
case SynEditorCommand::ecPaste:
|
case SynEditorCommand::ecPaste:
|
||||||
|
|
|
@ -555,6 +555,7 @@ private:
|
||||||
void doDeleteLastWord();
|
void doDeleteLastWord();
|
||||||
void doDeleteFromBOL();
|
void doDeleteFromBOL();
|
||||||
void doDeleteLine();
|
void doDeleteLine();
|
||||||
|
void doSelecteLine();
|
||||||
void doDuplicateLine();
|
void doDuplicateLine();
|
||||||
void doMoveSelUp();
|
void doMoveSelUp();
|
||||||
void doMoveSelDown();
|
void doMoveSelDown();
|
||||||
|
|
Loading…
Reference in New Issue