From 7904f51dc786f5038c8f325afa9d1118d7deb3ba Mon Sep 17 00:00:00 2001 From: maxim Date: Mon, 8 Jun 2015 23:47:17 +0000 Subject: [PATCH] Merged revision(s) 49210 #649ab6c422, 49222 #475b08884c, 49283 #922e30ce7c from trunk: SynEdit: Fixed Option for MouseLink (when not using MouseActions) / ssMeta on MAc ........ SynEdit: Fixed Option for MouseLink (when not using MouseActions) / ssMeta on MAc ........ SynEdit: Fixed overflow error ........ git-svn-id: branches/fixes_1_4@49296 - --- components/synedit/synedit.pp | 2 +- .../synedit/syneditmarkupctrlmouselink.pp | 2 +- components/synedit/syngutterlineoverview.pp | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/components/synedit/synedit.pp b/components/synedit/synedit.pp index f0e8a3b128..7a42fae677 100644 --- a/components/synedit/synedit.pp +++ b/components/synedit/synedit.pp @@ -1532,7 +1532,7 @@ begin AddCommand(emcStartColumnSelections, True, mbXLeft, ccSingle, cdDown, [ssShift, ssAlt], [ssShift, ssAlt], emcoSelectionContinue); end; if (emShowCtrlMouseLinks in AnOptions) then - AddCommand(emcMouseLink, False, mbXLeft, ccSingle, cdUp, [SYNEDIT_LINK_MODIFIER], [ssShift, ssAlt, ssCtrl]); + AddCommand(emcMouseLink, False, mbXLeft, ccSingle, cdUp, [SYNEDIT_LINK_MODIFIER], [ssShift, ssAlt, ssCtrl] + [SYNEDIT_LINK_MODIFIER]); if (emDoubleClickSelectsLine in AnOptions) then begin AddCommand(emcSelectLine, True, mbXLeft, ccDouble, cdDown, [], []); diff --git a/components/synedit/syneditmarkupctrlmouselink.pp b/components/synedit/syneditmarkupctrlmouselink.pp index cbb5107383..046fe07f7e 100644 --- a/components/synedit/syneditmarkupctrlmouselink.pp +++ b/components/synedit/syneditmarkupctrlmouselink.pp @@ -175,7 +175,7 @@ begin if not (emUseMouseActions in TCustomSynEdit(SynEdit).MouseOptions) then begin Result := (emShowCtrlMouseLinks in TCustomSynEdit(SynEdit).MouseOptions) and - (AShift * [ssShift, ssCtrl, ssAlt] = [ssCtrl]); + (AShift * ([ssShift, ssCtrl, ssAlt] + [SYNEDIT_LINK_MODIFIER]) = [SYNEDIT_LINK_MODIFIER]); exit; end; diff --git a/components/synedit/syngutterlineoverview.pp b/components/synedit/syngutterlineoverview.pp index 0feebd8204..e63d17ccac 100644 --- a/components/synedit/syngutterlineoverview.pp +++ b/components/synedit/syngutterlineoverview.pp @@ -850,7 +850,7 @@ begin if c = 0 then Result := -1 else - Result := ((ALine - 1) * Height) div c; + Result := (Int64(ALine - 1) * Int64(Height)) div c; end; function TSynGutterLineOverviewProvider.TextLineToPixelEnd(ALine: Integer): Integer; @@ -862,8 +862,8 @@ begin if c = 0 then Result := -1 else begin - Result := ((ALine - 1) * Height) div c; - n := ( ALine * Height) div c - 1; // next line - 1 pix + Result := (Int64(ALine - 1) * Int64(Height)) div c; + n := (Int64(ALine) * Int64(Height)) div c - 1; // next line - 1 pix if n > Result then Result := n; end; @@ -871,14 +871,14 @@ end; function TSynGutterLineOverviewProvider.PixelLineToText(ALineIdx: Integer): Integer; var - c: Integer; + c: Int64; begin c := Max(1, TextBuffer.Count); if c = 0 then Result := -1 else begin - Result := (ALineIdx * c) div Height + 1; - if ((Result - 1) * Height) div c <> ALineIdx then + Result := (Int64(ALineIdx) * c) div Height + 1; + if (Int64(Result - 1) * Int64(Height)) div c <> ALineIdx then inc(Result); end; end; @@ -1357,7 +1357,7 @@ begin if c = 0 then Result := -1 else - Result := (ALine - 1) * Height div c; + Result := Int64(ALine - 1) * Int64(Height) div c; end; function TSynGutterLineOverview.TextLineToPixelEnd(ALine: Integer): Integer; @@ -1369,8 +1369,8 @@ begin if c = 0 then Result := -1 else begin - Result := ((ALine - 1) * Height) div c; - n := ( ALine * Height) div c - 1; // next line - 1 pix + Result := (Int64(ALine - 1) * Int64(Height)) div c; + n := (Int64(ALine) * Int64(Height)) div c - 1; // next line - 1 pix if n > Result then Result := n; end;