Browse Source

Fix the Begin/End Select after deletion problem

Fix #15221, close #15278
pull/15289/head
Alan Kilborn 5 months ago committed by Don Ho
parent
commit
2e116251e2
  1. 8
      PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp

8
PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp

@ -2787,14 +2787,16 @@ void ScintillaEditView::addText(size_t length, const char *buf)
void ScintillaEditView::beginOrEndSelect(bool isColumnMode) void ScintillaEditView::beginOrEndSelect(bool isColumnMode)
{ {
auto currPos = execute(SCI_GETCURRENTPOS);
if (_beginSelectPosition == -1) if (_beginSelectPosition == -1)
{ {
_beginSelectPosition = execute(SCI_GETCURRENTPOS); _beginSelectPosition = currPos;
} }
else else
{ {
execute(SCI_SETSELECTIONMODE, static_cast<WPARAM>(isColumnMode ? SC_SEL_RECTANGLE : SC_SEL_STREAM)); execute(SCI_CHANGESELECTIONMODE, static_cast<WPARAM>(isColumnMode ? SC_SEL_RECTANGLE : SC_SEL_STREAM));
execute(SCI_SETANCHOR, static_cast<WPARAM>(_beginSelectPosition)); execute(isColumnMode ? SCI_SETANCHOR : SCI_SETSEL, static_cast<WPARAM>(_beginSelectPosition), static_cast<LPARAM>(currPos));
_beginSelectPosition = -1; _beginSelectPosition = -1;
} }
} }

Loading…
Cancel
Save