summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorquentin konieczko <konieczko@gmail.com>2023-05-18 17:57:55 +0200
committerquentin konieczko <konieczko@gmail.com>2023-05-18 17:58:14 +0200
commitd16674dc472c00786fd20274a9e2f69820c5c4b1 (patch)
treeb0c3d37816a7204a65bdea7f2a0083c1effcdbff
parent90a9dc1112f2507bd094617cad92e3ce62e8dc76 (diff)
FIX: Help string susbtitution aren't aligned properlyv0.1.21-dev
-rw-r--r--development.md6
-rw-r--r--readme.md7
-rw-r--r--src/help.rs160
3 files changed, 92 insertions, 81 deletions
diff --git a/development.md b/development.md
index 3fccf8e..6ba0f4b 100644
--- a/development.md
+++ b/development.md
@@ -483,10 +483,14 @@ New view: Tree ! Toggle with 't', fold with 'z'. Navigate normally.
- [x] execute a command with sudo privileges
- [x] FIX: modification time used `%d/%m/%y`. Changed to `%Y/%m/%d` to allow sorting and respect conventions
- [x] display sort kind in first row
-- [ ] EventExec refactor
+- [x] EventExec refactor
- [x] event: linked to an Action, same name
- [x] exec: linked to an executable mode, same name
- [x] every helper should be moved outside the struct
+- [x] FIX: impossible to compile on MacOs since to `sysinfo::Disk` only implement `PartialEq` on linux.
+ Can't test MacOs compilation since I don't own a mac...
+- [x] FIX: incompatible config files between versions crashes the app.
+- [x] FIX: Help string susbtitution aren't aligned properly
## TODO
diff --git a/readme.md b/readme.md
index 358efcf..8fa797a 100644
--- a/readme.md
+++ b/readme.md
@@ -23,6 +23,13 @@ Options:
-V, --version Print version information
```
+## Platform
+
+Linux is the only supported platform.
+
+- Version 0.1.20 doesn't compile on MacOS (see [#77](https://github.com/qkzk/fm/issues/77)).
+- Version 0.1.21 fixes this bug but I can't test more since I don't own a mac :)
+
## Video
![fm](./fm.gif)
diff --git a/src/help.rs b/src/help.rs
index 9f5e968..2c93236 100644
--- a/src/help.rs
+++ b/src/help.rs
@@ -8,27 +8,27 @@ use crate::opener::Opener;
/// Default help key is `'h'`.
static HELP_TO_FORMAT: &str = "
-{Quit}: quit
-{Help}: help
+{Quit:<10}: quit
+{Help:<10}: help
- Navigation -
-{MoveLeft}: cd to parent directory
-{MoveRight}: cd to child directory
-{MoveUp}: one line up
-{MoveDown}: one line down
-{KeyHome}: go to first line
-{End}: go to last line
-{PageUp}: 10 lines up
-{PageDown}: 10 lines down
-{Tab}: cycle tab
+{MoveLeft:<10}: cd to parent directory
+{MoveRight:<10}: cd to child directory
+{MoveUp:<10}: one line up
+{MoveDown:<10}: one line down
+{KeyHome:<10}: go to first line
+{End:<10}: go to last line
+{PageUp:<10}: 10 lines up
+{PageDown:<10}: 10 lines down
+{Tab:<10}: cycle tab
- Actions -
-{ToggleDualPane}: toggle dual pane - if the width is sufficiant
-{TogglePreviewSecond}: toggle a preview on the second pane
-{ToggleDisplayFull}: toggle metadata on files
-{ToggleHidden}: toggle hidden
-{Shell}: shell in current directory
-{OpenFile}: open the selected file with :
+{ToggleDualPane:<10}: toggle dual pane - if the width is sufficiant
+{TogglePreviewSecond:<10}: toggle a preview on the second pane
+{ToggleDisplayFull:<10}: toggle metadata on files
+{ToggleHidden:<10}: toggle hidden
+{Shell:<10}: shell in current directory
+{OpenFile:<10}: open the selected file with :
- default {Default}
- audio {Audio}
- images {Bitmap}
@@ -39,86 +39,86 @@ static HELP_TO_FORMAT: &str = "
- vectorials {Vectorial}
- compressed files are decompressed
- iso images are mounted
-{NvimFilepicker}: open in current nvim session
-{NvimSetAddress}: setup the nvim rpc address
-{Preview}: preview this file
-{MediaInfo}: display infos about a media file
-{Back}: move back to previous dir
-{Home}: move to $HOME
-{GoRoot}: move to root (/)
-{GoStart}: move to starting point
-{MarksNew}: mark current path
-{MarksJump}: jump to a mark
-{SearchNext}: search next matching element
-{FuzzyFind}: fuzzy finder
-{FuzzyFindLine}: fuzzy finder for line
-{FuzzyFindHelp}: fuzzy finder from help
-{RefreshView}: refresh view
-{CopyFilename}: copy filename to clipboard
-{CopyFilepath}: copy filepath to clipboard
-{DragNDrop}: dragon-drop selected file
-{OpenConfig}: open the config file
-{SetWallpaper}: set the selected file as wallpaper with nitrogen
+{NvimFilepicker:<10}: open in current nvim session
+{NvimSetAddress:<10}: setup the nvim rpc address
+{Preview:<10}: preview this file
+{MediaInfo:<10}: display infos about a media file
+{Back:<10}: move back to previous dir
+{Home:<10}: move to $HOME
+{GoRoot:<10}: move to root (/)
+{GoStart:<10}: move to starting point
+{MarksNew:<10}: mark current path
+{MarksJump:<10}: jump to a mark
+{SearchNext:<10}: search next matching element
+{FuzzyFind:<10}: fuzzy finder
+{FuzzyFindLine:<10}: fuzzy finder for line
+{FuzzyFindHelp:<10}: fuzzy finder from help
+{RefreshView:<10}: refresh view
+{CopyFilename:<10}: copy filename to clipboard
+{CopyFilepath:<10}: copy filepath to clipboard
+{DragNDrop:<10}: dragon-drop selected file
+{OpenConfig:<10}: open the config file
+{SetWallpaper:<10}: set the selected file as wallpaper with nitrogen
- Action on flagged files -
-{ToggleFlag}: toggle flag on a file
-{FlagAll}: flag all
-{ClearFlags}: clear flags
-{ReverseFlags}: reverse flags
-{Symlink}: symlink to current dir
-{CopyPaste}: copy to current dir
-{CutPaste}: move to current dir
-{DeleteFile}: delete files permanently
-{TrashMoveFile}: move to trash
-{Compress}: compress into an archive
-{Diff}: display the diff of the first 2 flagged files
+{ToggleFlag:<10}: toggle flag on a file
+{FlagAll:<10}: flag all
+{ClearFlags:<10}: clear flags
+{ReverseFlags:<10}: reverse flags
+{Symlink:<10}: symlink to current dir
+{CopyPaste:<10}: copy to current dir
+{CutPaste:<10}: move to current dir
+{DeleteFile:<10}: delete files permanently
+{TrashMoveFile:<10}: move to trash
+{Compress:<10}: compress into an archive
+{Diff:<10}: display the diff of the first 2 flagged files
- Trash -
-{TrashOpen}: Open the trash (enter to restore, del clear)
-{TrashEmpty}: Empty the trash
+{TrashOpen:<10}: Open the trash (enter to restore, del clear)
+{TrashEmpty:<10}: Empty the trash
- Tree -
Navigate as usual. Most actions works as in 'normal' view.
-{Tree}: Toggle tree mode
-{TreeFold}: Fold a node
-{TreeFoldAll}: Fold every node
-{TreeUnFoldAll}: Unfold every node
+{Tree:<10}: Toggle tree mode
+{TreeFold:<10}: Fold a node
+{TreeFoldAll:<10}: Fold every node
+{TreeUnFoldAll:<10}: Unfold every node
- MODES -
-{Tree}: TREE
-{Chmod}: CHMOD
-{Exec}: EXEC
-{NewDir}: NEWDIR
-{NewFile}: NEWFILE
-{Rename}: RENAME
-{Goto}: GOTO
-{RegexMatch}: REGEXMATCH
-{Jump}: JUMP
-{Sort}: SORT
-{History}: HISTORY
-{Shortcut}: SHORTCUT
-{EncryptedDrive}: ENCRYPTED DRIVE
+{Tree:<10}: TREE
+{Chmod:<10}: CHMOD
+{Exec:<10}: EXEC
+{NewDir:<10}: NEWDIR
+{NewFile:<10}: NEWFILE
+{Rename:<10}: RENAME
+{Goto:<10}: GOTO
+{RegexMatch:<10}: REGEXMATCH
+{Jump:<10}: JUMP
+{Sort:<10}: SORT
+{History:<10}: HISTORY
+{Shortcut:<10}: SHORTCUT
+{EncryptedDrive:<10}: ENCRYPTED DRIVE
(m: open & mount, u: unmount & close)
-{Search}: SEARCH
-{Command}: COMMAND
-{Bulk}: BULK
-{ShellMenu}: SHELL MENU
-{Filter}: FILTER
+{Search:<10}: SEARCH
+{Command:<10}: COMMAND
+{Bulk:<10}: BULK
+{ShellMenu:<10}: SHELL MENU
+{Filter:<10}: FILTER
(by name \"n name\", by ext \"e ext\", only directories d or all for reset)
-{Enter}: Execute mode then NORMAL
-{ResetMode}: NORMAL
+{Enter:<10}: Execute mode then NORMAL
+{ResetMode:<10}: NORMAL
- MOC -
Control MOC from your TUI
-{MocpAddToPlayList}: MOCP: Add a file or folder to the playlist
-{MocpPrevious}: MOCP: Previous song
-{MocpTogglePause}: MOCP: Toggle play/pause.
-{MocpNext}: MOCP: Next song
-{MocpGoToSong}: MOCP: Go to currently playing song
+{MocpAddToPlayList:<10}: MOCP: Add a file or folder to the playlist
+{MocpPrevious:<10}: MOCP: Previous song
+{MocpTogglePause:<10}: MOCP: Toggle play/pause.
+{MocpNext:<10}: MOCP: Next song
+{MocpGoToSong:<10}: MOCP: Go to currently playing song
";
const CUSTOM_HELP: &str = "
-- CUSTOM -
+- CUSTOM ACTIONS -
%s: the selected file,
%f: the flagged files,
%e: the extension of the file,