From ef7eab1ec6b40afe2c88d78aaeeda65980ff6b2f Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Fri, 21 Nov 2014 12:39:34 -0300 Subject: 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 --- src/nvim/normal.c | 6 +++++- src/nvim/version.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 29070ff188..a2bdc05831 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -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 diff --git a/src/nvim/version.c b/src/nvim/version.c index c2818edcc5..34a14ef398 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -240,7 +240,7 @@ static int included_patches[] = { //428 NA 427, //426 NA - //425, + 425, //424 NA //423, //422, -- cgit