helix-editor / helix

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

Helix mangled all open buffers and saved them when trying to create a macro #4840

Open lukepighetti opened 1 year ago

lukepighetti commented 1 year ago

Summary

I had three buffers open, with two visible in a vertical split, in a Dart project. I tried to create a macro with Qmip C-c Q. It froze for about 15 seconds, and then mangled every open buffer and saved them to disk. It appeared to blend the output from multiple buffers. I was not able to undo these changes. Here is my log file. I would rate this a P0 or P1 bug depending on how often it happens.

Hard to describe just how mangled this is. It's like all the buffers were randomly interleaved and then dispersed across each other

Screen Shot 2022-11-21 at 11 48 30 AM

Reproduction Steps

No reproduction available ### Helix log
~/.cache/helix/helix.log [helix-log.log.zip](https://github.com/helix-editor/helix/files/10058247/helix-log.log.zip)
### Platform macOS ### Terminal Emulator iTerm Build 3.4.16 ### Helix Version helix 22.08.1 (eada6d53)
archseer commented 1 year ago

Is it possible that you were previously accidentally recording the macro? None of those keypresses should trigger a save.

lukepighetti commented 1 year ago

Anything is possible, are we able to see this in the logs?

the-mikedavis commented 1 year ago

It's visible in the UI with a [@] indicator in the bottom right-hand corner but I don't believe we log anything for that.

Do you have any custom keymaps? And can you reproduce this behavior?

lukepighetti commented 1 year ago

My recollection is that I hit Q and it started recording. It was when I ended recording that it froze for many seconds before it mangled everything. But anything is possible.

I do not have a reproduction.

This my config

theme = "tokyonight_storm"
# theme = "solarized_light"

[editor]
line-number = "relative"
mouse = false
rulers = [80]
shell = ["zsh", "-c"]

[keys.normal]
C-p = ["move_line_up", "scroll_up"]
C-n = ["move_line_down", "scroll_down"]
esc = ["collapse_selection", "keep_primary_selection"]

[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "underline"

[editor.file-picker]
hidden = false