diff --git a/Source/editor/simba.editor.pas b/Source/editor/simba.editor.pas index fb3b9c483..a9240c47e 100644 --- a/Source/editor/simba.editor.pas +++ b/Source/editor/simba.editor.pas @@ -37,6 +37,8 @@ TSimbaEditor = class(TSimbaSynEdit) FLastTextChangeStamp: Int64; FModifiedEvent: TNotifyEvent; + procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override; + procedure FontChanged(Sender: TObject); override; procedure MaybeReplaceModifiers; @@ -276,6 +278,14 @@ procedure TSimbaEditor.SetUseSimbaColors(Value: Boolean); FAttributes.LoadFromFile(SimbaSettings.Editor.CustomColors.Value); end; +procedure TSimbaEditor.MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + if (ssCtrl in Shift) then // Mouse link fix + CaretXY := PixelsToRowColumn(Point(X, Y)); + + inherited MouseDown(Button, Shift, X, Y); +end; + procedure TSimbaEditor.FontChanged(Sender: TObject); begin inherited FontChanged(Sender); diff --git a/Source/simba.internetsocket.pas b/Source/simba.internetsocket.pas index 6181370a6..073cc9987 100644 --- a/Source/simba.internetsocket.pas +++ b/Source/simba.internetsocket.pas @@ -133,7 +133,7 @@ function TSimbaInternetSocket.HasData: Boolean; FSocket.ReadFlags := MSG_PEEK; try - Result := FSocket.Read(b, 1) > 0; + Result := FSocket.Read(b{%H-}, 1) > 0; finally FSocket.SetSocketBlockingMode(FSocket.Handle, bmBlocking, @FDS); FSocket.ReadFlags := 0; diff --git a/Source/simba.scripttab.pas b/Source/simba.scripttab.pas index 195afe101..5697f3e4f 100644 --- a/Source/simba.scripttab.pas +++ b/Source/simba.scripttab.pas @@ -379,16 +379,10 @@ procedure TSimbaScriptTab.DoEditorModified(Sender: TObject); procedure TSimbaScriptTab.DoEditorLinkClick(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin - if (Sender is TSynEdit) then - begin - X := TSynEdit(Sender).PixelsToRowColumn(ScreenToControl(Mouse.CursorPos), []).X; - Y := TSynEdit(Sender).PixelsToRowColumn(ScreenToControl(Mouse.CursorPos), []).Y; - end; - FLinkClick.Script := Script; FLinkClick.ScriptFileName := ScriptFileName; FLinkClick.CaretPos := Editor.GetCaretPos(True); - FLinkClick.Expression := Editor.GetExpressionEx(X, Y); + FLinkClick.Expression := Editor.GetExpressionEx(FEditor.CaretX, FEditor.CaretY); QueueOnMainThread(@DoFindAndShowDeclaration); end;