Skip to content

Fix select in Helix mode#38117

Merged
kubkon merged 5 commits intozed-industries:mainfrom
romaninsh:fix-helix-select-mode-motion
Sep 14, 2025
Merged

Fix select in Helix mode#38117
kubkon merged 5 commits intozed-industries:mainfrom
romaninsh:fix-helix-select-mode-motion

Conversation

@romaninsh
Copy link
Contributor

Hotfixes issue I have introduced in #37748.

Without this, helix mode select not working at all in main branch.

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Sep 13, 2025
@romaninsh
Copy link
Contributor Author

@kubkon, @ConradIrwin I left a mistake and didn't have good test coverage in my previous PR and it has introduced a regression. This should hotfix the problem.

@maxdeviant maxdeviant changed the title Hotfix: select mode Fix select in Helix mode Sep 13, 2025
Copy link
Member

@kubkon kubkon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, you beat me right to it! Selection now works as intended, except when yanking we don't fall back to (helix) normal mode. Would you mind adding that in? I believe we should add that in helix_yank. While we're at it, a test case would be good too to catch any regressions like this in the future.

EDIT: I meant this change:

diff --git a/crates/vim/src/helix.rs b/crates/vim/src/helix.rs
index 369ec2df11..10594e122d 100644
--- a/crates/vim/src/helix.rs
+++ b/crates/vim/src/helix.rs
@@ -345,6 +345,7 @@ impl Vim {
                     cx,
                 );
             }
+            vim.mode = Mode::HelixNormal;
         });
     }

Copy link
Member

@kubkon kubkon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm gonna do ahead and merge this and follow-up with a yank change I mentioned in a subsequent PR. Thanks again for a fix!

@kubkon kubkon merged commit 813a9bb into zed-industries:main Sep 14, 2025
22 checks passed
kubkon added a commit that referenced this pull request Sep 14, 2025
Follow-up to #38117.
@romaninsh I'd appreciate if you could have a look :-)

Release Notes:

- N/A
kubkon added a commit that referenced this pull request Sep 18, 2025
…ly in helix mode (#38119)

Closes #34192

Without selection, only current character would be affected.

Also if #38117 is merged too, then transformations in SelectMode behave
correctly too and selection is not collapsed.

Release Notes:

- helix: Implemented `~`, `` ` ``, `` Alt-` `` correctly in normal and
select modes

---------

Co-authored-by: Jakub Konka <kubkon@jakubkonka.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants