add the redoAll action

This commit is contained in:
Basile Burg 2022-08-08 15:07:19 +02:00
parent 1c03f6175a
commit 5966e03425
6 changed files with 108 additions and 50 deletions

View File

@ -1,3 +1,13 @@
# v3.9.24-dev
## Enhancements
- Editor, added the _Redo All_ action.
## Bugs fixed
- make projects, DUB was wrongly mentioned when trying to compile while previous build not finished.
# v3.9.23 # v3.9.23
## Enhancements ## Enhancements

View File

@ -91,6 +91,10 @@ inherited EditorWidget: TEditorWidget
Caption = 'Redo' Caption = 'Redo'
OnClick = mnuedRedoClick OnClick = mnuedRedoClick
end end
object enuItemRedoAll: TMenuItem
Caption = 'Redo all'
OnClick = enuItemRedoAllClick
end
object MenuItem11: TMenuItem object MenuItem11: TMenuItem
Caption = '-' Caption = '-'
end end

View File

@ -62,6 +62,7 @@ type
MenuItem14: TMenuItem; MenuItem14: TMenuItem;
MenuItem15: TMenuItem; MenuItem15: TMenuItem;
MenuItem16: TMenuItem; MenuItem16: TMenuItem;
enuItemRedoAll: TMenuItem;
mnuCurFileCopyName: TMenuItem; mnuCurFileCopyName: TMenuItem;
mnuCurFileShowInMiniExpl: TMenuItem; mnuCurFileShowInMiniExpl: TMenuItem;
mnuCurFileShellOpen: TMenuItem; mnuCurFileShellOpen: TMenuItem;
@ -112,6 +113,7 @@ type
editorStatus: TStatusBar; editorStatus: TStatusBar;
mnuEditor: TPopupMenu; mnuEditor: TPopupMenu;
mnuCurFile: TPopupMenu; mnuCurFile: TPopupMenu;
procedure enuItemRedoAllClick(Sender: TObject);
procedure FormShortCut(var Msg: TLMKey; var Handled: Boolean); procedure FormShortCut(var Msg: TLMKey; var Handled: Boolean);
procedure FormShow(Sender: TObject); procedure FormShow(Sender: TObject);
procedure mnuCurFileCopyNameClick(Sender: TObject); procedure mnuCurFileCopyNameClick(Sender: TObject);
@ -1090,6 +1092,12 @@ begin
end; end;
end; end;
procedure TEditorWidget.enuItemRedoAllClick(Sender: TObject);
begin
if fDoc.isAssigned then
fDoc.redoAll();
end;
procedure TEditorWidget.FormShow(Sender: TObject); procedure TEditorWidget.FormShow(Sender: TObject);
begin begin
if fDoc.isAssigned then if fDoc.isAssigned then

View File

@ -12,7 +12,6 @@ object MainForm: TMainForm
OnDropFiles = FormDropFiles OnDropFiles = FormDropFiles
OnResize = FormResize OnResize = FormResize
ShowHint = True ShowHint = True
LCLVersion = '2.2.0.4'
object mainMenu: TMainMenu object mainMenu: TMainMenu
Top = 1 Top = 1
object MenuItem1: TMenuItem object MenuItem1: TMenuItem
@ -138,6 +137,9 @@ object MainForm: TMainForm
object MenuItem20: TMenuItem object MenuItem20: TMenuItem
Action = actEdRedo Action = actEdRedo
end end
object MenuItem119: TMenuItem
Action = actEdRedoAll
end
object MenuItem21: TMenuItem object MenuItem21: TMenuItem
Caption = '-' Caption = '-'
end end
@ -418,7 +420,7 @@ object MainForm: TMainForm
end end
end end
object Actions: TActionList object Actions: TActionList
Left = 31 Left = 32
object actEdCopy: TAction object actEdCopy: TAction
Category = 'Edit' Category = 'Edit'
Caption = 'Copy' Caption = 'Copy'
@ -455,20 +457,6 @@ object MainForm: TMainForm
OnUpdate = updateDocEditBasedAction OnUpdate = updateDocEditBasedAction
ShortCut = 24666 ShortCut = 24666
end end
object actEdMacStartStop: TAction
Category = 'Edit'
Caption = 'Start/stop macro recording'
OnExecute = actEdMacStartStopExecute
OnUpdate = updateDocEditBasedAction
ShortCut = 24658
end
object actEdMacPlay: TAction
Category = 'Edit'
Caption = 'Play macro'
OnExecute = actEdMacPlayExecute
OnUpdate = updateDocEditBasedAction
ShortCut = 24656
end
object actFileSave: TAction object actFileSave: TAction
Category = 'File' Category = 'File'
Caption = 'Save file' Caption = 'Save file'
@ -530,20 +518,6 @@ object MainForm: TMainForm
OnExecute = actProjSourceExecute OnExecute = actProjSourceExecute
OnUpdate = updateProjectBasedAction OnUpdate = updateProjectBasedAction
end end
object actEdIndent: TAction
Category = 'Edit'
Caption = 'Indent'
OnExecute = actEdIndentExecute
OnUpdate = updateDocEditBasedAction
ShortCut = 24649
end
object actEdUnIndent: TAction
Category = 'Edit'
Caption = 'Unindent'
OnExecute = actEdUnIndentExecute
OnUpdate = updateDocEditBasedAction
ShortCut = 24661
end
object actProjOptView: TAction object actProjOptView: TAction
Category = 'Project' Category = 'Project'
Caption = 'View project command line' Caption = 'View project command line'
@ -583,20 +557,6 @@ object MainForm: TMainForm
OnExecute = actProjRunWithArgsExecute OnExecute = actProjRunWithArgsExecute
OnUpdate = updateProjectBasedAction OnUpdate = updateProjectBasedAction
end end
object actEdFind: TAction
Category = 'Edit'
Caption = 'Find...'
OnExecute = actEdFindExecute
OnUpdate = updateDocumentBasedAction
ShortCut = 16454
end
object actEdFindNext: TAction
Category = 'Edit'
Caption = 'Find next'
OnExecute = actEdFindNextExecute
OnUpdate = updateDocumentBasedAction
ShortCut = 114
end
object actProjOpenContFold: TAction object actProjOpenContFold: TAction
Category = 'Project' Category = 'Project'
Caption = 'View in mini explorer' Caption = 'View in mini explorer'
@ -819,12 +779,6 @@ object MainForm: TMainForm
OnExecute = actFileCloseAllExecute OnExecute = actFileCloseAllExecute
OnUpdate = updateDocumentBasedAction OnUpdate = updateDocumentBasedAction
end end
object actEdFormat: TAction
Category = 'Edit'
Caption = 'Apply code formatting'
OnExecute = actEdFormatExecute
OnUpdate = updateDocumentBasedAction
end
object actProjTest: TAction object actProjTest: TAction
Category = 'Project' Category = 'Project'
Caption = 'Test project' Caption = 'Test project'
@ -862,6 +816,61 @@ object MainForm: TMainForm
Caption = 'Check semantics' Caption = 'Check semantics'
OnExecute = actProjCheckSemaExecute OnExecute = actProjCheckSemaExecute
end end
object actEdRedoAll: TAction
Category = 'Edit'
Caption = 'Redo all'
OnExecute = actEdRedoAllExecute
OnUpdate = updateDocEditBasedAction
ShortCut = 49242
end
object actEdMacStartStop: TAction
Category = 'Edit'
Caption = 'Start/stop macro recording'
OnExecute = actEdMacStartStopExecute
OnUpdate = updateDocEditBasedAction
ShortCut = 24658
end
object actEdMacPlay: TAction
Category = 'Edit'
Caption = 'Play macro'
OnExecute = actEdMacPlayExecute
OnUpdate = updateDocEditBasedAction
ShortCut = 24656
end
object actEdIndent: TAction
Category = 'Edit'
Caption = 'Indent'
OnExecute = actEdIndentExecute
OnUpdate = updateDocEditBasedAction
ShortCut = 24649
end
object actEdUnIndent: TAction
Category = 'Edit'
Caption = 'Unindent'
OnExecute = actEdUnIndentExecute
OnUpdate = updateDocEditBasedAction
ShortCut = 24661
end
object actEdFind: TAction
Category = 'Edit'
Caption = 'Find...'
OnExecute = actEdFindExecute
OnUpdate = updateDocumentBasedAction
ShortCut = 16454
end
object actEdFindNext: TAction
Category = 'Edit'
Caption = 'Find next'
OnExecute = actEdFindNextExecute
OnUpdate = updateDocumentBasedAction
ShortCut = 114
end
object actEdFormat: TAction
Category = 'Edit'
Caption = 'Apply code formatting'
OnExecute = actEdFormatExecute
OnUpdate = updateDocumentBasedAction
end
end end
object ApplicationProperties1: TApplicationProperties object ApplicationProperties1: TApplicationProperties
OnActivate = ApplicationProperties1Activate OnActivate = ApplicationProperties1Activate

View File

@ -117,6 +117,7 @@ type
actFileCloseAll: TAction; actFileCloseAll: TAction;
actFileNewClip: TAction; actFileNewClip: TAction;
actEdFormat: TAction; actEdFormat: TAction;
actEdRedoAll: TAction;
actProjCheckSema: TAction; actProjCheckSema: TAction;
actProjSetEnv: TAction; actProjSetEnv: TAction;
actProjGitPull: TAction; actProjGitPull: TAction;
@ -186,6 +187,7 @@ type
MenuItem116: TMenuItem; MenuItem116: TMenuItem;
MenuItem117: TMenuItem; MenuItem117: TMenuItem;
MenuItem118: TMenuItem; MenuItem118: TMenuItem;
MenuItem119: TMenuItem;
mnuGitBranch: TMenuItem; mnuGitBranch: TMenuItem;
mnuItemDubDialog: TMenuItem; mnuItemDubDialog: TMenuItem;
mnuItemHelp: TMenuItem; mnuItemHelp: TMenuItem;
@ -330,6 +332,7 @@ type
procedure actProjSetEnvExecute(Sender: TObject); procedure actProjSetEnvExecute(Sender: TObject);
procedure actProjStopCompExecute(Sender: TObject); procedure actProjStopCompExecute(Sender: TObject);
procedure actProjTestExecute(Sender: TObject); procedure actProjTestExecute(Sender: TObject);
procedure actEdRedoAllExecute(Sender: TObject);
procedure actSetRunnableSwExecute(Sender: TObject); procedure actSetRunnableSwExecute(Sender: TObject);
procedure ApplicationProperties1Activate(Sender: TObject); procedure ApplicationProperties1Activate(Sender: TObject);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
@ -1558,6 +1561,7 @@ begin
actEdUndo.ImageIndex:= i; actEdUndo.ImageIndex:= i;
i := loadIcon('ARROW_REDO'); i := loadIcon('ARROW_REDO');
actEdRedo.ImageIndex:= i; actEdRedo.ImageIndex:= i;
actEdRedoAll.ImageIndex:= i;
i := loadIcon('FIND'); i := loadIcon('FIND');
actEdFind.ImageIndex:= i; actEdFind.ImageIndex:= i;
actEdFindNext.ImageIndex:= i; actEdFindNext.ImageIndex:= i;
@ -2891,6 +2895,12 @@ begin
fDoc.Redo; fDoc.Redo;
end; end;
procedure TMainForm.actEdRedoAllExecute(Sender: TObject);
begin
if fDoc.isAssigned then
fDoc.redoAll();
end;
procedure TMainForm.actEdMacPlayExecute(Sender: TObject); procedure TMainForm.actEdMacPlayExecute(Sender: TObject);
begin begin
if fDoc.isAssigned then if fDoc.isAssigned then
@ -4084,6 +4094,8 @@ begin
fProj.test; fProj.test;
end; end;
procedure TMainForm.actProjStopCompExecute(Sender: TObject); procedure TMainForm.actProjStopCompExecute(Sender: TObject);
begin begin
if fProj.isAssigned then if fProj.isAssigned then

View File

@ -381,6 +381,7 @@ type
procedure replaceUndoableContent(const value: string); procedure replaceUndoableContent(const value: string);
procedure setDscannerOptions(dsEnabled: boolean; dsDelay: integer); procedure setDscannerOptions(dsEnabled: boolean; dsDelay: integer);
procedure centerCursor(); procedure centerCursor();
procedure redoAll();
// //
property IdentifierMatchOptions: TIdentifierMatchOptions read fMatchOpts write setMatchOpts; property IdentifierMatchOptions: TIdentifierMatchOptions read fMatchOpts write setMatchOpts;
property Identifier: string read fIdentifier; property Identifier: string read fIdentifier;
@ -481,6 +482,7 @@ const
ecRightWordEdge = ecUserFirst + 31; ecRightWordEdge = ecUserFirst + 31;
ecSelLeftWordEdge = ecUserFirst + 32; ecSelLeftWordEdge = ecUserFirst + 32;
ecSelRightWordEdge = ecUserFirst + 33; ecSelRightWordEdge = ecUserFirst + 33;
ecRedoAll = ecUserFirst + 34;
var var
D2Syn: TSynD2Syn; // used as model to set the options when no editor exists. D2Syn: TSynD2Syn; // used as model to set the options when no editor exists.
TxtSyn: TSynTxtSyn; // used as model to set the options when no editor exists. TxtSyn: TSynTxtSyn; // used as model to set the options when no editor exists.
@ -1481,6 +1483,7 @@ begin
AddKey(ecSelRightWordEdge, 0, [], 0, []); AddKey(ecSelRightWordEdge, 0, [], 0, []);
AddKey(ecSmartWordLeft, 0, [], 0, []); AddKey(ecSmartWordLeft, 0, [], 0, []);
AddKey(ecSmartWordRight, 0, [], 0, []); AddKey(ecSmartWordRight, 0, [], 0, []);
AddKey(ecRedoAll, 0, [], 0, []);
end; end;
end; end;
@ -1520,6 +1523,7 @@ begin
'ecRightWordEdge': begin Int := ecRightWordEdge; exit(true); end; 'ecRightWordEdge': begin Int := ecRightWordEdge; exit(true); end;
'ecSelLeftWordEdge': begin Int := ecSelLeftWordEdge; exit(true); end; 'ecSelLeftWordEdge': begin Int := ecSelLeftWordEdge; exit(true); end;
'ecSelRightWordEdge': begin Int := ecSelRightWordEdge; exit(true); end; 'ecSelRightWordEdge': begin Int := ecSelRightWordEdge; exit(true); end;
'ecRedoAll': begin Int := ecRedoAll; exit(true); end;
else exit(false); else exit(false);
end; end;
end; end;
@ -1560,6 +1564,7 @@ begin
ecRightWordEdge: begin Ident := 'ecRightWordEdge'; exit(true); end; ecRightWordEdge: begin Ident := 'ecRightWordEdge'; exit(true); end;
ecSelLeftWordEdge: begin Ident := 'ecSelLeftWordEdge'; exit(true); end; ecSelLeftWordEdge: begin Ident := 'ecSelLeftWordEdge'; exit(true); end;
ecSelRightWordEdge: begin Ident := 'ecSelRightWordEdge'; exit(true); end; ecSelRightWordEdge: begin Ident := 'ecSelRightWordEdge'; exit(true); end;
ecRedoAll: begin Ident := 'ecRedoAll'; exit(true); end;
else exit(false); else exit(false);
end; end;
end; end;
@ -1692,6 +1697,8 @@ begin
gotoWordEdge(false); gotoWordEdge(false);
ecRightWordEdge, ecSelRightWordEdge: ecRightWordEdge, ecSelRightWordEdge:
gotoWordEdge(true); gotoWordEdge(true);
ecRedoAll:
redoAll();
end; end;
if fOverrideColMode and not SelAvail then if fOverrideColMode and not SelAvail then
begin begin
@ -2673,6 +2680,14 @@ begin
end; end;
end; end;
procedure TDexedMemo.redoAll();
begin
BeginUpdate(false);
while CanRedo do
Redo;
EndUpdate();
end;
procedure TDexedMemo.gotoWordEdge(right: boolean); procedure TDexedMemo.gotoWordEdge(right: boolean);
var var
s: string; s: string;