2
0
Эх сурвалжийг харах

Add workaround for Scintilla bug. (update)

Martijn Laan 1 жил өмнө
parent
commit
1f0556c4d0
1 өөрчлөгдсөн 13 нэмэгдсэн , 3 устгасан
  1. 13 3
      Components/ScintEdit.pas

+ 13 - 3
Components/ScintEdit.pas

@@ -1348,9 +1348,8 @@ begin
     var Pos := SelectionCaretPosition[Selection];
     SelectionAnchorPosition[Selection] := Pos;
   end;
-  { Workaround Scintilla bug which was fixed in 3.6.3 with this note: "Send
-    SCN_UPDATEUI with SC_UPDATE_SELECTION when the application changes multiple
-    selection." }
+  { Workaround Scintilla bug which was fixed in
+    https://sourceforge.net/p/scintilla/code/ci/1bb3e86c576b0334ccbd7ac2fd69c4a48909e41f/ }
   if Assigned(FOnUpdateUI) then
     FOnUpdateUI(Self);
 end;
@@ -1449,6 +1448,17 @@ procedure TScintEdit.SetSingleSelection(const CaretPos, AnchorPos: Integer);
   the caret into view }
 begin
   Call(SCI_SETSELECTION, CaretPos, AnchorPos);
+  { Scintilla should now send SCN_UPDATEUI with SC_UPDATE_SELECTION but doesn't,
+    not sure which commit fixes this (if any). It isn't
+    https://sourceforge.net/p/scintilla/code/ci/1bb3e86c576b0334ccbd7ac2fd69c4a48909e41f/
+    The test to see if its fixed:
+    -Open Debug.iss
+    -Rectangular block select (Alt+Drag) part of both MessagesFile parameters
+    -Hit Esc once
+    -Word at cursor highlighting should now be active again - without the
+     workaround below it isn't }
+  if Assigned(FOnUpdateUI) then
+    FOnUpdateUI(Self);
 end;
 
 procedure TScintEdit.SetStyler(const Value: TScintCustomStyler);