+fix: behavior of Ctrl+Shift+X

This commit is contained in:
METANEOCORTEX\Kotti 2023-10-20 09:33:15 +02:00
parent a4fd0c4d16
commit 13e19ec5f2
3 changed files with 5 additions and 5 deletions

View File

@ -2949,14 +2949,14 @@ static int utsort_ln(const void *a, const void *b) {
return (_a < _b) ? -1 : ((_a > _b) ? 1 : 0);
}
void EditCutLines(HWND hwnd)
void EditCutLines(HWND hwnd, const bool bMSBehavSelEmpty)
{
if (!Sci_IsMultiOrRectangleSelection())
{
bool const bInLastLine = Sci_InLastLine();
bool const bClearCB = bInLastLine ? (Sci_GetNetLineLength(Sci_GetCurrentLineNumber()) == 0) : false;
UndoTransActionBegin();
if (SciCall_IsSelectionEmpty()) {
if (SciCall_IsSelectionEmpty() && bMSBehavSelEmpty) {
SciCall_CopyAllowLine(); // (!) VisualStudio behavior
// On Windows, an extra "MSDEVLineSelect" marker is added to the clipboard
// which is then used in SCI_PASTE to paste the whole line before the current line.

View File

@ -69,7 +69,7 @@ void EditMoveUp(HWND hwnd);
void EditMoveDown(HWND hwnd);
bool EditSetCaretToSelectionStart();
bool EditSetCaretToSelectionEnd();
void EditCutLines(HWND hwnd);
void EditCutLines(HWND hwnd, const bool bMSBehavSelEmpty);
void EditCopyMultiSelection(HWND hwnd);
void EditModifyLines(const PENCLOSESELDATA pEnclData);
void EditIndentBlock(HWND hwnd,int cmd, bool bFormatIndentation, bool bForceAll);

View File

@ -5143,7 +5143,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
}
EditDeleteMarkerInSelection();
if (SciCall_IsSelectionEmpty()) {
EditCutLines(Globals.hwndEdit);
EditCutLines(Globals.hwndEdit, true);
} else {
SciCall_Cut();
}
@ -5157,7 +5157,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam)
}
//~ explicit(!): ignore (SciCall_IsSelectionEmpty()) && Settings2.NoCutLineOnEmptySelection)
EditDeleteMarkerInSelection();
EditCutLines(Globals.hwndEdit);
EditCutLines(Globals.hwndEdit, false);
}
break;