vim-patch:7.4.425: Adjust virtcol when showbreak is set

vim-patch:7.4.425

Problem:    When 'showbreak' is used "gj" may move to the wrong
position. (Nazri Ramliy)
Solution:   Adjust virtcol when 'showbreak' is set. (Christian Brabandt)

https://code.google.com/p/vim/source/detail?r=v7-4-425
This commit is contained in:
Felipe Morales
2014-11-21 12:39:34 -03:00
parent 9e37c1d3b6
commit ef7eab1ec6
2 changed files with 6 additions and 2 deletions

View File

@@ -3492,7 +3492,11 @@ static bool nv_screengo(oparg_T *oap, int dir, long dist)
* screenline or move two screenlines.
*/
validate_virtcol();
if (curwin->w_virtcol > curwin->w_curswant
colnr_T virtcol = curwin->w_virtcol;
if (virtcol > (colnr_T)width1 && *p_sbr != NUL)
virtcol -= vim_strsize(p_sbr);
if (virtcol > curwin->w_curswant
&& (curwin->w_curswant < (colnr_T)width1
? (curwin->w_curswant > (colnr_T)width1 / 2)
: ((curwin->w_curswant - width1) % width2