quick-scope
quick-scope copied to clipboard
Add motion to jumplist
hi, I have been using your plugin for quite a long time, however something that I find missing is the fact that jumps are not saved in the jump list, which would be nice to have at least as an option so that we could go back to the location before doing the motion by press <C-o>
I tried to do a remap and manually set a mark before doing a motion but the only effect was to deactivate the plugin itself.
is there a quick solution to this ?
So quick-scope itself isn't controlling the movement of the cursor, that is still handled by the appropriate f/t command, so we can do things before the movement but not after.
I did a little testing (without editing the plugin or any mappings yet) by setting the previous position mark as recommended by this StackOverflow answer (m`
) before my f/t movement, and this allowed me to use <C-o>
to jump back to before the f/t movement, but I could not subsequently use <C-i>
to repeat the f/t movement (I think because this is within a line movement so <C-o>
doesn't update the jumplist?). This seemed like a sub-optimal solution to me.
What I described (simply setting m`
) could feasibly be done in the plugin, if you think it's the behavior you want. I think it should only need adding normal! m`
somewhere in quick_scope#Ready().
yes that is the behaviour I was trying to describe, do you think it would be wise to deactivate that option by default and expose a setting so that users can enable only if they want to ?
Yes, I think this should default to off so that we don't unexpectedly mess with anyone's jumplist.
I'm happy to try implementing this. if I'm being honest I never contributed to an open source project before so it could be a good learning experience for me as well. let me know
Sure, I'd be happy to look at a pull request.
sounds like a plan, I'll have a look at this over the weekend as I'm pretty busy with work during the week