mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 03:39:21 +02:00
IDE: Project/SourceEdit, optimize finding default highlighter. Only call codetools, if source has a pas-HL.
This commit is contained in:
parent
2a690eac26
commit
9e143167ff
@ -1967,8 +1967,15 @@ begin
|
|||||||
if LazStartsStr(EditorMacroVirtualDrive, FileName) then
|
if LazStartsStr(EditorMacroVirtualDrive, FileName) then
|
||||||
exit(IdeSyntaxHighlighters.GetIdForLazSyntaxHighlighter(lshFreePascal));
|
exit(IdeSyntaxHighlighters.GetIdForLazSyntaxHighlighter(lshFreePascal));
|
||||||
|
|
||||||
CompilerMode:=CodeToolBoss.GetCompilerModeForDirectory(ExtractFilePath(Filename));
|
Result := IdeSyntaxHighlighters.GetIdForFileExtension(ExtractFileExt(Filename));
|
||||||
Result := IdeSyntaxHighlighters.GetIdForFileExtension(ExtractFileExt(Filename), CompilerMode in [cmDELPHI,cmTP]);
|
|
||||||
|
if (Result > 0) and (IdeSyntaxHighlighters.SharedInstances[Result] is TIDESynPasSyn) then begin
|
||||||
|
CompilerMode:=CodeToolBoss.GetCompilerModeForDirectory(ExtractFilePath(Filename));
|
||||||
|
if CompilerMode in [cmDELPHI,cmTP] then
|
||||||
|
Result := IdeSyntaxHighlighters.GetIdForLazSyntaxHighlighter(lshDelphi)
|
||||||
|
else
|
||||||
|
Result := IdeSyntaxHighlighters.GetIdForLazSyntaxHighlighter(lshFreePascal);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TToolButton_GotoBookmarks }
|
{ TToolButton_GotoBookmarks }
|
||||||
|
Loading…
Reference in New Issue
Block a user