porcupine icon indicating copy to clipboard operation
porcupine copied to clipboard

jump back to previous cursor pos

Open Akuli opened this issue 3 years ago • 7 comments

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

Akuli avatar Sep 11 '21 21:09 Akuli

This would be really important for https://github.com/Akuli/porcupine/issues/1319

benjamin-kirkbride avatar Jul 02 '23 15:07 benjamin-kirkbride

In VSCode, using the back button on my mouse will "jump" back to where I was. Very helpful.

benjamin-kirkbride avatar Jul 02 '23 15:07 benjamin-kirkbride

Could we get more details?

Moosems avatar Jul 03 '23 22:07 Moosems

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.

Akuli avatar Jul 04 '23 20:07 Akuli

Yes, exactly.

benjamin-kirkbride avatar Jul 04 '23 20:07 benjamin-kirkbride

What UI are you wanting? I assume using a mouse button would be possible, but I think we would also want a KB shortcut

benjamin-kirkbride avatar Jul 04 '23 20:07 benjamin-kirkbride

Alt+Left could be pretty good, nicely consistent with web browsers.

Akuli avatar Jul 04 '23 22:07 Akuli