mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-17 21:03:19 +08:00
Fix "cut last line" (orig issue #5051)
This commit is contained in:
parent
489b4c1e4b
commit
fcf3025d64
10
src/Edit.c
10
src/Edit.c
@ -2954,7 +2954,7 @@ 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;
|
||||
bool const bIsLineEmpty = Sci_GetNetLineLength(Sci_GetCurrentLineNumber()) == 0;
|
||||
UndoTransActionBegin();
|
||||
if (SciCall_IsSelectionEmpty() && bMSBehavSelEmpty) {
|
||||
SciCall_CopyAllowLine(); // (!) VisualStudio behavior
|
||||
@ -2969,11 +2969,9 @@ void EditCutLines(HWND hwnd, const bool bMSBehavSelEmpty)
|
||||
SciCall_Home();
|
||||
}
|
||||
EndUndoTransAction();
|
||||
if (bInLastLine) {
|
||||
if (bClearCB) {
|
||||
EditClearClipboard(hwnd);
|
||||
}
|
||||
EditAppendToClipboard(hwnd, "", 0); // adds EOL instead of EOF
|
||||
if (bInLastLine && bIsLineEmpty) {
|
||||
EditClearClipboard(hwnd);
|
||||
EditAppendToClipboard(hwnd, "", 0); // adds EOL
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user