You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is possible to get helix to forget that the buffer is dirty and it shouldn't allow quitting without saving under certain conditions. Works with both scratch buffer and when editing a file.
Reproduction Steps
Follow the exact keystrokes: hx
Inside helix: i -> h (any single character insert is fine) -> <esc> -> :clipboard-paste-replace<CR> -> u -> u (at this point the dirty buffer indicator (the plus sign in the status line) goes away -> :q<CR>
This allows you to quit, even though the h character is still in the buffer. The steps work for editing a file also with an additional keystroke after the <esc> to move the cursor onto the h character.
Helix log
~/.cache/helix/helix.log
2024-02-12T18:37:33.260 helix_view::clipboard [DEBUG] Using xsel to interact with the system and selection (primary) clipboard
2024-02-12T18:37:33.263 helix_tui::backend::crossterm [DEBUG] The keyboard enhancement protocol is not supported in this terminal (checked in 2.711014ms)
2024-02-12T18:37:33.263 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2024-02-12T18:37:33.511 helix_term::application [DEBUG] received editor event: IdleTimer
2024-02-12T18:37:34.604 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2024-02-12T18:37:35.451 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2024-02-12T18:37:35.702 helix_term::application [DEBUG] received editor event: IdleTimer
2024-02-12T18:37:35.703 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2024-02-12T18:37:36.597 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 1
2024-02-12T18:37:36.598 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 1
2024-02-12T18:37:36.956 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 1
2024-02-12T18:37:37.208 helix_term::application [DEBUG] received editor event: IdleTimer
2024-02-12T18:37:37.418 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 1
2024-02-12T18:37:37.493 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 1
2024-02-12T18:37:37.674 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 1
2024-02-12T18:37:37.762 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 1
2024-02-12T18:37:37.869 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 1
2024-02-12T18:37:38.895 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 1
2024-02-12T18:37:40.500 helix_view::editor [DEBUG] editor status: Already at oldest change
2024-02-12T18:37:40.501 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 2
2024-02-12T18:37:40.752 helix_term::application [DEBUG] received editor event: IdleTimer
2024-02-12T18:37:41.104 helix_view::view [DEBUG] Syncing view ViewId(2v1) between 2 and 0
2024-02-12T18:37:41.104 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2024-02-12T18:37:41.354 helix_term::application [DEBUG] received editor event: IdleTimer
2024-02-12T18:37:41.940 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2024-02-12T18:37:42.136 helix_term::commands::typed [DEBUG] quitting...
2024-02-12T18:37:42.136 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2024-02-12T18:37:42.192 helix_term::application [DEBUG] received editor event: IdleTimer
2024-02-12T18:37:42.705 helix_term::commands::typed [DEBUG] quitting...
2024-02-12T18:37:42.705 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2024-02-12T18:37:42.705 helix_term::job [DEBUG] waiting on jobs...
2024-02-12T18:37:42.705 helix_term::job [DEBUG] waiting on jobs...
#5733 (comment) is related. We need to call Document::append_changes_to_history after modifying the document so that the change is saved in history. Currently clipboard replacement doesn't call that.
Summary
It is possible to get helix to forget that the buffer is dirty and it shouldn't allow quitting without saving under certain conditions. Works with both scratch buffer and when editing a file.
Reproduction Steps
Follow the exact keystrokes:
hx
Inside helix:
i
->h
(any single character insert is fine) -><esc>
->:clipboard-paste-replace<CR>
->u
->u
(at this point the dirty buffer indicator (the plus sign in the status line) goes away ->:q<CR>
This allows you to quit, even though the
h
character is still in the buffer. The steps work for editing a file also with an additional keystroke after the<esc>
to move the cursor onto theh
character.Helix log
~/.cache/helix/helix.log
Platform
Linux
Terminal Emulator
Konsole 23.08.4
Installation Method
Fedora dnf through varlad/helix
Helix Version
helix 23.10 (f6021dd)
The text was updated successfully, but these errors were encountered: