Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap directions by hitting the shortcut a second time #8

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

adzenith
Copy link
Contributor

I love this plugin, but I find it searching backwards to be more difficult than I'd like - I have to add a minus, and square brackets, etc. These changes (which include the commit in https://github.com/xavi-/sublime-selectuntil/pull/7) let you switch the search direction back and forth just by hitting the shortcut again.
Also included are some display fixes that work around bugs in Sublime's input panel (commit 7d04bda).

@xavi-
Copy link
Owner

xavi- commented Aug 19, 2013

Hello,

Thanks for the commits. I'm currently in Italy on vacation so it might be
a while before I get chance to throughly look at the changes -- a week or
so. Just didn't want you to think that I was ignoring the pull requests. =)

Hitting the shortcut again to toggle reverse search is very clever.

Thanks again,
Xavi
On Aug 19, 2013 8:56 AM, "Nikolaus Wittenstein" [email protected]
wrote:

I love this plugin, but I find it searching backwards to be more difficult
than I'd like - I have to add a minus, and square brackets, etc. These
changes (which include the commit in #7https://github.com/xavi-/sublime-selectuntil/issues/7)
let you switch the search direction back and forth just by hitting the
shortcut again.
Also included are some display fixes that work around bugs in Sublime's
input panel (commit 7d04bdahttps://github.com/xavi-/sublime-selectuntil/commit/7d04bda

).

You can merge this Pull Request by running

git pull https://github.com/adzenith/sublime-selectuntil direction-swap

Or view, comment on, or merge it at:

https://github.com/xavi-/sublime-selectuntil/pull/8
Commit Summary

  • Change the way pending changes are drawn
  • Add clean_up command for on_cancel and on_done
  • Fix getting called a second time while open
  • Search regex never fails
  • Simplify logic in find_matching_point
  • Swap search direction on the second press of the shortcut
  • Don't swap direction if changing between extending and not extending
    selection
  • Don't switch direction if the panel is open but unfocussed

File Changes

  • M README.mdhttps://github.com/xavi-/sublime-selectuntil/pull/8/files#diff-0(4)
  • M select-until.pyhttps://github.com/xavi-/sublime-selectuntil/pull/8/files#diff-1(86)

Patch Links:

@adzenith
Copy link
Contributor Author

Awesome, thanks! Enjoy your vacation!

@xavi-
Copy link
Owner

xavi- commented Aug 24, 2013

What do you think of the idea of instead of getting rid of the minus sign, hitting the shortcut a multiple times automatically inserts (or removes) the minus sign. For example:

  • User hits shortcut
  • Types "hello"
  • User hits shortcut again
  • Show panel automatically changes to "-[hello]", with "hello" highlighted

This way we can preserve backwards compatibility.

@xavi-
Copy link
Owner

xavi- commented Aug 25, 2013

I got a rough implementation working (at least in sublime 2). If you don't mind, I'm gonna take a couple of your ideas (and maybe commits) and implement the feature request.

@ctf0
Copy link

ctf0 commented May 16, 2014

reverse selection doesn't work in any of the both ways mentioned on ST 3 Build 3059

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants