Skip to content

Commit

Permalink
Fix deleting in column mode also delete an unexpected EOL
Browse files Browse the repository at this point in the history
Fix #14426, close #14536
  • Loading branch information
donho committed Jan 3, 2024
1 parent 19c6489 commit dc6f6d1
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp
Expand Up @@ -592,17 +592,20 @@ LRESULT ScintillaEditView::scintillaNew_Proc(HWND hwnd, UINT Message, WPARAM wPa
if (nbCaseForScint)
_callWindowProc(_scintillaDefaultProc, hwnd, Message, wParam, lParam);

// then do our job, if any
for (const auto& i : edgeOfEol)
// then do our job, if it's not column mode
if (!isColumnSelection)
{
// because the current caret modification will change the other caret positions,
// so we get them dynamically in the loop.
LRESULT posStart = execute(SCI_GETSELECTIONNSTART, i._selIndex);
LRESULT posEnd = execute(SCI_GETSELECTIONNEND, i._selIndex);

replaceTarget(L"", posStart, posEnd + i._len2remove);
execute(SCI_SETSELECTIONNSTART, i._selIndex, posStart);
execute(SCI_SETSELECTIONNEND, i._selIndex, posStart);
for (const auto& i : edgeOfEol)
{
// because the current caret modification will change the other caret positions,
// so we get them dynamically in the loop.
LRESULT posStart = execute(SCI_GETSELECTIONNSTART, i._selIndex);
LRESULT posEnd = execute(SCI_GETSELECTIONNEND, i._selIndex);

replaceTarget(L"", posStart, posEnd + i._len2remove);
execute(SCI_SETSELECTIONNSTART, i._selIndex, posStart);
execute(SCI_SETSELECTIONNEND, i._selIndex, posStart);
}
}

execute(SCI_ENDUNDOACTION);
Expand Down

0 comments on commit dc6f6d1

Please sign in to comment.