home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.0.193 < prev    next >
Encoding:
Internet Message Format  |  2002-02-05  |  1.8 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.193
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.0.193
  11. Problem:    When 'virtualedit' is set, col(".") after the end of the line
  12.             should return one extra.
  13. Solution:   Add one to the column.
  14. Files:      src/eval.c
  15.  
  16.  
  17. *** ../vim60.192/src/eval.c    Wed Feb  6 11:45:41 2002
  18. --- src/eval.c    Wed Feb  6 20:16:23 2002
  19. ***************
  20. *** 3057,3063 ****
  21. --- 3057,3087 ----
  22.   
  23.       fp = var2fpos(&argvars[0], FALSE);
  24.       if (fp != NULL)
  25. +     {
  26.       col = fp->col + 1;
  27. + #ifdef FEAT_VIRTUALEDIT
  28. +     /* col(".") when the cursor is on the NUL at the end of the line
  29. +      * because of "coladd" can be seen as an extra column. */
  30. +     if (virtual_active() && fp == &curwin->w_cursor)
  31. +     {
  32. +         char_u    *p = ml_get_cursor();
  33. +         if (curwin->w_cursor.coladd >= chartabsize(p,
  34. +                  curwin->w_virtcol - curwin->w_cursor.coladd))
  35. +         {
  36. + # ifdef FEAT_MBYTE
  37. +         int        l;
  38. +         if (*p != NUL && p[(l = (*mb_ptr2len_check)(p))] == NUL)
  39. +             col += l;
  40. + # else
  41. +         if (*p != NUL && p[1] == NUL)
  42. +             ++col;
  43. + # endif
  44. +         }
  45. +     }
  46. + #endif
  47. +     }
  48.       retvar->var_val.var_number = col;
  49.   }
  50.   
  51. *** ../vim60.192/src/version.c    Wed Feb  6 17:47:31 2002
  52. --- src/version.c    Wed Feb  6 20:29:50 2002
  53. ***************
  54. *** 608,609 ****
  55. --- 608,611 ----
  56.   {   /* Add new patch number below this line */
  57. + /**/
  58. +     193,
  59.   /**/
  60.  
  61. -- 
  62. Vi is clearly superior to emacs, since "vi" has only two characters
  63. (and two keystrokes), while "emacs" has five.  (Randy C. Ford)
  64.  
  65.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  66. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  67.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  68.