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(-) 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 From cfa8b4a1863fc59a6cd15022b5a69f36af65ddc9 Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Fri, 21 Nov 2014 12:44:13 -0300 Subject: vim-patch:7.4.435: Disable linebreak temporarily when formatting lines. vim-patch:7.4.435 Problem: Line formatting behaves differently when 'linebreak' is set. (mvxxc) Solution: Disable 'linebreak' temporarily. (Christian Brabandt) https://code.google.com/p/vim/source/detail?r=v7-4-435 --- src/nvim/edit.c | 6 ++++++ src/nvim/version.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/nvim/edit.c b/src/nvim/edit.c index d7910347fc..8bf5170ae7 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -5074,6 +5074,10 @@ internal_format ( colnr_T leader_len; int no_leader = FALSE; int do_comments = (flags & INSCHAR_DO_COM); + int has_lbr = curwin->w_p_lbr; + + // make sure win_lbr_chartabsize() counts correctly + curwin->w_p_lbr = false; /* * When 'ai' is off we don't want a space under the cursor to be @@ -5363,6 +5367,8 @@ internal_format ( if (save_char != NUL) /* put back space after cursor */ pchar_cursor(save_char); + curwin->w_p_lbr = has_lbr; + if (!format_only && haveto_redraw) { update_topline(); redraw_curbuf_later(VALID); diff --git a/src/nvim/version.c b/src/nvim/version.c index 34a14ef398..c692e43625 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -230,7 +230,7 @@ static int included_patches[] = { //438, 437, 436, - //435, + 435, //434, 433, //432 NA -- 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 +++++ src/nvim/screen.c | 5 +++++ src/nvim/testdir/test_listlbr.in | 8 ++++++++ src/nvim/testdir/test_listlbr.ok | 4 ++++ src/nvim/version.c | 2 +- 5 files changed, 23 insertions(+), 1 deletion(-) 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; } /* diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 58faac1ae7..164b8e7f7d 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -1205,8 +1205,13 @@ static void win_update(win_T *wp) */ if (VIsual_mode == Ctrl_V) { colnr_T fromc, toc; + int save_ve_flags = ve_flags; + + if (curwin->w_p_lbr) + ve_flags = VE_ALL; getvcols(wp, &VIsual, &curwin->w_cursor, &fromc, &toc); + ve_flags = save_ve_flags; ++toc; if (curwin->w_curswant == MAXCOL) toc = MAXCOL; diff --git a/src/nvim/testdir/test_listlbr.in b/src/nvim/testdir/test_listlbr.in index 2f28126554..75b06b4cc7 100644 --- a/src/nvim/testdir/test_listlbr.in +++ b/src/nvim/testdir/test_listlbr.in @@ -56,6 +56,14 @@ STARTTEST :syn match All /.*/ contains=ConcealVar :let line=ScreenChar(winwidth(0)) :call DoRecordScreen() +:set cpo&vim linebreak +:let g:test ="Test 6: set linebreak with visual block mode" +:let line="REMOVE: this not" +:$put =line +:let line="REMOVE: aaaaaaaaaaaaa" +:$put =line +:1/^REMOVE: +0jf x:$put :%w! test.out :qa! ENDTEST diff --git a/src/nvim/testdir/test_listlbr.ok b/src/nvim/testdir/test_listlbr.ok index 9b8037f4d3..ee74667661 100644 --- a/src/nvim/testdir/test_listlbr.ok +++ b/src/nvim/testdir/test_listlbr.ok @@ -32,3 +32,7 @@ Sabbbbbb bla ~ ~ ~ +this not +aaaaaaaaaaaaa +REMOVE: +REMOVE: diff --git a/src/nvim/version.c b/src/nvim/version.c index c692e43625..e4ad77b367 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -199,7 +199,7 @@ static int included_patches[] = { //470, //469, //468, - //467, + 467, //465, //464, //463, -- cgit From 42dc00b767333576b97280a69d924afbb4326155 Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Fri, 21 Nov 2014 13:18:22 -0300 Subject: vim-patch:7.4.472: Only draw "precedes" entry in 'listchar' when 'list' is on vim-patch:7.4.472 Problem: The "precedes" entry in 'listchar' will be drawn when 'showbreak is set and list is not. Solution: Only draw this character when 'list' is on. (Christian Brabandt) https://code.google.com/p/vim/source/detail?r=af998690a8841d4df95cea0bed4246f2ba98e247 --- src/nvim/screen.c | 1 + src/nvim/version.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 164b8e7f7d..73df08aac9 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -3730,6 +3730,7 @@ win_line ( * special character (via 'listchars' option "precedes:". */ if (lcs_prec_todo != NUL + && wp->w_p_list && (wp->w_p_wrap ? wp->w_skipcol > 0 : wp->w_leftcol > 0) && filler_todo <= 0 && draw_state > WL_NR diff --git a/src/nvim/version.c b/src/nvim/version.c index e4ad77b367..d2895a14fa 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -194,7 +194,7 @@ static int included_patches[] = { //475, //474, //473, - //472, + 472, //471, //470, //469, -- cgit From c82eb31a5d22353b3a31e247448a44b19a590c05 Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Fri, 21 Nov 2014 13:21:35 -0300 Subject: vim-patch:7.4.473 vim-patch:7.4.473 Problem: Cursor movement is incorrect when there is a number column/sign/fold column and 'sbr' is displayed. Solution: Adjust the column for 'sbr'. (Christian Brabandt) https://code.google.com/p/vim/source/detail?r=v7-4-473 --- src/nvim/charset.c | 2 ++ src/nvim/version.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/nvim/charset.c b/src/nvim/charset.c index f3bb3d8c73..3e37cbdafd 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -1058,6 +1058,8 @@ int win_lbr_chartabsize(win_T *wp, char_u *line, char_u *s, colnr_T col, int *he if (col >= (colnr_T)wp->w_width) { col -= wp->w_width; numberextra = wp->w_width - (numberextra - win_col_off2(wp)); + if (*p_sbr != NUL && col >= (colnr_T)STRLEN(p_sbr)) + col -= (colnr_T)STRLEN(p_sbr); if (numberextra > 0) { col = col % numberextra; } diff --git a/src/nvim/version.c b/src/nvim/version.c index d2895a14fa..28404c902c 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -193,7 +193,7 @@ static int included_patches[] = { //476, //475, //474, - //473, + 473, 472, //471, //470, -- cgit From 9ab44e74abb7553ad39c13621e0904680e61287d Mon Sep 17 00:00:00 2001 From: Felipe Morales Date: Fri, 21 Nov 2014 13:25:54 -0300 Subject: vim-patch:7.4.478: Use character lenght for 'showbreak' vim-patch:7.4.478 Problem: Using byte length instead of character length for 'showbreak'. Solution: Compute the character length. (Marco Hinz) https://code.google.com/p/vim/source/detail?r=v7-4-478 --- src/nvim/charset.c | 7 +++++-- src/nvim/version.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/nvim/charset.c b/src/nvim/charset.c index 3e37cbdafd..bbe80a519c 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -1058,8 +1058,11 @@ int win_lbr_chartabsize(win_T *wp, char_u *line, char_u *s, colnr_T col, int *he if (col >= (colnr_T)wp->w_width) { col -= wp->w_width; numberextra = wp->w_width - (numberextra - win_col_off2(wp)); - if (*p_sbr != NUL && col >= (colnr_T)STRLEN(p_sbr)) - col -= (colnr_T)STRLEN(p_sbr); + if (*p_sbr != NUL) { + colnr_T sbrlen = (colnr_T)MB_CHARLEN(p_sbr); + if (col >= sbrlen) + col -= sbrlen; + } if (numberextra > 0) { col = col % numberextra; } diff --git a/src/nvim/version.c b/src/nvim/version.c index 28404c902c..f73e5c8cae 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -188,7 +188,7 @@ static int included_patches[] = { //481, //480, //479, - //478, + 478, //477, //476, //475, -- cgit