helix-editor / helix

A post-modern modal text editor.
https://helix-editor.com
Mozilla Public License 2.0
31.15k stars 2.3k forks source link

Using :w as shortcut in insert mode leaves buffer with unsaved marker #11024

Open fintara opened 1 week ago

fintara commented 1 week ago

Summary

The bufferline shows a [+] marker next to the files that have unsaved changes. I have a shortcut that saves the file. However, even though the file was indeed saved, the marker remains.

Moreover, if my shortcut is C-s = ["normal_mode", ":write"], then there are rare cases when the marker disappears. If I do the sequence ["normal_mode", ":write"] manually, then it all works fine 100% of the time. It seems that some race occurs when it's used as a shortcut. This may be a separate issue though.

Reproduction Steps

# config.yaml
[editor]
bufferline = "always"

[keys.insert]
C-s = ":write"
  1. Open a file
  2. Make a change - the file has [+] in the buffer line and buffer picker
  3. Press Ctrl+s on the keyboard
    • <file> written in the status text below
    • the file is indeed written

What I expect to happen:

What happens:

Helix log

No response

Platform

Linux / macOS

Terminal Emulator

gnome-terminal, iTerm

Installation Method

brew / dnf install

Helix Version

helix 24.3 (2cadec0b)