mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 13:19:30 +02:00
IDE EditorMacros: Fix saving macro, after editing in source-editor
git-svn-id: trunk@43948 -
This commit is contained in:
parent
6244202efc
commit
350b983c0e
@ -244,7 +244,7 @@ var
|
|||||||
SelectedEditorMacro: TEditorMacro = nil;
|
SelectedEditorMacro: TEditorMacro = nil;
|
||||||
|
|
||||||
const
|
const
|
||||||
EditorMacroVirtualDrive = '%Macro:/';
|
EditorMacroVirtualDrive = '%Macro:|'; // do not use \ or /, they can be converted by the IDE
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -1070,7 +1070,7 @@ begin
|
|||||||
M := CurrentEditorMacroList.Macros[lbRecordedView.ItemIndex];
|
M := CurrentEditorMacroList.Macros[lbRecordedView.ItemIndex];
|
||||||
if M = nil then exit;
|
if M = nil then exit;
|
||||||
LazarusIDE.DoOpenEditorFile(
|
LazarusIDE.DoOpenEditorFile(
|
||||||
EditorMacroVirtualDrive+MacroListToName(CurrentEditorMacroList)+'/'+M.MacroName,
|
EditorMacroVirtualDrive+MacroListToName(CurrentEditorMacroList)+'|'+M.MacroName,
|
||||||
-1, -1, [ofVirtualFile, ofInternalFile]);
|
-1, -1, [ofVirtualFile, ofInternalFile]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1347,14 +1347,14 @@ end;
|
|||||||
function TMacroListView.MacroByFullName(AName: String): TEditorMacro;
|
function TMacroListView.MacroByFullName(AName: String): TEditorMacro;
|
||||||
const
|
const
|
||||||
FolderStart = length(EditorMacroVirtualDrive)+1;
|
FolderStart = length(EditorMacroVirtualDrive)+1;
|
||||||
NameStart = FolderStart+length('PRJ/');
|
NameStart = FolderStart+length('PRJ|');
|
||||||
var
|
var
|
||||||
Alist: TEditorMacroList;
|
Alist: TEditorMacroList;
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
Result := nil;
|
Result := nil;
|
||||||
If (copy(AName, 1, length(EditorMacroVirtualDrive)) <> EditorMacroVirtualDrive) or
|
If (copy(AName, 1, length(EditorMacroVirtualDrive)) <> EditorMacroVirtualDrive) or
|
||||||
(copy(AName, NameStart-1, 1) <> '/')
|
(copy(AName, NameStart-1, 1) <> '|')
|
||||||
then exit;
|
then exit;
|
||||||
Alist := NameToMacroList(copy(AName, FolderStart, 3));
|
Alist := NameToMacroList(copy(AName, FolderStart, 3));
|
||||||
if (Alist = nil) then exit;
|
if (Alist = nil) then exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user