atom / symbols-view

Jump to symbols in Atom
MIT License
165 stars 115 forks source link

Add additional keymaps for {go-to,return-from}-declaration. #230

Closed segevfiner closed 1 year ago

segevfiner commented 6 years ago

Requirements

Description of the Change

Add additional keymaps for {go-to,return-from}-declaration.

The existing keymaps don't work in Linux in some desktop environments that bind the existing keymap for desktop switching. And Windows doesn't have any keymap at all.

F12 is already used by Visual Studio, Visual Studio Code & Sublime Text 3, to the best of my knowledge. ctrl-F12 is something I made up...

Alternate Designs

Any other keymap is a possibility. It's a matter of taste. And someone will have to make the decision what are the right default keymaps for this. This is just a suggestion.

I left the existing keymaps in place.

Benefits

We will have a working default keymaps for go-to-declaration & return-from-declaration. Currently the Linux keymap doesn't always work and Windows doesn't have any ☹️.

Possible Drawbacks

Keymaps are a matter of taste. Not everyone might like the keymaps I choose here.

Applicable Issues

Mentioned in #159

50Wliu commented 6 years ago

I'm fine with F12 since it appears to be widely used, but I'd rather we not add Ctrl-F12 if there's no standard to avoid polluting the keymap space.

segevfiner commented 6 years ago

@50Wliu I see where you are coming from, but don't you consider it would be weird not to have a shortcut for "Return from declaration"? That's a very common thing to do after using "go to declaration", and binding it to Ctrl-F12 made sense since it's easily reachable after hitting F12. It would also look weird in the README.md where for some reason Windows doesn't have any shortcut bound by default to "return to declaration". Do you really think that someone would want to bind Ctrl-F12 to something else considering that F12 will be bound to go to declaration?

Well, that's just my two cents. If you still wish me to remove Ctrl-F12 from this PR, I will. Probably to resubmit it as a separate PR for further discussion. Though direct interest in this PR, and frankly, any Atom PR is quite low.