diff options
author | Kyohei Uto <im@kyoheiu.dev> | 2023-12-10 05:03:32 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-10 05:03:32 +0900 |
commit | 3e86ca512e35d56d665e79cee2693ce31e62fa64 (patch) | |
tree | 00d8a10d4fb76860d604177b4ee32ed32f663b2f | |
parent | 81494c291d472e48cbe59ce8a28787190f2ace10 (diff) | |
parent | 9e03938efe5289eae394968a5713650aedcb9131 (diff) |
Merge pull request #260 from kyoheiu/developv2.11.1
v2.11.1
-rw-r--r-- | CHANGELOG.md | 6 | ||||
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | README.md | 7 | ||||
-rw-r--r-- | src/run.rs | 94 |
5 files changed, 62 insertions, 49 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 3334892..58b75ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ ## Unreleased +## v2.11.1 (2023-12-10) + +### Fixed + +- Allow SHIFT key to enter characters after `i`, `I`, `c`, `/`, `:` and `z`. + ## v2.11.0 (2023-12-09) ### Added @@ -330,7 +330,7 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "felix" -version = "2.11.0" +version = "2.11.1" dependencies = [ "bwrap", "chrono", @@ -1,6 +1,6 @@ [package] name = "felix" -version = "2.11.0" +version = "2.11.1" authors = ["Kyohei Uto <im@kyoheiu.dev>"] edition = "2021" description = "tui file manager with vim-like key mapping" @@ -25,11 +25,18 @@ For more detailed document, visit https://kyoheiu.dev/felix. ## New release +## v2.11.1 (2023-12-10) + +### Fixed + +- Allow SHIFT key to enter characters after `i`, `I`, `c`, `/`, `:` and `z`. + ## v2.11.0 (2023-12-09) ### Added - `<C-h>` for Backspace functionality after `i`, `I`, `c`, `/`, `:` and `z`. + ## v2.10.2 (2023-11-26) ### Fixed @@ -766,7 +766,7 @@ fn _run(mut state: State, session_path: PathBuf) -> Result<(), FxError> { } } - (KeyCode::Char(c), KeyModifiers::NONE) => { + (KeyCode::Char(c), _) => { command.insert( (current_pos - INITIAL_POS_Z).into(), c, @@ -922,28 +922,6 @@ fn _run(mut state: State, session_path: PathBuf) -> Result<(), FxError> { } } - (KeyCode::Char(c), KeyModifiers::NONE) => { - if let Some(to_be_added) = - unicode_width::UnicodeWidthChar::width(c) - { - if current_pos + to_be_added as u16 - > state.layout.terminal_column - { - continue; - } - new_name.insert(current_char_pos, c); - current_char_pos += 1; - current_pos += to_be_added as u16; - - go_to_info_line_and_reset(); - print!( - " {}", - &new_name.iter().collect::<String>(), - ); - move_to(current_pos, 2); - } - } - (KeyCode::Enter, KeyModifiers::NONE) => { hide_cursor(); //Set the command and argument(s). @@ -968,6 +946,28 @@ fn _run(mut state: State, session_path: PathBuf) -> Result<(), FxError> { break 'insert; } + (KeyCode::Char(c), _) => { + if let Some(to_be_added) = + unicode_width::UnicodeWidthChar::width(c) + { + if current_pos + to_be_added as u16 + > state.layout.terminal_column + { + continue; + } + new_name.insert(current_char_pos, c); + current_char_pos += 1; + current_pos += to_be_added as u16; + + go_to_info_line_and_reset(); + print!( + " {}", + &new_name.iter().collect::<String>(), + ); + move_to(current_pos, 2); + } + } + _ => continue, } screen.flush()?; @@ -1293,7 +1293,7 @@ fn _run(mut state: State, session_path: PathBuf) -> Result<(), FxError> { } } - (KeyCode::Char(c), KeyModifiers::NONE) => { + (KeyCode::Char(c), _) => { if let Some(to_be_added) = unicode_width::UnicodeWidthChar::width(c) { @@ -1432,7 +1432,7 @@ fn _run(mut state: State, session_path: PathBuf) -> Result<(), FxError> { } } - (KeyCode::Char(c), KeyModifiers::NONE) => { + (KeyCode::Char(c), _) => { if let Some(to_be_added) = unicode_width::UnicodeWidthChar::width(c) { @@ -2048,28 +2048,6 @@ fn _run(mut state: State, session_path: PathBuf) -> Result<(), FxError> { } } - (KeyCode::Char(c), KeyModifiers::NONE) => { - if let Some(to_be_added) = - unicode_width::UnicodeWidthChar::width(c) - { - if current_pos + to_be_added as u16 - > state.layout.terminal_column - { - continue; - } - command.insert(current_char_pos, c); - current_char_pos += 1; - current_pos += to_be_added as u16; - - go_to_info_line_and_reset(); - print!( - ":{}", - &command.iter().collect::<String>(), - ); - move_to(current_pos, 2); - } - } - (KeyCode::Enter, KeyModifiers::NONE) => { hide_cursor(); //Set the command and argument(s). @@ -2228,6 +2206,28 @@ fn _run(mut state: State, session_path: PathBuf) -> Result<(), FxError> { break 'command; } + (KeyCode::Char(c), _) => { + if let Some(to_be_added) = + unicode_width::UnicodeWidthChar::width(c) + { + if current_pos + to_be_added as u16 + > state.layout.terminal_column + { + continue; + } + command.insert(current_char_pos, c); + current_char_pos += 1; + current_pos += to_be_added as u16; + + go_to_info_line_and_reset(); + print!( + ":{}", + &command.iter().collect::<String>(), + ); + move_to(current_pos, 2); + } + } + _ => continue, } screen.flush()?; |