Skip to content

Commit

Permalink
Patch Scintilla to prevent autocompletion of AC lists created during …
Browse files Browse the repository at this point in the history
…`events.CHAR_ADDED`.
  • Loading branch information
orbitalquark committed Jan 14, 2023
1 parent 22bc969 commit 96f58f1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/scintilla.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Scintilla changes:
* Use Qt macros instead of keywords in header.
* Enable Qt mouse wheel events even if scroll bars are hidden. Similar patch submitted upstream.
* Update scroll position after VerticalCentreCaret(). Patch submitted upstream.
* Cache ac.Active() status when inserting a character to avoid immediate completion if SCN_CHARADDED
triggered autocompletion and that char is a fill-up char. Patch submitted upstream.

diff -r 22b6bbb36280 src/XPM.cxx
--- a/src/XPM.cxx Sat Sep 05 07:55:08 2020 +1000
Expand Down Expand Up @@ -110,3 +112,21 @@ diff -r 123ae5de5bd2 src/Editor.cxx
}
}

diff -r 123ae5de5bd2 src/ScintillaBase.cxx
--- a/src/ScintillaBase.cxx Sat Aug 27 08:02:08 2022 +1000
+++ b/src/ScintillaBase.cxx Fri Jan 13 08:38:46 2023 -0500
@@ -78,11 +78,12 @@
}

void ScintillaBase::InsertCharacter(std::string_view sv, CharacterSource charSource) {
- const bool isFillUp = ac.Active() && ac.IsFillUpChar(sv[0]);
+ const bool acActive = ac.Active();
+ const bool isFillUp = acActive && ac.IsFillUpChar(sv[0]);
if (!isFillUp) {
Editor::InsertCharacter(sv, charSource);
}
- if (ac.Active()) {
+ if (acActive) {
AutoCompleteCharacterAdded(sv[0]);
// For fill ups add the character after the autocompletion has
// triggered so containers see the key so can display a calltip.

0 comments on commit 96f58f1

Please sign in to comment.