helix-editor / helix

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

Setting the prompt to a register value via C-r and tab includes the register name #10892

Open CptPotato opened 1 month ago

CptPotato commented 1 month ago

Summary

Trying to insert a register value into the prompt using ctrlr, includes the register name as well. This happens only when tabbing through the list of registers, not when typing the register's name.

image

The prompt's content should be foo here, not " foo.

Reproduction Steps

  1. Yank some text.
  2. Open the search prompt /.
  3. Insert the yanked text using ctrlr, then tab through the options. Using the register name instead, i.e. ctrlr", works as intended.

Helix log

~/.cache/helix/helix.log ```js 2024-06-06T16:37:50.816 regex_cursor::util::prefilter [DEBUG] prefixes (len=Some(8), exact=true) extracted before optimization: Seq[E("\" FOO"), E("\" FOo"), E("\" FoO"), E("\" Foo"), E("\" fOO"), E("\" fOo"), E("\" foO"), E("\" foo")] 2024-06-06T16:37:50.816 regex_cursor::util::prefilter [DEBUG] prefixes (len=Some(1), exact=false) extracted after optimization: Seq[I("\"")] 2024-06-06T16:37:50.816 regex_cursor::engines::meta::strategy [DEBUG] creating prefilter from 1 literals: [I("\"")] 2024-06-06T16:37:50.816 regex_cursor::engines::meta::wrappers [DEBUG] PikeVM built 2024-06-06T16:37:50.817 regex_cursor::engines::meta::wrappers [DEBUG] fully compiled forward and reverse DFAs built, 1720 bytes 2024-06-06T16:37:50.817 regex_cursor::engines::meta::strategy [DEBUG] skipping lazy DFA because we have a full DFA 2024-06-06T16:37:50.817 regex_cursor::engines::meta::strategy [DEBUG] skipping reverse anchored optimization because the regex is not always anchored at the end 2024-06-06T16:37:50.817 regex_cursor::engines::meta::strategy [DEBUG] using core strategy 2024-06-06T16:37:50.817 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 1 2024-06-06T16:37:52.633 regex_cursor::util::prefilter [DEBUG] prefixes (len=Some(8), exact=true) extracted before optimization: Seq[E("\" FOO"), E("\" FOo"), E("\" FoO"), E("\" Foo"), E("\" fOO"), E("\" fOo"), E("\" foO"), E("\" foo")] 2024-06-06T16:37:52.633 regex_cursor::util::prefilter [DEBUG] prefixes (len=Some(1), exact=false) extracted after optimization: Seq[I("\"")] 2024-06-06T16:37:52.633 regex_cursor::engines::meta::strategy [DEBUG] creating prefilter from 1 literals: [I("\"")] 2024-06-06T16:37:52.633 regex_cursor::engines::meta::wrappers [DEBUG] PikeVM built 2024-06-06T16:37:52.633 regex_cursor::engines::meta::wrappers [DEBUG] fully compiled forward and reverse DFAs built, 1720 bytes 2024-06-06T16:37:52.633 regex_cursor::engines::meta::strategy [DEBUG] skipping lazy DFA because we have a full DFA 2024-06-06T16:37:52.633 regex_cursor::engines::meta::strategy [DEBUG] skipping reverse anchored optimization because the regex is not always anchored at the end 2024-06-06T16:37:52.633 regex_cursor::engines::meta::strategy [DEBUG] using core strategy ```

Platform

Windows

Terminal Emulator

wezterm

Installation Method

GitHub release

Helix Version

24.03 release

pascalkuthe commented 1 month ago

is this some recent regression? I can't reproduce this in my branch

the-mikedavis commented 1 month ago

I believe it works properly if you type the register name but if you tab to complete from the completion list it keeps the register name. So <C-r>" should work as expected but not <C-r><tab>

CptPotato commented 1 month ago

I believe it works properly if you type the register name but if you tab to complete from the completion list it keeps the register name. So <C-r>" should work as expected but not <C-r><tab>

Good catch, I can confirm that typing the register's name directly works as intended. I've updated the bug description.