View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0030012 | Lazarus | IDE | public | 2016-04-14 17:41 | 2016-08-16 23:10 |
Reporter | silvioprog | Assigned To | Martin Friebe | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Product Version | 1.7 (SVN) | ||||
Target Version | 1.8 | Fixed in Version | 1.7 (SVN) | ||
Summary | 0030012: [FEATURE REQUEST] Source Editor: jump to the marked line by clicking on it | ||||
Description | Hello, The new Source Editor shows small marks as illustrated in the attached picture. These marks are put in the exactly source line when it has warning, hints, errors, notes etc. However, in the current trunk version, you need to roll the scrollbar to go to the marked line. It would be nice if these marks could accept clicks, allowing the programmer to jump to the marked line just by clicking on it. Thank you! | ||||
Steps To Reproduce | Topic about this feature request: http://lists.lazarus.freepascal.org/pipermail/lazarus/2016-April/098422.html | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 52292 | ||||
LazTarget | 1.8 | ||||
Widgetset | |||||
Attached Files |
|
|
|
|
I would say the marks don't need to accept click. The whole bar should accept them. |
|
Do you mean to evolve the bar to a minimap? https://atom.io/packages/minimap |
|
SynEditMarkG.diff (1,917 bytes)
Index: components/synedit/syngutterlineoverview.pp =================================================================== --- components/synedit/syngutterlineoverview.pp (revision 52254) +++ components/synedit/syngutterlineoverview.pp (working copy) @@ -304,6 +304,7 @@ function TextLineToPixelEnd(ALine: Integer): Integer; procedure DoResize(Sender: TObject); override; Procedure PaintWinControl(Sender: TObject); + Procedure OnClickWinControl(Sender: TObject); public destructor Destroy; override; procedure Assign(Source: TPersistent); override; @@ -1267,7 +1268,6 @@ end; { TSynGutterLineOverview } - procedure TSynGutterLineOverview.Init; begin inherited Init; @@ -1277,6 +1277,7 @@ FWinControl.Parent := SynEdit; FWinControl.DoubleBuffered := SynEdit.DoubleBuffered; FWinControl.OnPaint := @PaintWinControl; + FWinControl.OnClick := @OnClickWinControl; FLineMarks := TSynGutterLOvLineMarksList.Create; FProviders := TSynGutterLineOverviewProviderList.Create(Self); @@ -1423,6 +1424,31 @@ FLineMarks[i].Paint(FWinControl.Canvas, AClip, 0, MarkHeight); end; +procedure TSynGutterLineOverview.OnClickWinControl(Sender: TObject); +var + i, markPixLine: Integer; + TextLine, ClientMouseY : Integer; + +begin + TextLine := -1; + ClientMouseY := Mouse.CursorPos.y - TWinControl(Sender).ClientOrigin.y; + + for i:= 0 to FLineMarks.Count-1 do + begin + markPixLine:= FLineMarks.GetLineMarks(i).PixLine; + if (ClientMouseY >= markPixLine) and (ClientMouseY <= (markPixLine+MarkHeight)) then + begin + TextLine := FLineMarks.GetLineMarks(i).GetMark(0).Line; + break; + end; + end; + // no marker where selected then exit + if TextLine < 0 then exit; + + CaretObj.CharPos := 0; + CaretObj.LinePos := TextLine; +end; + function TSynGutterLineOverview.GetMarkHeight: Integer; begin Result := FLineMarks.ItemHeight; |
|
I attached a patch which implements this feature, hope it works fine and no problem will arise. |
|
Thanks for the patch, but I choose a different way. SynEdit use "MouseActions" for handling clicks. Note, that if you changed the advanced settings in the IDE, the new clicks will not be added automatically. They will if you reset to the none-advanced settings (there is a reset button on the none advanced option page, in this case). |
|
Thanks for the patch. Just a addition: it should show the hand point (crHandPoint) cursor in the marks, indicating its clickability. :-) |
|
Thank you! (y) |
Date Modified | Username | Field | Change |
---|---|---|---|
2016-04-14 17:41 | silvioprog | New Issue | |
2016-04-14 17:41 | silvioprog | File Added: marks.png | |
2016-04-14 18:27 | Martin Friebe | LazTarget | => - |
2016-04-14 18:27 | Martin Friebe | Assigned To | => Martin Friebe |
2016-04-14 18:27 | Martin Friebe | Status | new => acknowledged |
2016-04-16 08:05 | Ondrej Pokorny | Note Added: 0092054 | |
2016-04-16 16:51 | Vojtech Cihak | Note Added: 0092057 | |
2016-04-29 02:29 | shobits1 | File Added: SynEditMarkG.diff | |
2016-04-29 02:30 | shobits1 | Note Added: 0092285 | |
2016-04-29 02:32 | shobits1 | Note Edited: 0092285 | View Revisions |
2016-05-09 21:32 | Martin Friebe | Fixed in Revision | => 52292 |
2016-05-09 21:32 | Martin Friebe | LazTarget | - => 1.8 |
2016-05-09 21:32 | Martin Friebe | Note Added: 0092476 | |
2016-05-09 21:32 | Martin Friebe | Status | acknowledged => resolved |
2016-05-09 21:32 | Martin Friebe | Fixed in Version | => 1.7 (SVN) |
2016-05-09 21:32 | Martin Friebe | Resolution | open => fixed |
2016-05-09 21:32 | Martin Friebe | Target Version | => 1.8 |
2016-08-02 07:04 | silvioprog | Note Added: 0093958 | |
2016-08-16 23:10 | silvioprog | Note Added: 0094150 | |
2016-08-16 23:10 | silvioprog | Status | resolved => closed |