porcupine
porcupine copied to clipboard
jump back to previous cursor pos
Shouldn't be hard to implement. There's already code to track cursor positions, should be recorded as changing cursor pos when changes more than n lines at a time
This would be really important for https://github.com/Akuli/porcupine/issues/1319
In VSCode, using the back button on my mouse will "jump" back to where I was. Very helpful.
Could we get more details?
I think a good example of how this works would be jump to definition.
Let's say you have code that calls Porcupine's get_tab_manager().add_tab()
method. If you control-click add_tab
, Porcupine will go to the line in tabs.py
that says def add_tab(self, tab: Tab, select: bool = True) -> Tab:
.
This feature is about going backwards: once you are done looking at how add_tab()
works, you probably want to continue looking at how it was used in the original place.
Currently the best way to do it is to click the tab at the top of the editor, but:
- you need to remember the file name and find it from the list of tabs
- that doesn't help if you were already in
tabs.py
and you now have no idea what line number you came from.
Yes, exactly.
What UI are you wanting? I assume using a mouse button would be possible, but I think we would also want a KB shortcut
Alt+Left could be pretty good, nicely consistent with web browsers.