mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
ADD: Feature [0002263] [patch] cm_GoToFirstFile skip dirs
ADD: cm_GoToFirstEntry, cm_GoToLastEntry commands instead
This commit is contained in:
parent
04bd47a08d
commit
24f01ade52
4 changed files with 62 additions and 2 deletions
|
|
@ -104,6 +104,8 @@ type
|
|||
published // commands
|
||||
procedure cm_QuickSearch(const Params: array of string);
|
||||
procedure cm_QuickFilter(const Params: array of string);
|
||||
procedure cm_GoToFirstEntry(const {%H-}Params: array of string);
|
||||
procedure cm_GoToLastEntry(const {%H-}Params: array of string);
|
||||
procedure cm_GoToFirstFile(const Params: array of string);
|
||||
procedure cm_GoToLastFile(const Params: array of string);
|
||||
end;
|
||||
|
|
@ -155,7 +157,7 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TOrderedFileView.cm_GoToFirstFile(const Params: array of string);
|
||||
procedure TOrderedFileView.cm_GoToFirstEntry(const Params: array of string);
|
||||
begin
|
||||
if not (IsEmpty or IsLoadingFileList) then
|
||||
begin
|
||||
|
|
@ -164,7 +166,7 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TOrderedFileView.cm_GoToLastFile(const Params: array of string);
|
||||
procedure TOrderedFileView.cm_GoToLastEntry(const Params: array of string);
|
||||
begin
|
||||
if not (IsEmpty or IsLoadingFileList) then
|
||||
begin
|
||||
|
|
@ -173,6 +175,38 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
procedure TOrderedFileView.cm_GoToFirstFile(const Params: array of string);
|
||||
var
|
||||
I: Integer;
|
||||
begin
|
||||
if not (IsEmpty or IsLoadingFileList) then
|
||||
begin
|
||||
SetFocus;
|
||||
for I:= 0 to FFiles.Count - 1 do
|
||||
if not (FFiles[I].FSFile.IsDirectory or FFiles[I].FSFile.IsLinkToDirectory) then
|
||||
begin
|
||||
SetActiveFile(I);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TOrderedFileView.cm_GoToLastFile(const Params: array of string);
|
||||
var
|
||||
I: Integer;
|
||||
begin
|
||||
if not (IsEmpty or IsLoadingFileList) then
|
||||
begin
|
||||
SetFocus;
|
||||
for I:= FFiles.Count - 1 downto 0 do
|
||||
if not (FFiles[I].FSFile.IsDirectory or FFiles[I].FSFile.IsLinkToDirectory) then
|
||||
begin
|
||||
SetActiveFile(I);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TOrderedFileView.cm_QuickFilter(const Params: array of string);
|
||||
begin
|
||||
if not IsLoadingFileList then
|
||||
|
|
|
|||
|
|
@ -2341,6 +2341,18 @@ object frmMain: TfrmMain
|
|||
Caption = 'Add path and file name to command line'
|
||||
OnExecute = actExecute
|
||||
end
|
||||
object actGoToFirstEntry: TAction
|
||||
Tag = 14
|
||||
Category = 'Navigation'
|
||||
Caption = 'Place cursor on first folder or file'
|
||||
OnExecute = actExecute
|
||||
end
|
||||
object actGoToLastEntry: TAction
|
||||
Tag = 14
|
||||
Category = 'Navigation'
|
||||
Caption = 'Place cursor on last folder or file'
|
||||
OnExecute = actExecute
|
||||
end
|
||||
object actGoToFirstFile: TAction
|
||||
Tag = 14
|
||||
Category = 'Navigation'
|
||||
|
|
|
|||
|
|
@ -85,6 +85,8 @@ type
|
|||
actChangeDirToParent: TAction;
|
||||
actEditPath: TAction;
|
||||
actHorizontalFilePanels: TAction;
|
||||
actGoToFirstEntry: TAction;
|
||||
actGoToLastEntry: TAction;
|
||||
actGoToFirstFile: TAction;
|
||||
actGoToLastFile: TAction;
|
||||
actCompareDirectories: TAction;
|
||||
|
|
|
|||
|
|
@ -193,6 +193,8 @@ type
|
|||
procedure cm_ShowButtonMenu(const Params: array of string);
|
||||
procedure cm_TransferLeft(const {%H-}Params: array of string);
|
||||
procedure cm_TransferRight(const {%H-}Params: array of string);
|
||||
procedure cm_GoToFirstEntry(const {%H-}Params: array of string);
|
||||
procedure cm_GoToLastEntry(const {%H-}Params: array of string);
|
||||
procedure cm_GoToFirstFile(const {%H-}Params: array of string);
|
||||
procedure cm_GoToLastFile(const {%H-}Params: array of string);
|
||||
procedure cm_Minimize(const {%H-}Params: array of string);
|
||||
|
|
@ -1464,6 +1466,16 @@ begin
|
|||
frmMain.SelectedPanel = fpLeft);
|
||||
end;
|
||||
|
||||
procedure TMainCommands.cm_GoToFirstEntry(const Params: array of string);
|
||||
begin
|
||||
frmMain.ActiveFrame.ExecuteCommand('cm_GoToFirstEntry', []);
|
||||
end;
|
||||
|
||||
procedure TMainCommands.cm_GoToLastEntry(const Params: array of string);
|
||||
begin
|
||||
frmMain.ActiveFrame.ExecuteCommand('cm_GoToLastEntry', []);
|
||||
end;
|
||||
|
||||
procedure TMainCommands.cm_GoToFirstFile(const Params: array of string);
|
||||
begin
|
||||
frmMain.ActiveFrame.ExecuteCommand('cm_GoToFirstFile', []);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue