Sublime Forum

How to do find_under_expand select backwards?

#1

Some times, It is more convenient to select things backwards, instead of forward. For now I could do find_under_prev until I got where I would like then start, then start doing find_under_expand until I got where I was.

Is it possible to do inverse/reversed selection? I tried searching for its implementation under Default.sublime-packages, but I could not find it there. Perhaps this is implemented on the core?

I tried calling it as follow with no success:

  1. reverse

    { "keys": ["ctrl+d"], "command": "find_under_expand", "args": { "reverse": true } }
    
  2. reverse

    { "keys": ["ctrl+d"], "command": "find_under_expand", "args": { "reverse": false } }
    
  3. inverse

    { "keys": ["ctrl+d"], "command": "find_under_expand", "args": { "inverse": true } }
    
  4. inverse

    { "keys": ["ctrl+d"], "command": "find_under_expand", "args": { "inverse": false } }
    
  5. forward

    { "keys": ["ctrl+d"], "command": "find_under_expand", "args": { "forward": true } }
    
  6. forward

    { "keys": ["ctrl+d"], "command": "find_under_expand", "args": { "forward": false } }
    

Related:

  1. #2420 find_under/find_under_prev inconsistency
  2. #31194 Find the previous occurence of a regex pattern
0 Likes

#2

I don’t think default command can do it. You can try

I use a modified version that supports more commands, you can try it if you want (no guarantees)

https://gist.github.com/mg979/1eda8da7792c98c7fbc9183877e3c438

1 Like