-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
<A-Enter> in the file picker jumps to a line in the current file instead of a new one #7673
Comments
I don't understnd the issue here, what do you mean with opening a new file. |
@pascalkuthe have you tried |
I tried with |
example
Do you understand my problem? |
Hmm yeah thanks for clarifying I will try to reproduce again, I think I missunderstood your original description. I think I know what causes this. We are probably first loading the file and then changing the position in the current buffer. Implementing this might be a bit tricky since changing lines in an inactive buffer is usually not something we do |
This patch fixes issue. Is it good enough for PR or should we come up with something better? |
That probably works, you can post a PR and we can take a closer look during review. I was thinking of something else regarding complexity its probably ok like that |
* fix(picker): `alt-ret' changes cursor pos of current file, not new one Closes #7673 * fix other pickers * symbol pickers * diagnostick pickers This is done using the already patched `jump_to_location` method. * fix global and jumplist pickers * use `view` as old_id; make `align_view` method of `Action` * test(picker): basic <alt-ret> functionality * fix: picker integrational test * fix nit Co-authored-by: Michael Davis <[email protected]> --------- Co-authored-by: Michael Davis <[email protected]>
…7691) * fix(picker): `alt-ret' changes cursor pos of current file, not new one Closes helix-editor#7673 * fix other pickers * symbol pickers * diagnostick pickers This is done using the already patched `jump_to_location` method. * fix global and jumplist pickers * use `view` as old_id; make `align_view` method of `Action` * test(picker): basic <alt-ret> functionality * fix: picker integrational test * fix nit Co-authored-by: Michael Davis <[email protected]> --------- Co-authored-by: Michael Davis <[email protected]>
…7691) * fix(picker): `alt-ret' changes cursor pos of current file, not new one Closes helix-editor#7673 * fix other pickers * symbol pickers * diagnostick pickers This is done using the already patched `jump_to_location` method. * fix global and jumplist pickers * use `view` as old_id; make `align_view` method of `Action` * test(picker): basic <alt-ret> functionality * fix: picker integrational test * fix nit Co-authored-by: Michael Davis <[email protected]> --------- Co-authored-by: Michael Davis <[email protected]>
…7691) * fix(picker): `alt-ret' changes cursor pos of current file, not new one Closes helix-editor#7673 * fix other pickers * symbol pickers * diagnostick pickers This is done using the already patched `jump_to_location` method. * fix global and jumplist pickers * use `view` as old_id; make `align_view` method of `Action` * test(picker): basic <alt-ret> functionality * fix: picker integrational test * fix nit Co-authored-by: Michael Davis <[email protected]> --------- Co-authored-by: Michael Davis <[email protected]>
Summary
Bug was introduced by #4435
Demo: https://asciinema.org/a/yQdXysBaY8nBwoBSoam92efq7
I press
gr
(goto reference) two times.As you can see, when I first open with
<Enter>
, it immediately shows me a line with the selected goto reference. The second time I pressAlt-Enter
, it opens but the cursor of the new file is on 1 line and the line of my current file is scrambled.Also, whoever is going to fix this, I would like to see these key bindings somewhere in the documentation, as the only mention of it is the code in PR.
Reproduction Steps
hx helix-term/src/commands
+g400g
.gr
+ select second entry +<Alt-Enter>
.You will see that your cursor on the current file is on line 166. But it should actually open a new file on that line.
Helix log
~/.cache/helix/helix.log
Platform
Linux
Terminal Emulator
wezterm 20230712-072601-f4abf8fd
Helix Version
helix 23.05-230-g79a8fd62
The text was updated successfully, but these errors were encountered: