Ide/EditorMacros: changed flag-names for internal/pseudo files

git-svn-id: trunk@38392 -
This commit is contained in:
martin 2012-08-26 16:09:17 +00:00
parent f6e9182888
commit c34825f8a2
4 changed files with 16 additions and 9 deletions

View File

@ -241,6 +241,9 @@ var
// SelectedEditorMacro: Selected, for playing with default shortcut
SelectedEditorMacro: TEditorMacro = nil;
const
EditorMacroVirtualDrive = '//EMacro:/';
implementation
var
@ -1064,8 +1067,8 @@ begin
M := CurrentEditorMacroList.Macros[lbRecordedView.ItemIndex];
if M = nil then exit;
LazarusIDE.DoOpenEditorFile(
'//EMacro:/'+MacroListToName(CurrentEditorMacroList)+'/'+M.MacroName,
-1, -1, [ofVirtualFile, ofEditorMacro]);
EditorMacroVirtualDrive+MacroListToName(CurrentEditorMacroList)+'/'+M.MacroName,
-1, -1, [ofVirtualFile, ofInternalFile]);
end;
procedure TMacroListView.btnRecordClick(Sender: TObject);

View File

@ -8802,7 +8802,7 @@ begin
SrcNotebook := SourceEditorManager.SourceWindows[WindowIndex];
// get syntax highlighter type
if (uifEditorMacro in AnUnitInfo.Flags) then
if (uifInternalFile in AnUnitInfo.Flags) then
AnUnitInfo.UpdateDefaultHighlighter(lshFreePascal)
else
AnUnitInfo.UpdateDefaultHighlighter(FilenameToLazSyntaxHighlighter(AFilename));
@ -9311,7 +9311,9 @@ begin
if not (sfProjectSaving in Flags) then
SaveSourceEditorChangesToCodeCache(nil);
if uifEditorMacro in AnUnitInfo.Flags then begin
if (uifInternalFile in AnUnitInfo.Flags) and
(copy(AnUnitInfo.Filename, 1, length(EditorMacroVirtualDrive)) = EditorMacroVirtualDrive)
then begin
// save to macros
EMacro := MacroListViewer.MacroByFullName(AnUnitInfo.Filename);
if EMacro <> nil then begin
@ -9726,7 +9728,7 @@ begin
UnitIndex:=Project1.IndexOfFilename(AFilename);
if (UnitIndex > 0) then begin
NewUnitInfo:=Project1.Units[UnitIndex];
if (uifEditorMacro in NewUnitInfo.Flags) and
if (uifInternalFile in NewUnitInfo.Flags) and
(NewUnitInfo.OpenEditorInfoCount > 0)
then begin
NewEditorInfo := NewUnitInfo.OpenEditorInfo[0];
@ -9739,7 +9741,9 @@ begin
end;
end;
if (ofEditorMacro in Flags) then begin
if (ofInternalFile in Flags) and
(copy(AFileName, 1, length(EditorMacroVirtualDrive)) = EditorMacroVirtualDrive)
then begin
FilenameNoPath := AFileName;
UnitIndex:=Project1.IndexOfFilename(AFilename);
@ -9755,7 +9759,7 @@ begin
else begin
NewUnitInfo:=Project1.Units[UnitIndex];
end;
NewUnitInfo.Flags := NewUnitInfo.Flags + [uifEditorMacro];
NewUnitInfo.Flags := NewUnitInfo.Flags + [uifInternalFile];
if NewUnitInfo.OpenEditorInfoCount > 0 then begin
NewEditorInfo := NewUnitInfo.OpenEditorInfo[0];

View File

@ -160,7 +160,7 @@ type
uifComponentUsedByDesigner,
uifComponentIndirectlyUsedByDesigner,
uifMarked,
uifEditorMacro
uifInternalFile // data from an internal source (e.g. an editor macro (pascal script) from memory)
);
TUnitInfoFlags = set of TUnitInfoFlag;

View File

@ -42,7 +42,7 @@ type
ofDoLoadResource,// do open form, datamodule, ... (overriding default)
ofLoadHiddenResource,// load component hidden
ofAddToProject, // add file to project (if exists)
ofEditorMacro // opening an editor macro (pascal script) from memory
ofInternalFile // opening data from an internal source (e.g. an editor macro (pascal script) from memory)
);
TOpenFlags = set of TOpenFlag;