Skip to content

Commit

Permalink
fix(view-mode): use #'View-quit
Browse files Browse the repository at this point in the history
view-mode itself recommends using this function to quit the mode in
in a message in its source code:

```
View mode: type \\[help-command] for help, \\[describe-mode] for commands, \\[View-quit] to quit.
```

Using `#'quit-window` does not work as expected when viewing a diff
using view-mode for a buffer in a save prompt in magit:
`#'quit-window` breaks the prompting sequence, whilst `#'View-quit` doesn't.
  • Loading branch information
gekoke committed Aug 26, 2024
1 parent 1a58502 commit f8ddc9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modes/view/evil-collection-view.el
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
(add-hook 'view-mode-hook 'evil-normalize-keymaps)
(evil-set-initial-state 'view-mode 'normal)
(evil-collection-define-key 'normal 'view-mode-map
"q" 'quit-window
"q" 'View-quit
(kbd "SPC") 'View-scroll-page-forward
(kbd "S-SPC") 'View-scroll-page-backward

Expand Down

0 comments on commit f8ddc9a

Please sign in to comment.