diff --git a/src/Edit.c b/src/Edit.c index 836de28af..00419ad8c 100644 --- a/src/Edit.c +++ b/src/Edit.c @@ -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. diff --git a/src/Edit.h b/src/Edit.h index cb2aefe76..a307ae3f8 100644 --- a/src/Edit.h +++ b/src/Edit.h @@ -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); diff --git a/src/Notepad3.c b/src/Notepad3.c index 76574b657..d6dc2a49b 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -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;