components/vim/vim72-patches/7.2.355
changeset 198 172fc01ce997
equal deleted inserted replaced
197:fd801ec0737c 198:172fc01ce997
       
     1 To: [email protected]
       
     2 Subject: Patch 7.2.355
       
     3 Fcc: outbox
       
     4 From: Bram Moolenaar <[email protected]>
       
     5 Mime-Version: 1.0
       
     6 Content-Type: text/plain; charset=UTF-8
       
     7 Content-Transfer-Encoding: 8bit
       
     8 ------------
       
     9 
       
    10 Patch 7.2.355
       
    11 Problem:    Computing the cursor column in validate_cursor_col() is wrong when
       
    12 	    line numbers are used and 'n' is not in 'cpoptions', causing the
       
    13 	    popup menu to be positioned wrong.
       
    14 Solution:   Correctly use the offset. (partly by Dominique Pelle)
       
    15 Files:	    src/move.c
       
    16 
       
    17 
       
    18 *** ../vim-7.2.354/src/move.c	2009-11-03 16:22:59.000000000 +0100
       
    19 --- src/move.c	2010-02-03 17:15:16.000000000 +0100
       
    20 ***************
       
    21 *** 889,894 ****
       
    22 --- 889,895 ----
       
    23   {
       
    24       colnr_T off;
       
    25       colnr_T col;
       
    26 +     int     width;
       
    27   
       
    28       validate_virtcol();
       
    29       if (!(curwin->w_valid & VALID_WCOL))
       
    30 ***************
       
    31 *** 896,910 ****
       
    32   	col = curwin->w_virtcol;
       
    33   	off = curwin_col_off();
       
    34   	col += off;
       
    35   
       
    36   	/* long line wrapping, adjust curwin->w_wrow */
       
    37   	if (curwin->w_p_wrap
       
    38   		&& col >= (colnr_T)W_WIDTH(curwin)
       
    39 ! 		&& W_WIDTH(curwin) - off + curwin_col_off2() > 0)
       
    40 ! 	{
       
    41 ! 	    col -= W_WIDTH(curwin);
       
    42 ! 	    col = col % (W_WIDTH(curwin) - off + curwin_col_off2());
       
    43 ! 	}
       
    44   	if (col > (int)curwin->w_leftcol)
       
    45   	    col -= curwin->w_leftcol;
       
    46   	else
       
    47 --- 897,910 ----
       
    48   	col = curwin->w_virtcol;
       
    49   	off = curwin_col_off();
       
    50   	col += off;
       
    51 + 	width = W_WIDTH(curwin) - off + curwin_col_off2();
       
    52   
       
    53   	/* long line wrapping, adjust curwin->w_wrow */
       
    54   	if (curwin->w_p_wrap
       
    55   		&& col >= (colnr_T)W_WIDTH(curwin)
       
    56 ! 		&& width > 0)
       
    57 ! 	    /* use same formula as what is used in curs_columns() */
       
    58 ! 	    col -= ((col - W_WIDTH(curwin)) / width + 1) * width;
       
    59   	if (col > (int)curwin->w_leftcol)
       
    60   	    col -= curwin->w_leftcol;
       
    61   	else
       
    62 ***************
       
    63 *** 1041,1046 ****
       
    64 --- 1041,1047 ----
       
    65   	/* long line wrapping, adjust curwin->w_wrow */
       
    66   	if (curwin->w_wcol >= W_WIDTH(curwin))
       
    67   	{
       
    68 + 	    /* this same formula is used in validate_cursor_col() */
       
    69   	    n = (curwin->w_wcol - W_WIDTH(curwin)) / width + 1;
       
    70   	    curwin->w_wcol -= n * width;
       
    71   	    curwin->w_wrow += n;
       
    72 *** ../vim-7.2.354/src/version.c	2010-02-03 15:47:59.000000000 +0100
       
    73 --- src/version.c	2010-02-03 17:40:39.000000000 +0100
       
    74 ***************
       
    75 *** 683,684 ****
       
    76 --- 683,686 ----
       
    77   {   /* Add new patch number below this line */
       
    78 + /**/
       
    79 +     355,
       
    80   /**/
       
    81 
       
    82 -- 
       
    83 I'm in shape.  Round IS a shape.
       
    84 
       
    85  /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
       
    86 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
       
    87 \\\        download, build and distribute -- http://www.A-A-P.org        ///
       
    88  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///