IDE: SourceEditor change Highlighter, don't show internal dummy HL.

(cherry picked from commit 046947520c)
This commit is contained in:
Martin 2024-12-09 20:16:32 +01:00
parent 17dd1f61a0
commit fb6edd5b06

View File

@ -7231,7 +7231,7 @@ begin
if SrcEdit=nil then exit;
if Sender is TIDEMenuItem then begin
IDEMenuItem:=TIDEMenuItem(Sender);
i:=IDEMenuItem.SectionIndex;
i:=IDEMenuItem.Tag;
if (i>=0) and (i<EditorOpts.HighlighterList.Count) then begin
SrcEdit.SyntaxHighlighterId:=i;
SrcEdit.UpdateProjectFile([sepuChangedHighlighter]);
@ -7690,6 +7690,8 @@ var
begin
SrcEditSubMenuHighlighter.ChildrenAsSubMenu:=true;
for i := 0 to EditorOpts.HighlighterList.Count - 1 do begin
if EditorOpts.HighlighterList.SharedSynInstances[i] is TNonSrcIDEHighlighter then
continue;
CurName:='Highlighter'+IntToStr(i);
CurCaption:= EditorOpts.HighlighterList.Captions[i];
if SrcEditSubMenuHighlighter.Count=i then begin
@ -7699,6 +7701,7 @@ begin
end else begin
IDEMenuItem:=SrcEditSubMenuHighlighter[i];
IDEMenuItem.Caption:=CurCaption;
IDEMenuItem.Tag:=i;
IDEMenuItem.OnClick:=@HighlighterClicked;
end;
if IDEMenuItem is TIDEMenuCommand then