Re: [vim] How does a func determine if $ was used in a -- VISUAL BLOCK -- ?
- "Charles E. Campbell" wrote:
>I see now: you do a ":normal j" and a ":let l=l+1" inside the loop.
> Thus saith Jason Smigiel:
> > How do I write a function that can determine if '$' was used while
> > selecting a -- VISUAL BLOCK -- ?
> On Friday, November 30, 2001, at 11:56 AM, Charles E. Campbell wrote:
> > Your function could do something like
> > norm `>
> > let rght= virtcol(".")
> let l= line("'<")
> while l <= line("'>")
> > if virtcol("$") != rght
> > echo "Throwing hissy fit :<"
> > endif
> norm! j
> Thus saith Benji Fisher:
> > I do not see why that will work. I do have a couple of suggestions.
> Ah, but it *does* work, except for the case where the right-hand-side
> of all the lines are all justfied (ie. of the same length). Admittedly
> its a brute force check, however. I've even used a variant of it in
> my latest <visincr.vim> (which handles generating columns of increasing
> or decreasing integers).
(Without the latter, you have a slight problem.)