Commit
…to the text fields of forms for certain plugins This PR restores shortcuts Shift-DEL, Ctrl-INS and Shift-INS for Cut / Copy / Paste respectively. the action to delete entire line without selection is removed in this PR due to its shortcut Shift-DEL has triggered several critical issues. To delete entire line, the users are encouraged to use Scintilla default shortcuts set in Shortcut Mapper: Ctrl-Shift-L (SCI_LINEDELETE). User can remap it to another shortcut via Shortcut mapper. Fix #14568, fix #14470, fix #14571, close #14557, close #14569
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -360,15 +360,20 @@ void Notepad_plus::command(int id) | |
HWND focusedHwnd = ::GetFocus(); | ||
if (focusedHwnd == _pEditView->getHSelf()) | ||
{ | ||
if (_pEditView->hasSelection()) | ||
if (_pEditView->hasSelection()) // Cut normally | ||
{ | ||
_pEditView->execute(WM_CUT); | ||
else | ||
} | ||
else // Cul the entire line | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
donho
Author
Member
|
||
{ | ||
bool useLinCopyCut = (NppParameters::getInstance()).useLineCopyCutDelete(); | ||
if (useLinCopyCut) | ||
_pEditView->execute(SCI_LINECUT); // Ctrl + X: without selected text, it will cut the whole line. | ||
_pEditView->execute(SCI_COPYALLOWLINE); | ||
_pEditView->execute(SCI_LINEDELETE); | ||
} | ||
} | ||
else | ||
{ | ||
::SendMessage(focusedHwnd, WM_CUT, 0, 0); | ||
} | ||
break; | ||
} | ||
|
||
|
@@ -377,20 +382,16 @@ void Notepad_plus::command(int id) | |
HWND focusedHwnd = ::GetFocus(); | ||
if (focusedHwnd == _pEditView->getHSelf()) | ||
{ | ||
if (_pEditView->hasSelection()) | ||
_pEditView->execute(WM_COPY); | ||
else | ||
{ | ||
bool useLinCopyCut = (NppParameters::getInstance()).useLineCopyCutDelete(); | ||
if (useLinCopyCut) | ||
_pEditView->execute(SCI_LINECOPY); // Ctrl + C: without selected text, it will copy the whole line. | ||
} | ||
_pEditView->execute(SCI_COPYALLOWLINE); // Copy selected text if any. | ||
// Otherwise copy the entire line with EOL, for pasting before any line where the caret is. | ||
This comment has been minimized.
Sorry, something went wrong.
alankilborn
Contributor
|
||
} | ||
else // Search result | ||
else | ||
{ | ||
Finder* finder = _findReplaceDlg.getFinderFrom(focusedHwnd); | ||
if (finder) | ||
if (finder) // Search result | ||
finder->scintillaExecute(WM_COPY); | ||
else | ||
::SendMessage(focusedHwnd, WM_COPY, 0, 0); | ||
} | ||
|
||
break; | ||
|
@@ -488,6 +489,10 @@ void Notepad_plus::command(int id) | |
|
||
_pEditView->execute(SCI_PASTE); | ||
} | ||
else | ||
{ | ||
::SendMessage(focusedHwnd, WM_PASTE, 0, 0); | ||
} | ||
} | ||
break; | ||
|
||
|
"cul" -> "cut"?