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

Re: [patch] fix for the Find/Replace dialog

Expand Messages
  • Bram Moolenaar
    ... Note that in the current Vim 7 version (alpha version) a proper solution is used to check the length of the matched text. Your patch could be used as a
    Message 1 of 4 , Nov 18, 2004
    • 0 Attachment
      Thomas de Grenier de Latour wrote:

      > > The difficulty is that s/foo/bar/ would replace the first match
      > > on current line instead of the match under cursor. So what is
      > > done if, for instance, the cursor is on the 4th column, is to
      > > execute s/\(....\)foo/\1bar/ instead.
      >
      > Sure, if i had read the doc more in depth sooner, i would have
      > known that there is this nice \%# sequence to match the cursor
      > position, which is exactly what was needed... Shame on me :/
      >
      > So here is a much simpler patch that uses \%# instead of the ugly
      > hack above.

      Note that in the current Vim 7 version (alpha version) a proper solution
      is used to check the length of the matched text. Your patch could be
      used as a temporary solution for Vim 6.

      --
      [clop clop]
      ARTHUR: Old woman!
      DENNIS: Man!
      ARTHUR: Man, sorry. What knight lives in that castle over there?
      DENNIS: I'm thirty seven.
      ARTHUR: What?
      DENNIS: I'm thirty seven -- I'm not old!
      The Quest for the Holy Grail (Monty Python)

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
      \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
    Your message has been successfully submitted and would be delivered to recipients shortly.