mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
ADD: new command for Editor: Find previous, assigned on Shift+F3
This commit is contained in:
parent
968fa5518a
commit
2291c5cab5
4 changed files with 29 additions and 2 deletions
|
|
@ -1263,6 +1263,9 @@ object frmEditor: TfrmEditor
|
|||
object miFindNext: TMenuItem
|
||||
Action = actEditFindNext
|
||||
end
|
||||
object miFindPrevious: TMenuItem
|
||||
Action = actEditFindPrevious
|
||||
end
|
||||
object miReplace: TMenuItem
|
||||
Action = actEditRplc
|
||||
Bitmap.Data = {
|
||||
|
|
@ -1617,6 +1620,11 @@ object frmEditor: TfrmEditor
|
|||
OnExecute = actExecute
|
||||
ShortCut = 16455
|
||||
end
|
||||
object actEditFindPrevious: TAction
|
||||
Category = 'Edit'
|
||||
Caption = 'Find previous'
|
||||
OnExecute = actExecute
|
||||
end
|
||||
end
|
||||
object pmContextMenu: TPopupMenu
|
||||
Images = ilImageList
|
||||
|
|
|
|||
|
|
@ -58,5 +58,6 @@ TFRMEDITOR.ACTEDITLINEENDLF.HINT=Unix (LF)
|
|||
TFRMEDITOR.ACTEDITLINEENDCRLF.CAPTION=Windows (CRLF)
|
||||
TFRMEDITOR.ACTEDITLINEENDCRLF.HINT=Windows (CRLF)
|
||||
TFRMEDITOR.ACTEDITGOTOLINE.CAPTION=Goto Line...
|
||||
TFRMEDITOR.ACTEDITFINDPREVIOUS.CAPTION=Find previous
|
||||
TFRMEDITOR.MISEPARATOR1.CAPTION=-
|
||||
TFRMEDITOR.MISEPARATOR2.CAPTION=-
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ type
|
|||
actEditLineEndCr: TAction;
|
||||
actEditLineEndLf: TAction;
|
||||
actEditGotoLine: TAction;
|
||||
actEditFindPrevious: TAction;
|
||||
ilImageList: TImageList;
|
||||
MainMenu1: TMainMenu;
|
||||
ActListEdit: TActionList;
|
||||
|
|
@ -55,6 +56,8 @@ type
|
|||
actFileSaveAs: TAction;
|
||||
actFileNew: TAction;
|
||||
actFileExit: TAction;
|
||||
MenuItem1: TMenuItem;
|
||||
miFindPrevious: TMenuItem;
|
||||
miGotoLine: TMenuItem;
|
||||
miEditLineEndCr: TMenuItem;
|
||||
miEditLineEndLf: TMenuItem;
|
||||
|
|
@ -195,6 +198,7 @@ type
|
|||
|
||||
|
||||
procedure cm_EditFindNext(const Params:array of string);
|
||||
procedure cm_EditFindPrevious(const Params:array of string);
|
||||
procedure cm_EditGotoLine(const Params:array of string);
|
||||
procedure cm_EditLineEndCr(const Params:array of string);
|
||||
procedure cm_EditLineEndCrLf(const Params:array of string);
|
||||
|
|
@ -327,8 +331,6 @@ begin
|
|||
Commands.ExecuteCommand(cmd, []);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
procedure TfrmEditor.EditorMouseWheelDown(Sender: TObject; Shift: TShiftState;
|
||||
MousePos: TPoint; var Handled: Boolean);
|
||||
var
|
||||
|
|
@ -877,6 +879,21 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TfrmEditor.cm_EditFindPrevious(const Params: array of string);
|
||||
begin
|
||||
if gFirstTextSearch then
|
||||
begin
|
||||
bSearchBackwards:=True;
|
||||
ShowSearchReplaceDialog(False);
|
||||
Exit;
|
||||
end;
|
||||
if sSearchText <> '' then
|
||||
begin
|
||||
Editor.SelEnd:=Editor.SelStart;
|
||||
DoSearchReplaceText(False, True);
|
||||
bSearchFromCaret:= True;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure TfrmEditor.cm_EditGotoLine(const Params:array of string);
|
||||
|
|
|
|||
|
|
@ -915,6 +915,7 @@ begin
|
|||
AddIfNotExists(['Ctrl+F'],[],'cm_EditFind');
|
||||
AddIfNotExists(['F2'],[],'cm_FileSave');
|
||||
AddIfNotExists(['F3'],[],'cm_EditFindNext');
|
||||
AddIfNotExists(['Shift+F3'],[],'cm_EditFindPrevious');
|
||||
AddIfNotExists(['Ctrl+N'],[],'cm_FileNew');
|
||||
AddIfNotExists(['Ctrl+S'],[],'cm_FileSave');
|
||||
AddIfNotExists(['Esc'],[],'cm_FileExit');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue