Skip to content

Commit

Permalink
Updated exit key bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
darrenldl committed Nov 26, 2024
1 parent 4f328c4 commit 3defc13
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

## 9.0.0-rc2

- Added `Esc` exit key binding to key binding info on screen
- Added `Ctrl`+`C` exit key binding to key binding info on screen

- Removed `Ctrl`+`C` exit key binding since it's prone to being
triggered accidentally
- Updated exit keys

- To exit Docfd: `q`, `Ctrl`+`Q` or `Ctrl`+`C`

- To exit other modes: `Esc`

- Now defaults to not scanning hidden files and directories

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,9 @@ Docfd operates in modes, the initial mode is navigation mode.

Navigation mode
- Exit Docfd
- `Esc`
- `Ctrl`+`C`
- `Ctrl`+`Q`
- `q`
- Open document
- `Enter`
- Docfd tries to use `$VISUAL` first, if that fails then Docfd tries `$EDITOR`
Expand Down
6 changes: 4 additions & 2 deletions bin/ui.ml
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ module Bottom_pane = struct
let navigate_grid =
[
[
{ label = "Esc"; msg = "exit" };
{ label = "Ctrl+C"; msg = "exit" };
{ label = "/"; msg = "search mode" };
{ label = "m"; msg = "mark/unmark document" };
{ label = "n"; msg = "narrow mode" };
Expand Down Expand Up @@ -739,7 +739,9 @@ let keyboard_handler
match Lwd.peek Ui_base.Vars.input_mode with
| Navigate -> (
match key with
| (`Escape, []) -> (
| (`ASCII 'C', [`Ctrl])
| (`ASCII 'Q', [`Ctrl])
| (`ASCII 'q', []) -> (
Lwd.set Ui_base.Vars.quit true;
Ui_base.Vars.action := None;
`Handled
Expand Down

0 comments on commit 3defc13

Please sign in to comment.