mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 19:58:18 +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
|
||||
exit(IdeSyntaxHighlighters.GetIdForLazSyntaxHighlighter(lshFreePascal));
|
||||
|
||||
CompilerMode:=CodeToolBoss.GetCompilerModeForDirectory(ExtractFilePath(Filename));
|
||||
Result := IdeSyntaxHighlighters.GetIdForFileExtension(ExtractFileExt(Filename), CompilerMode in [cmDELPHI,cmTP]);
|
||||
Result := IdeSyntaxHighlighters.GetIdForFileExtension(ExtractFileExt(Filename));
|
||||
|
||||
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;
|
||||
|
||||
{ TToolButton_GotoBookmarks }
|
||||
|
Loading…
Reference in New Issue
Block a user