ソースを参照

* Update syntaxhighlight settings on desktop load. Partial fix for 5813.

git-svn-id: trunk@16587 -
marco 14 年 前
コミット
c57c039362
1 ファイル変更15 行追加2 行削除
  1. 15 2
      ide/fpdesk.pas

+ 15 - 2
ide/fpdesk.pas

@@ -47,7 +47,7 @@ uses Dos,
      Video,
      Views,App,HistList,BrowCol,
      WUtils,WResourc,WViews,WEditor,
-     fpdebug,
+     fpdebug, wcedit,
 {$ifdef Unix}
      FPKeys,
 {$endif Unix}
@@ -352,6 +352,14 @@ begin
 {$endif NODEBUG}
 end;
 
+
+function DeskUseSyntaxHighlight(Editor: PFileEditor): boolean;
+var b : boolean;
+begin
+  b:= (*(Editor^.IsFlagSet(efSyntaxHighlight)) and *) ((Editor^.FileName='') or MatchesFileList(NameAndExtOf(Editor^.FileName),HighlightExts));
+  DeskUseSyntaxHighlight:=b;
+end;
+
 function ReadOpenWindows(F: PResourceFile): boolean;
 var S: PMemoryStream;
     OK: boolean;
@@ -393,7 +401,12 @@ begin
           end
         else
         begin
-          GetData(L,sizeof(L)); SW^.Editor^.SetFlags(L);
+          GetData(L,sizeof(L));
+          If DeskUseSyntaxHighlight(SW^.Editor) Then
+            L:=L or efSyntaxHighlight
+          else
+            L:=L and not efSyntaxHighlight;
+          SW^.Editor^.SetFlags(L);
           GetData(TP,sizeof(TP)); GetData(TP2,sizeof(TP2));
           SW^.Editor^.SetSelection(TP,TP2);
           GetData(TP,sizeof(TP)); SW^.Editor^.SetCurPtr(TP.X,TP.Y);