EditorOptions: preview syn click, improved finding char under mouse

git-svn-id: trunk@21193 -
This commit is contained in:
martin 2009-08-12 13:23:08 +00:00
parent c38d807c36
commit 4a7a1e4c5d

View File

@ -311,7 +311,7 @@ var
AddAttr: TAdditionalHilightAttribute; AddAttr: TAdditionalHilightAttribute;
NewNode: TTreeNode; NewNode: TTreeNode;
begin begin
MouseXY := Point(X, Y); MouseXY := Point(X - (ColorPreview.CharWidth div 2), Y);
XY := ColorPreview.PixelsToRowColumn(MouseXY); XY := ColorPreview.PixelsToRowColumn(MouseXY);
NewNode := nil; NewNode := nil;
// Gutter Colors // Gutter Colors
@ -341,7 +341,7 @@ begin
AddAttr := EditorOpts.HighlighterList[CurLanguageID].SampleLineToAddAttr(XY.Y); AddAttr := EditorOpts.HighlighterList[CurLanguageID].SampleLineToAddAttr(XY.Y);
if AddAttr = ahaFoldedCode then begin if AddAttr = ahaFoldedCode then begin
if (XY.X >= Length(ColorPreview.Lines[XY.Y-1]) + 4) and if (XY.X >= Length(ColorPreview.Lines[XY.Y-1]) + 4) and
(XY.X <= Length(ColorPreview.Lines[XY.Y-1]) + 7) then (XY.X <= Length(ColorPreview.Lines[XY.Y-1]) + 6) then
NewNode := ColorElementTree.Items.FindNodeWithText(COLOR_NODE_PREFIX+AdditionalHighlightAttributes[AddAttr]); NewNode := ColorElementTree.Items.FindNodeWithText(COLOR_NODE_PREFIX+AdditionalHighlightAttributes[AddAttr]);
end end
else if AddAttr <> ahaNone then else if AddAttr <> ahaNone then