Loading ...
Sorry, an error occurred while loading the content.

Re: [vim] How does a func determine if $ was used in a -- VISUAL BLOCK -- ?

Expand Messages
  • Benji Fisher
    ... I see now: you do a :normal j and a :let l=l+1 inside the loop. (Without the latter, you have a slight problem.) --Benji Fisher
    Message 1 of 5 , Dec 1, 2001
    • 0 Attachment
      "Charles E. Campbell" wrote:
      >
      > 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
      > endwhile
      >
      > 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).

      I see now: you do a ":normal j" and a ":let l=l+1" inside the loop.
      (Without the latter, you have a slight problem.)

      --Benji Fisher
    Your message has been successfully submitted and would be delivered to recipients shortly.