Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ":w" after "normal_mode" in config.toml chain command doesn't work on files without lsp #7999

Closed
connortsui20 opened this issue Aug 19, 2023 · 1 comment
Labels
C-bug Category: This is a bug R-duplicate Duplicated issue: please refer to the linked issue

Comments

@connortsui20
Copy link
Contributor

connortsui20 commented Aug 19, 2023

Summary

For reference, this is part of my config.toml

[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 mode
j = { k = ["keep_primary_selection", "normal_mode", ":w"] }
k = { j = ["keep_primary_selection", "normal_mode", ":w"] }
# Be able (supposedly) to save inside insert mode
C-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:

[timestamp] helix_view::editor [ERROR] editor error: 1 unsaved buffer(s) remaining: ["test.txt"]

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)

@connortsui20 connortsui20 added the C-bug Category: This is a bug label Aug 19, 2023
@the-mikedavis
Copy link
Member

Duplicate of #6513

@the-mikedavis the-mikedavis marked this as a duplicate of #6513 Aug 19, 2023
@the-mikedavis the-mikedavis closed this as not planned Won't fix, can't repro, duplicate, stale Aug 19, 2023
@the-mikedavis the-mikedavis added the R-duplicate Duplicated issue: please refer to the linked issue label Aug 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug R-duplicate Duplicated issue: please refer to the linked issue
Projects
None yet
Development

No branches or pull requests

2 participants