diff options
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/linemode.rs | 13 | ||||
-rw-r--r-- | src/commands/mod.rs | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/commands/linemode.rs b/src/commands/linemode.rs new file mode 100644 index 0000000..82668f6 --- /dev/null +++ b/src/commands/linemode.rs @@ -0,0 +1,13 @@ +use super::reload; +use crate::config::option::LineMode; +use crate::context::AppContext; +use crate::error::JoshutoResult; +use crate::history::DirectoryHistory; + +pub fn set_linemode(context: &mut AppContext, linemode: LineMode) -> JoshutoResult { + let curr_tab = context.tab_context_mut().curr_tab_mut(); + curr_tab.option_mut().linemode = linemode; + curr_tab.history_mut().depreciate_all_entries(); + reload::soft_reload_curr_tab(context)?; + Ok(()) +} diff --git a/src/commands/mod.rs b/src/commands/mod.rs index c4f7531..cf7ef53 100644 --- a/src/commands/mod.rs +++ b/src/commands/mod.rs @@ -8,6 +8,7 @@ pub mod file_ops; pub mod filter; pub mod flat; pub mod line_nums; +pub mod linemode; pub mod new_directory; pub mod numbered_command; pub mod open_file; |