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

[patch] search() flag to not use smartcase

Expand Messages
  • Yakov Lerner
    The patch adds flag to search() flag to not use smartcase. * and # do not use smartcase, but search() always uses smartcase (cannot be turned off). When we
    Message 1 of 3 , May 3, 2007
      The patch adds flag to search() flag to not use smartcase.
      '*' and '#' do not use smartcase, but search() always uses smartcase
      (cannot be turned off).
      When we use search() with @/ pattern that comes from * or #,
      search() fails because of discrepancy in smartcase handling.

      Yakov

      --- runtime/doc/eval.txt.000 2007-05-03 09:35:19.000000000 -0400
      +++ runtime/doc/eval.txt 2007-05-03 09:36:21.000000000 -0400
      @@ -4086,6 +4086,7 @@
      'n' do Not move the cursor
      'p' return number of matching sub-pattern (see below)
      's' set the ' mark at the previous location of the cursor
      + 'S' do not use smartcase
      'w' wrap around the end of the file
      'W' don't wrap around the end of the file
      If neither 'w' or 'W' is given, the 'wrapscan' option applies.
      --- src/eval.c.000 2007-05-03 09:07:52.000000000 -0400
      +++ src/eval.c 2007-05-03 09:34:50.000000000 -0400
      @@ -13813,6 +13813,7 @@
      case 'b': dir = BACKWARD; break;
      case 'w': p_ws = TRUE; break;
      case 'W': p_ws = FALSE; break;
      + case 'S': no_smartcase = TRUE; break;
      default: mask = 0;
      if (flagsp != NULL)
      switch (*flags)
    • Bram Moolenaar
      ... Looks a bit inconsistent. Why not also add a flag to ignore ignorecase and magic ? -- Everybody lies, but it doesn t matter since nobody listens. --
      Message 2 of 3 , May 3, 2007
        Yakov Lerner wrote:

        > The patch adds flag to search() flag to not use smartcase.
        > '*' and '#' do not use smartcase, but search() always uses smartcase
        > (cannot be turned off).
        > When we use search() with @/ pattern that comes from * or #,
        > search() fails because of discrepancy in smartcase handling.
        >
        > Yakov
        >
        > --- runtime/doc/eval.txt.000 2007-05-03 09:35:19.000000000 -0400
        > +++ runtime/doc/eval.txt 2007-05-03 09:36:21.000000000 -0400
        > @@ -4086,6 +4086,7 @@
        > 'n' do Not move the cursor
        > 'p' return number of matching sub-pattern (see below)
        > 's' set the ' mark at the previous location of the cursor
        > + 'S' do not use smartcase
        > 'w' wrap around the end of the file
        > 'W' don't wrap around the end of the file
        > If neither 'w' or 'W' is given, the 'wrapscan' option applies.

        Looks a bit inconsistent. Why not also add a flag to ignore
        'ignorecase' and 'magic'?

        --
        Everybody lies, but it doesn't matter since nobody listens.
        -- Lieberman's Law

        /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
        /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
        \\\ download, build and distribute -- http://www.A-A-P.org ///
        \\\ help me help AIDS victims -- http://ICCF-Holland.org ///
      • Yakov Lerner
        ... Yes. After I sent out a patch, I realized I can fix my problem by saving,clearing, and restoring the smartcase option. Sorry. Yakov
        Message 3 of 3 , May 3, 2007
          On 5/3/07, Bram Moolenaar <Bram@...> wrote:
          >
          > Yakov Lerner wrote:
          >
          > > The patch adds flag to search() flag to not use smartcase.
          > > '*' and '#' do not use smartcase, but search() always uses smartcase
          > > (cannot be turned off).
          > > When we use search() with @/ pattern that comes from * or #,
          > > search() fails because of discrepancy in smartcase handling.
          > >
          > > Yakov
          > >
          > > --- runtime/doc/eval.txt.000 2007-05-03 09:35:19.000000000 -0400
          > > +++ runtime/doc/eval.txt 2007-05-03 09:36:21.000000000 -0400
          > > @@ -4086,6 +4086,7 @@
          > > 'n' do Not move the cursor
          > > 'p' return number of matching sub-pattern (see below)
          > > 's' set the ' mark at the previous location of the cursor
          > > + 'S' do not use smartcase
          > > 'w' wrap around the end of the file
          > > 'W' don't wrap around the end of the file
          > > If neither 'w' or 'W' is given, the 'wrapscan' option applies.
          >
          > Looks a bit inconsistent. Why not also add a flag to ignore
          > 'ignorecase' and 'magic'?

          Yes. After I sent out a patch, I realized I can fix my problem
          by saving,clearing, and restoring the 'smartcase' option. Sorry.

          Yakov
        Your message has been successfully submitted and would be delivered to recipients shortly.