To: vim-dev@vim.org
Subject: Patch 6.1b.004
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------
Patch 6.1b.004
Problem: col("'>") returns a negative number for linewise selection. (Neil
Bird)
Solution: Don't add one to MAXCOL.
Files: src/eval.c
*** ../vim61b.003/src/eval.c Wed Mar 6 20:30:51 2002
--- src/eval.c Tue Mar 12 17:59:58 2002
***************
*** 3095,3123 ****
fp = var2fpos(&argvars[0], FALSE);
if (fp != NULL)
{
! col = fp->col + 1;
! #ifdef FEAT_VIRTUALEDIT
! /* col(".") when the cursor is on the NUL at the end of the line
! * because of "coladd" can be seen as an extra column. */
! if (virtual_active() && fp == &curwin->w_cursor)
{
! char_u *p = ml_get_cursor();
! if (curwin->w_cursor.coladd >= (colnr_T)chartabsize(p,
curwin->w_virtcol - curwin->w_cursor.coladd))
! {
# ifdef FEAT_MBYTE
! int l;
! if (*p != NUL && p[(l = (*mb_ptr2len_check)(p))] == NUL)
! col += l;
# else
! if (*p != NUL && p[1] == NUL)
! ++col;
# endif
}
- }
#endif
}
retvar->var_val.var_number = col;
}
--- 3095,3128 ----
fp = var2fpos(&argvars[0], FALSE);
if (fp != NULL)
{
! if (fp->col == MAXCOL)
! col = MAXCOL;
! else
{
! col = fp->col + 1;
! #ifdef FEAT_VIRTUALEDIT
! /* col(".") when the cursor is on the NUL at the end of the line
! * because of "coladd" can be seen as an extra column. */
! if (virtual_active() && fp == &curwin->w_cursor)
! {
! char_u *p = ml_get_cursor();
! if (curwin->w_cursor.coladd >= (colnr_T)chartabsize(p,
curwin->w_virtcol - curwin->w_cursor.coladd))
! {
# ifdef FEAT_MBYTE
! int l;
! if (*p != NUL && p[(l = (*mb_ptr2len_check)(p))] == NUL)
! col += l;
# else
! if (*p != NUL && p[1] == NUL)
! ++col;
# endif
+ }
}
#endif
+ }
}
retvar->var_val.var_number = col;
}
*** ../vim61b.003/src/version.c Mon Mar 11 22:14:07 2002
--- src/version.c Tue Mar 12 18:02:50 2002
***************
*** 608,609 ****
--- 608,611 ----
{ /* Add new patch number below this line */
+ /**/
+ 4,
/**/
--
hundred-and-one symptoms of being an internet addict:
260. Co-workers have to E-mail you about the fire alarm to get
you out of the building.
/// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\
/// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\
\\\ Project leader for A-A-P -- http://www.a-a-p.org ///
\\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///
.