Hello,

I have noticed, that the % command to match C-style comments, doesn't work 
completely with a line like this:
/* comment1 *//* comment2 */

Searching backwards from the 2nd */ doesn't work, because a // comment is 
found and /* comments thereafter are ignored.

I've created a patch for the function check_linecomment(), that doesn't 
consider a *//* construct to be a // comment.
        

Markus


*** src/search.c        (revision 700)
--- src/search.c        (working copy)
***************
*** 2319,2325 ****
  #endif
      while ((p = vim_strchr(p, '/')) != NULL)
      {
!       if (p[1] == '/')
            break;
        ++p;
      }
--- 2319,2328 ----
  #endif
      while ((p = vim_strchr(p, '/')) != NULL)
      {
!       if (p[1] == '/' && (  p == line
!                          || p[2] != '*'
!                          || p[-1] != '*'))
!           /* / / comment found, no * / / * end/start comment */
            break;
        ++p;
      }

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui