4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Can't get start of Visual area in an <expr> mapping.
12 Solution: Add the 'v' argument to getpos().
13 Files: runtime/doc/eval.txt, src/eval.c
16 *** ../vim-7.1.321/runtime/doc/eval.txt Wed May 28 16:48:00 2008
17 --- runtime/doc/eval.txt Thu Jun 19 22:46:23 2008
22 w0 first line visible in current window
23 w$ last line visible in current window
24 + v In Visual mode: the start of the Visual area (the
25 + cursor is the end). When not in Visual mode
26 + returns the cursor position. Differs from |'<| in
27 + that it's updated right away.
28 Note that a mark in another file can be used. The line number
29 then applies to another buffer.
30 To get the column number use |col()|. To get both use
31 *** ../vim-7.1.321/src/eval.c Thu May 29 21:46:10 2008
32 --- src/eval.c Fri Jun 20 17:20:52 2008
35 name = get_tv_string_chk(varp);
38 ! if (name[0] == '.') /* cursor */
39 return &curwin->w_cursor;
40 ! if (name[0] == '\'') /* mark */
42 pp = getmark_fnum(name[1], FALSE, fnum);
43 if (pp == NULL || pp == (pos_T *)-1 || pp->lnum <= 0)
45 name = get_tv_string_chk(varp);
48 ! if (name[0] == '.') /* cursor */
49 return &curwin->w_cursor;
51 ! if (name[0] == 'v' && name[1] == NUL) /* Visual start */
55 ! return &curwin->w_cursor;
58 ! if (name[0] == '\'') /* mark */
60 pp = getmark_fnum(name[1], FALSE, fnum);
61 if (pp == NULL || pp == (pos_T *)-1 || pp->lnum <= 0)
62 *** ../vim-7.1.321/src/version.c Fri Jun 20 16:51:54 2008
63 --- src/version.c Fri Jun 20 17:27:30 2008
67 { /* Add new patch number below this line */
73 hundred-and-one symptoms of being an internet addict:
74 52. You ask a plumber how much it would cost to replace the chair in front of
75 your computer with a toilet.
77 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
78 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
79 \\\ download, build and distribute -- http://www.A-A-P.org ///
80 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///