Skip to content

Commit 38cf196

Browse files
File find popup up/down keys resolves #977 (#993)
1 parent 1d409d3 commit 38cf196

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
- support `home` and `end` keys in branchlist ([#957](https://github.com/extrawurst/gitui/issues/957))
1515
- add `ghemoji` feature to make gh-emoji (GitHub emoji) optional ([#954](https://github.com/extrawurst/gitui/pull/954))
1616
- allow customizing key symbols like `` & `` ([see docs](https://github.com/extrawurst/gitui/blob/master/KEY_CONFIG.md#key-symbols)) ([#465](https://github.com/extrawurst/gitui/issues/465))
17+
- fuzzy finder up/down keys compatible with typing search patterns ([#993](https://github.com/extrawurst/gitui/pull/993))
1718

1819
### Fixed
1920
- honor options (for untracked files) in `stage_all` command ([#933](https://github.com/extrawurst/gitui/issues/933))

src/components/file_find_popup.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,9 @@ impl Component for FileFindPopup {
302302
|| *key == self.key_config.keys.enter
303303
{
304304
self.hide();
305-
} else if *key == self.key_config.keys.move_down {
305+
} else if *key == self.key_config.keys.popup_down {
306306
self.move_selection(ScrollType::Down);
307-
} else if *key == self.key_config.keys.move_up {
307+
} else if *key == self.key_config.keys.popup_up {
308308
self.move_selection(ScrollType::Up);
309309
}
310310
}

src/keys/key_list.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ pub struct KeysList {
4040
pub end: KeyEvent,
4141
pub move_up: KeyEvent,
4242
pub move_down: KeyEvent,
43+
pub popup_up: KeyEvent,
44+
pub popup_down: KeyEvent,
4345
pub page_down: KeyEvent,
4446
pub page_up: KeyEvent,
4547
pub shift_up: KeyEvent,
@@ -114,6 +116,8 @@ impl Default for KeysList {
114116
end: KeyEvent { code: KeyCode::End, modifiers: KeyModifiers::empty()},
115117
move_up: KeyEvent { code: KeyCode::Up, modifiers: KeyModifiers::empty()},
116118
move_down: KeyEvent { code: KeyCode::Down, modifiers: KeyModifiers::empty()},
119+
popup_up: KeyEvent { code: KeyCode::Up, modifiers: KeyModifiers::empty()},
120+
popup_down: KeyEvent { code: KeyCode::Down, modifiers: KeyModifiers::empty()},
117121
page_down: KeyEvent { code: KeyCode::PageDown, modifiers: KeyModifiers::empty()},
118122
page_up: KeyEvent { code: KeyCode::PageUp, modifiers: KeyModifiers::empty()},
119123
shift_up: KeyEvent { code: KeyCode::Up, modifiers: KeyModifiers::SHIFT},

vim_style_key_config.ron

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
end: ( code: End, modifiers: ( bits: 0,),),
4545
move_up: ( code: Char('k'), modifiers: ( bits: 0,),),
4646
move_down: ( code: Char('j'), modifiers: ( bits: 0,),),
47+
popup_up: ( code: Char('p'), modifiers: ( bits: 2,),),
48+
popup_down: ( code: Char('n'), modifiers: ( bits: 2,),),
4749
page_up: ( code: Char('b'), modifiers: ( bits: 2,),),
4850
page_down: ( code: Char('f'), modifiers: ( bits: 2,),),
4951
tree_collapse_recursive: ( code: Left, modifiers: ( bits: 1,),),

0 commit comments

Comments
 (0)