Skip to content

Commit 4740cf3

Browse files
authored
Use a better way to empty the selection (#74)
Fixes #71
1 parent 1c3aaab commit 4740cf3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/PluginDefinition.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,8 @@ void onBeforeSave(HWND hWnd, uptr_t idFrom)
363363
SendMessage(curScintilla, SCI_SETAUTOMATICFOLD, 0, 0);
364364

365365
// Make sure there is no active selection
366-
SendMessage(curScintilla, SCI_CLEARSELECTIONS, 0, 0);
366+
const int curPos = static_cast<int>(SendMessage(curScintilla, SCI_GETCURRENTPOS, 0, 0));
367+
SendMessage(curScintilla, SCI_SETEMPTYSELECTION, curPos, 0);
367368

368369
// Trailing whitespace needs to be trimmed before 'insert_final_newline' is
369370
// applied.

0 commit comments

Comments
 (0)