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 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/nvim/normal.c') 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 -- cgit From 35e23984417e5dfcb88c56c4301cc60e856a97cd Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Fri, 21 Nov 2014 13:14:54 -0300 Subject: vim-patch:7.4.467: Avoid a problem with unwanted linebreaks in block mode vim-patch:7.4.467 Avoid a problem with unwanted linebreaks in block mode https://code.google.com/p/vim/source/detail?r=v7-4-467 --- src/nvim/normal.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/nvim/normal.c') diff --git a/src/nvim/normal.c b/src/nvim/normal.c index a2bdc05831..9ec97bd320 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -1099,6 +1099,10 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank) pos_T old_cursor; bool empty_region_error; int restart_edit_save; + int lbr_saved = curwin->w_p_lbr; + + curwin->w_p_lbr = false; /* avoid a problem with unwanted linebreaks in + * block mode */ /* The visual area is remembered for redo */ static int redo_VIsual_mode = NUL; /* 'v', 'V', or Ctrl-V */ @@ -1711,6 +1715,7 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank) oap->block_mode = false; clearop(oap); } + curwin->w_p_lbr = lbr_saved; } /* -- cgit