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

Crash after using save selection -> smart tab on a new line #8340

Open
Omnikar opened this issue Sep 19, 2023 · 6 comments
Open

Crash after using save selection -> smart tab on a new line #8340

Omnikar opened this issue Sep 19, 2023 · 6 comments
Labels
A-command Area: Commands C-bug Category: This is a bug

Comments

@Omnikar
Copy link
Contributor

Omnikar commented Sep 19, 2023

Summary

For context, I have made an insert mode binding of "tab" = ["save_selection", "smart_tab"] so that I can use C-o to go back if I smart tab out too many times. I have encountered this crash as described in the reproduction steps detailed below.

Reproduction Steps

  1. Bind "tab" = ["save_selection", "smart_tab"] in insert mode as described above.
  2. Open a new buffer.
  3. Enter either of the following key sequences:
  • o<tab><esc>
  • i<ret><tab><esc>

Helix crashes with the following error message:

thread 'main' panicked at 'Positions [(2, Before)] are out of range for changeset len 1!', helix-core/src/transaction.rs:461:9

Helix log

Nothing of note was produced in the log file (with -vv).

Platform

MacOS

Terminal Emulator

iTerm2 3.5.0beta11

Helix Version

helix 23.05 (e1a9f6e0)

@Omnikar Omnikar added the C-bug Category: This is a bug label Sep 19, 2023
@pascalkuthe
Copy link
Member

cc @dead10ck

@dead10ck
Copy link
Member

Hmm, that's strange, I'll look into this. At first glance, I'm not sure how smart tab could be involved here; all it's doing is moving the cursor. I wouldn't expect it to be any different than, e.g., moving with the arrow keys.

@pascalkuthe
Copy link
Member

pascalkuthe commented Sep 20, 2023

The problem is probably save_selection not working in insert_mode. That seems like the typical "commands assume there is a revision/don't work with insert mode crash

@Omnikar
Copy link
Contributor Author

Omnikar commented Sep 22, 2023

Right, I forgot to clarify that I did test it without the save_selection binding and it didn't crash.

@zuixalias

This comment was marked as off-topic.

@pascalkuthe

This comment was marked as off-topic.

@kirawi kirawi added the A-command Area: Commands label Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-command Area: Commands C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

5 participants