summaryrefslogtreecommitdiffstats
path: root/src/key_command/command.rs
diff options
context:
space:
mode:
authorDLFW <daniel@llin.info>2022-10-20 17:17:02 +0200
committerGitHub <noreply@github.com>2022-10-20 11:17:02 -0400
commit7d89ec31a0028957bbbcb47cabc67d47523820dc (patch)
treeac9d1d3c770531d00caab2a6ccea612ce78ff01e /src/key_command/command.rs
parente59ed84f5ac3ba864b6c0d2bcdb6a014d2d46e73 (diff)
Add linemode feature and first simple linemodes (#206)
This adds the basic ability to change the representation of files in the TUI detailed dir list by letting the user choose a certain "linemode". As of now, there are only three simple linemodes, all showing the filename on the left side and a preceding symlink indicator in the beginning of the right label as usual. The "size" linemode shows the right label as it has been up to now. The "mtime" linemode shows the mtime of the file or directory. The "sizemtime" linemodes combines both meta-data. The user can change the linemode like so: ``` :linemode [size|mtime|sizemtime] ``` Default keybindings have been added: ``ms`` for *size*, ``mm`` for *mtime*, and ``mM`` for *sizemtime*. The selected linemode is specific for each tab. A new tab always starts with the *size* linemode. Possible enhancements: * Move the code for factoring a label out of the ``tui_dirlist_detailed`` module to some UI-independent module * Add a configuration option for the default linemode for new tabs * Add further simple linemodes * Generic support for linemodes with only one “full line label” * Add support for custom linemodes where a label is constructed by an external script
Diffstat (limited to 'src/key_command/command.rs')
-rw-r--r--src/key_command/command.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/key_command/command.rs b/src/key_command/command.rs
index bc8fe6d..5da7e27 100644
--- a/src/key_command/command.rs
+++ b/src/key_command/command.rs
@@ -1,7 +1,7 @@
use std::path;
use crate::commands::quit::QuitAction;
-use crate::config::option::{LineNumberStyle, SelectOption, SortType};
+use crate::config::option::{LineMode, LineNumberStyle, SelectOption, SortType};
use crate::io::FileOperationOptions;
#[derive(Clone, Debug)]
@@ -53,6 +53,8 @@ pub enum Command {
CursorMovePageMiddle,
CursorMovePageEnd,
+ SetLineMode(LineMode),
+
ParentCursorMoveUp {
offset: usize,
},