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

Re: Behaviour changed in 7.1.025 regarding excmds and ?foo? address

Expand Messages
  • Bram Moolenaar
    ... Hmm, why did the code for Ex addresses use the SEARCH_START flag? Not clear to me at all. If I remove it the search appears to work properly: ...
    Message 1 of 2 , Mar 2, 2008
      A.Politz wrote:

      > ==buffer==
      > foo
      > bar
      > foo
      > =========
      >
      > :3|.m?foo?
      >
      > In versions prior to 7.1.025, this effectively swapped the 2nd and 3rd
      > line.
      > Since patch 7.1.025 this does nothing, apparently because the
      > pattern does match in the 3rd instead of the 1st line.

      Hmm, why did the code for Ex addresses use the SEARCH_START flag? Not
      clear to me at all. If I remove it the search appears to work properly:

      *** ../vim-7.1.266/src/ex_docmd.c Tue Feb 26 21:29:06 2008
      --- src/ex_docmd.c Sun Mar 2 20:50:43 2008
      ***************
      *** 3932,3939 ****
      curwin->w_cursor.col = 0;
      searchcmdlen = 0;
      if (!do_search(NULL, c, cmd, 1L,
      ! SEARCH_HIS + SEARCH_MSG + SEARCH_START,
      ! NULL))
      {
      curwin->w_cursor = pos;
      cmd = NULL;
      --- 3932,3938 ----
      curwin->w_cursor.col = 0;
      searchcmdlen = 0;
      if (!do_search(NULL, c, cmd, 1L,
      ! SEARCH_HIS | SEARCH_MSG, NULL))
      {
      curwin->w_cursor = pos;
      cmd = NULL;
      ***************
      *** 3980,3987 ****
      pos.col = 0;
      if (searchit(curwin, curbuf, &pos,
      *cmd == '?' ? BACKWARD : FORWARD,
      ! (char_u *)"", 1L,
      ! SEARCH_MSG + SEARCH_START,
      i, (linenr_T)0, NULL) != FAIL)
      lnum = pos.lnum;
      else
      --- 3979,3985 ----
      pos.col = 0;
      if (searchit(curwin, curbuf, &pos,
      *cmd == '?' ? BACKWARD : FORWARD,
      ! (char_u *)"", 1L, SEARCH_MSG,
      i, (linenr_T)0, NULL) != FAIL)
      lnum = pos.lnum;
      else
      *** ../vim-7.1.266/src/search.c Wed Feb 20 13:41:14 2008
      --- src/search.c Sun Mar 2 20:49:59 2008
      ***************
      *** 538,544 ****
      return FAIL;
      }

      ! if (options & SEARCH_START)
      extra_col = 0;
      #ifdef FEAT_MBYTE
      /* Watch out for the "col" being MAXCOL - 2, used in a closed fold. */
      --- 538,544 ----
      return FAIL;
      }

      ! if ((options & SEARCH_START) || pos->col == MAXCOL)
      extra_col = 0;
      #ifdef FEAT_MBYTE
      /* Watch out for the "col" being MAXCOL - 2, used in a closed fold. */


      --
      hundred-and-one symptoms of being an internet addict:
      83. Batteries in the TV remote now last for months.

      /// 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 ///

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.