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
[keys.insert]
# Rebind for escaping insert mode.# The "keep_primary_selection" is for getting rid of multiple cursors# Also (supposed to) save on exiting insert modej = { k = ["keep_primary_selection", "normal_mode", ":w"] }
k = { j = ["keep_primary_selection", "normal_mode", ":w"] }
# Be able (supposedly) to save inside insert modeC-s = ["normal_mode", ":w"]
I use jk and kj as my escape insert mode binding, and I also want it to save after I exit insert mode. However, whenever I am on a file that does not include language support (for example a .txt file), whenever I use one of the above bindings, it will say 'test.txt' written, ..., but the the modification indicator [+] remains there, and when I try to exit out of the file, I get 1 unsaved buffer(s) remaining: ["test.txt"], indicating that it didn't actually save (maybe it does save but it only says I can't save)?
However, when I edit a file with lsp support, like test.rs, none of these issues happen.
There is probably some ordering thing in the code that does not invoke the LSP server... unless this is intended behavior? The ideal behavior is that it exits insert mode and goes into normal mode, where ":w" works properly.
Reproduction Steps
touch test.txt
touch test.rs
Assuming rust-analyzer is installed, and there is no lsp for .txt files...
Try running a chain of commands that has ":w" in the chain after a "normal_mode" (_ = [..., "normal_mode", ":w"]) in both of the files. The test.txt one should give you an error when trying to exit with saving manually, and the test.rs one should not give you any problem
Helix log
Only log from test.txt when trying to quit out of the file after doing the reproduction step:
Summary
For reference, this is part of my
config.toml
I use
jk
andkj
as my escape insert mode binding, and I also want it to save after I exit insert mode. However, whenever I am on a file that does not include language support (for example a.txt
file), whenever I use one of the above bindings, it will say'test.txt' written, ...
, but the the modification indicator[+]
remains there, and when I try to exit out of the file, I get1 unsaved buffer(s) remaining: ["test.txt"]
, indicating that it didn't actually save (maybe it does save but it only says I can't save)?However, when I edit a file with lsp support, like
test.rs
, none of these issues happen.There is probably some ordering thing in the code that does not invoke the LSP server... unless this is intended behavior? The ideal behavior is that it exits insert mode and goes into normal mode, where ":w" works properly.
Reproduction Steps
Assuming rust-analyzer is installed, and there is no lsp for .txt files...
Try running a chain of commands that has ":w" in the chain after a "normal_mode" (
_ = [..., "normal_mode", ":w"]
) in both of the files. Thetest.txt
one should give you an error when trying to exit with saving manually, and thetest.rs
one should not give you any problemHelix log
Only log from
test.txt
when trying to quit out of the file after doing the reproduction step:For the
test.rs
logs, everything worked fine, and the logs just show a bunch of lsp stuff that is not really helpful.Platform
Linux
Terminal Emulator
Alacritty
Helix Version
helix 23.05 (e4c95f6)
The text was updated successfully, but these errors were encountered: