diff options
author | Neil <nyamatongwe@gmail.com> | 2024-08-09 10:05:41 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2024-08-09 10:05:41 +1000 |
commit | 1daf2d728e95854ad648f93e6f17f8f58074d65c (patch) | |
tree | 8f183cda24d1570c2a2f4ffa4a2ccb2254d4f141 /win32/ScintillaWin.cxx | |
parent | 0d6fd0c6bc452f41919bbdf8dcc9b3d6fbc83205 (diff) | |
download | scintilla-mirror-1daf2d728e95854ad648f93e6f17f8f58074d65c.tar.gz |
Simplify code that sets an empty selection at a position.
Diffstat (limited to 'win32/ScintillaWin.cxx')
-rw-r--r-- | win32/ScintillaWin.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 748560a10..c1b330e61 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -1113,8 +1113,7 @@ void ScintillaWin::MoveImeCarets(Sci::Position offset) noexcept { // Move carets relatively by bytes. for (size_t r=0; r<sel.Count(); r++) { const Sci::Position positionInsert = sel.Range(r).Start().Position(); - sel.Range(r).caret.SetPosition(positionInsert + offset); - sel.Range(r).anchor.SetPosition(positionInsert + offset); + sel.Range(r) = SelectionRange(positionInsert + offset); } } @@ -3172,8 +3171,7 @@ LRESULT ScintillaWin::ImeOnReconvert(LPARAM lParam) { const Sci::Position docCompStart = rBase + adjust; if (inOverstrike) { // the docCompLen of bytes will be overstriked. - sel.Range(r).caret.SetPosition(docCompStart); - sel.Range(r).anchor.SetPosition(docCompStart); + sel.Range(r) = SelectionRange(docCompStart); } else { // Ensure docCompStart+docCompLen be not beyond lineEnd. // since docCompLen by byte might break eol. |