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

Re: Feature request: allow substitute to take i and I flags

Expand Messages
  • Christian Brabandt
    Hi So8res! ... It should probably be documented. Other then that, the c and C atoms work. See :h c regards, Christian -- Takt ist, wenn man s genau
    Message 1 of 3 , Nov 19, 2012
    • 0 Attachment
      Hi So8res!

      On Mo, 19 Nov 2012, So8res wrote:

      > The substitute() function already can take the 'g' flag which causes
      > the substitution to be global. There's no way to force the search to
      > be case (in)sensitive, though. This means that plugins must either
      > save & restore ignorecase before using substitute() or be OK with the
      > case sensitivity of their substitutions changing at the user's whim.
      >
      > Is there a good reason why substitute() doesn't already take the i/I
      > flags?

      It should probably be documented. Other then that, the \c and \C atoms
      work. See :h \c

      regards,
      Christian
      --
      Takt ist, wenn man's genau betrachtet, eine Art von Hellseherei.
      -- S. O. Jewett

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Bram Moolenaar
      ... The docs says it uses ignorecase but doesn t say how to ignore it. I ll add a remark about how c or C can ignore ignorecase . :-) -- It is hard to
      Message 2 of 3 , Nov 20, 2012
      • 0 Attachment
        Christian Brabandt wrote:

        > On Mo, 19 Nov 2012, So8res wrote:
        >
        > > The substitute() function already can take the 'g' flag which causes
        > > the substitution to be global. There's no way to force the search to
        > > be case (in)sensitive, though. This means that plugins must either
        > > save & restore ignorecase before using substitute() or be OK with the
        > > case sensitivity of their substitutions changing at the user's whim.
        > >
        > > Is there a good reason why substitute() doesn't already take the i/I
        > > flags?
        >
        > It should probably be documented. Other then that, the \c and \C atoms
        > work. See :h \c

        The docs says it uses 'ignorecase' but doesn't say how to ignore it.
        I'll add a remark about how \c or \C can ignore 'ignorecase'. :-)

        --
        It is hard to understand how a cemetery raised its burial
        cost and blamed it on the cost of living.

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ an exciting new programming language -- http://www.Zimbu.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      Your message has been successfully submitted and would be delivered to recipients shortly.