Skip to content

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).

Only highlights a region if we are extending a selection; otherwise
draws only the new insertion point. Also now highlights the starting
point, because when the input panel is shown, the current selections
are hidden.
Simplifies the logic a little bit, I think.
@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