Patch 7.1.322
Problem:    Can't get start of Visual area in an <expr> mapping.
Solution:   Add the 'v' argument to getpos().
Files:      runtime/doc/eval.txt, src/eval.c


*** ../vim-7.1.321/runtime/doc/eval.txt Wed May 28 16:48:00 2008
--- runtime/doc/eval.txt        Thu Jun 19 22:46:23 2008
***************
*** 3515,3520 ****
--- 3635,3644 ----
                            returned)
                    w0      first line visible in current window
                    w$      last line visible in current window
+                   v       In Visual mode: the start of the Visual area (the
+                           cursor is the end).  When not in Visual mode
+                           returns the cursor position.  Differs from |'<| in
+                           that it's updated right away.
                Note that a mark in another file can be used.  The line number
                then applies to another buffer.
                To get the column number use |col()|.  To get both use
*** ../vim-7.1.321/src/eval.c   Thu May 29 21:46:10 2008
--- src/eval.c  Fri Jun 20 17:20:52 2008
***************
*** 16907,16915 ****
      name = get_tv_string_chk(varp);
      if (name == NULL)
        return NULL;
!     if (name[0] == '.')               /* cursor */
        return &curwin->w_cursor;
!     if (name[0] == '\'')      /* mark */
      {
        pp = getmark_fnum(name[1], FALSE, fnum);
        if (pp == NULL || pp == (pos_T *)-1 || pp->lnum <= 0)
--- 17478,17494 ----
      name = get_tv_string_chk(varp);
      if (name == NULL)
        return NULL;
!     if (name[0] == '.')                               /* cursor */
        return &curwin->w_cursor;
! #ifdef FEAT_VISUAL
!     if (name[0] == 'v' && name[1] == NUL)     /* Visual start */
!     {
!       if (VIsual_active)
!           return &VIsual;
!       return &curwin->w_cursor;
!     }
! #endif
!     if (name[0] == '\'')                      /* mark */
      {
        pp = getmark_fnum(name[1], FALSE, fnum);
        if (pp == NULL || pp == (pos_T *)-1 || pp->lnum <= 0)
*** ../vim-7.1.321/src/version.c        Fri Jun 20 16:51:54 2008
--- src/version.c       Fri Jun 20 17:27:30 2008
***************
*** 668,669 ****
--- 673,676 ----
  {   /* Add new patch number below this line */
+ /**/
+     322,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
52. You ask a plumber how much it would cost to replace the chair in front of
    your computer with a toilet.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to