You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Contracting selection does with ir not work for me (ar works just fine). I run tests and all passes. Here is example ruby file and simplest vimrc which reproduce bug in my computer.
moduleFooclassBardefBaz[1,2,3].eachdo |i|
i + 1endendendend
I have the same problem. For me not even the first ir works on the same sample code. The cursor jumps to the first line of the buffer but the selection does not change.
I run the tests and they passed, however. So I have no idea where to look next :(
I noticed something unexpected. Using var to highlight a block, then using ar and ir should expand and contract the selection. However ir does not contract the selection.
Using your example:
module Foo
class Bar
def baz
[1,2,3].each do |i|
i + 1
end
end
end
end
Starting on the line with each and hitting vir the inside of the baz method is selected as expected.
Now typing ar expands the selection to the whole baz method (from def to end).
However, typing ir now does nothing.
Typing ar at this point will expand the selection to the Bar class.
Again ir does nothing at this point.
Once again typing ar will expand the selection to the whole module.
Now typing ir will shrink the selection to the inside of the module.
At this point ar will expand to the whole module.
Here irar will contract and expand the selection, but only at the top level. If we try to type ir twice it only contracts once.
I suspect that because the blocks are nested once you are at 2. you have highlighted the baz method (around the previously selected inside) when you invoke ir it does nothing because it says you are already at the inside of the class Bar and therefore nothing happens.
What is odd is that I used the same text as the video but the behavior is different. I tried this on a number of real world ruby files with the same effect.
Activity
sebroeder commentedon Nov 15, 2014
I have the same problem. For me not even the first
irworks on the same sample code. The cursor jumps to the first line of the buffer but the selection does not change.I run the tests and they passed, however. So I have no idea where to look next :(
lukelex commentedon Nov 20, 2014
Is this still being maintained? I can't use any of the commands 😢
jameslawson commentedon Jan 29, 2015
I'm also having the same problem.
ircannot contract selection past the first level.arworks fine - it can repeated expand selection.lmhsjackson commentedon Jan 13, 2016
Same original problem
mattmartini commentedon Oct 12, 2017
I noticed something unexpected. Using
varto highlight a block, then usingarandirshould expand and contract the selection. Howeverirdoes not contract the selection.Using your example:
eachand hittingvirthe inside of thebazmethod is selected as expected.arexpands the selection to the wholebazmethod (fromdeftoend).irnow does nothing.arat this point will expand the selection to theBarclass.irdoes nothing at this point.arwill expand the selection to the whole module.irwill shrink the selection to the inside of the module.arwill expand to the whole module.irarwill contract and expand the selection, but only at the top level. If we try to typeirtwice it only contracts once.I suspect that because the blocks are nested once you are at 2. you have highlighted the
bazmethod (around the previously selected inside) when you invokeirit does nothing because it says you are already at the inside of the classBarand therefore nothing happens.What is odd is that I used the same text as the video but the behavior is different. I tried this on a number of real world ruby files with the same effect.
How do I troubleshoot this?