onivim / oni2

Native, lightweight modal code editor
https://v2.onivim.io
MIT License
7.83k stars 282 forks source link

Jumping back after `g d` (goto definition) goes to top of definition file #1173

Open yunti opened 4 years ago

yunti commented 4 years ago

As mentioned on discord, when using g d to jump to a definition in another file, jumping back with Ctrl+o jumps to the top of the file containing the definition, rather than the location before jumping to the definition. (by comparison, using g d and vscode's jump back command Ctrl+- jumps straight back to the correct location).

(additionally the jump list output is currently garbled - let me know if a seperate issue for this would be useful)

image
jisensee commented 3 years ago

Got the same. Worth adding that this affects Ctrl+i as well and not just after jumping to definition. If I open a new file and want to jump back/forward to the previous/next one, it also always puts me at the top of the buffer, ignoring the previous position in the file.

fiddler commented 3 years ago

For me :bn and :bp cause the cursor to jump to the start of the file instead of remembering the previous position. Wonder if this is related? It looks like the cursor flashes quickly in the correct position, but then jumps to the top of the file.

@bryphe if you have any pointers as to where in the codebase would be a good place to start looking at this, I could give it a go! Though it might be a bit too much over my head. :)

https://user-images.githubusercontent.com/477113/123376844-bceb3b00-d5bd-11eb-8aef-bf0e5222866a.mov

yunti commented 3 years ago

this now correctly goes to the correct location in the definition file, but going back with eg ctrl +o the cursor returns to the top of the original file rather than the previous location in the original file