From d25a59f4d0c357fd4df4adc8e2d60497f742c41a Mon Sep 17 00:00:00 2001 From: watiko Date: Mon, 25 Jan 2016 03:55:47 +0900 Subject: vim-patch:7.4.639 Problem: Combination of linebreak and conceal doesn't work well. Solution: Fix the display problems. (Christian Brabandt) https://github.com/vim/vim/commit/8fc6bc71266e342d339c851b3ee472357f917597 --- src/nvim/screen.c | 38 ++++++++++++---------- src/nvim/testdir/test88.in | 11 +++++++ src/nvim/testdir/test88.ok | 5 +++ src/nvim/version.c | 2 +- test/functional/legacy/listlbr_utf8_spec.lua | 48 +++++++++++++++++++++++++++- 5 files changed, 86 insertions(+), 18 deletions(-) diff --git a/src/nvim/screen.c b/src/nvim/screen.c index c6d1ea790e..0d0c645c3d 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -3410,7 +3410,7 @@ win_line ( int i; int saved_nextra = n_extra; - if ((is_concealing || boguscols > 0) && vcol_off > 0) { + if (vcol_off > 0) { // there are characters to conceal tab_len += vcol_off; } @@ -3440,25 +3440,31 @@ win_line ( // n_extra will be increased by FIX_FOX_BOGUSCOLS // macro below, so need to adjust for that here - if ((is_concealing || boguscols > 0) && vcol_off > 0) { + if (vcol_off > 0) { n_extra -= vcol_off; } } - /* Tab alignment should be identical regardless of - * 'conceallevel' value. So tab compensates of all - * previous concealed characters, and thus resets vcol_off - * and boguscols accumulated so far in the line. Note that - * the tab can be longer than 'tabstop' when there - * are concealed characters. */ - FIX_FOR_BOGUSCOLS; - // Make sure that the highlighting for the tab char will be correctly - // set further below (effectively reverts the FIX_FOR_BOGSUCOLS - // macro). - if (old_boguscols > 0 && n_extra > tab_len && wp->w_p_list - && lcs_tab1) { - tab_len += n_extra - tab_len; + + { + int vc_saved = vcol_off; + + // Tab alignment should be identical regardless of + // 'conceallevel' value. So tab compensates of all + // previous concealed characters, and thus resets + // vcol_off and boguscols accumulated so far in the + // line. Note that the tab can be longer than + // 'tabstop' when there are concealed characters. + FIX_FOR_BOGUSCOLS; + + // Make sure, the highlighting for the tab char will be + // correctly set further below (effectively reverts the + // FIX_FOR_BOGSUCOLS macro. + if (n_extra == tab_len + vc_saved && wp->w_p_list && lcs_tab1) { + tab_len += vc_saved; + } } - mb_utf8 = FALSE; /* don't draw as UTF-8 */ + + mb_utf8 = (int)false; // don't draw as UTF-8 if (wp->w_p_list) { c = lcs_tab1; if (wp->w_p_lbr) { diff --git a/src/nvim/testdir/test88.in b/src/nvim/testdir/test88.in index c2e6a752fa..9e43f703e9 100644 --- a/src/nvim/testdir/test88.in +++ b/src/nvim/testdir/test88.in @@ -71,6 +71,17 @@ GGk :set lbr :normal $ GGk +:set list listchars=tab:>- +:normal 0 +GGk +:normal W +GGk +:normal W +GGk +:normal W +GGk +:normal $ +GGk :" Display result. :call append('$', 'end:') :call append('$', positions) diff --git a/src/nvim/testdir/test88.ok b/src/nvim/testdir/test88.ok index e29698b7bd..12949f274a 100644 --- a/src/nvim/testdir/test88.ok +++ b/src/nvim/testdir/test88.ok @@ -22,3 +22,8 @@ end: 9:25 9:26 9:26 +9:1 +9:9 +9:17 +9:25 +9:26 diff --git a/src/nvim/version.c b/src/nvim/version.c index bf1986d3ba..2ffe41d6fd 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -485,7 +485,7 @@ static int included_patches[] = { 642, // 641 NA 640, - // 639, + 639, // 638 NA 637, 636, diff --git a/test/functional/legacy/listlbr_utf8_spec.lua b/test/functional/legacy/listlbr_utf8_spec.lua index 69e7b87a21..a327ae1857 100644 --- a/test/functional/legacy/listlbr_utf8_spec.lua +++ b/test/functional/legacy/listlbr_utf8_spec.lua @@ -2,6 +2,7 @@ local helpers = require('test.functional.helpers') local source = helpers.source +local feed = helpers.feed local clear, expect = helpers.clear, helpers.expect describe('linebreak', function() @@ -61,6 +62,43 @@ describe('linebreak', function() redraw! let line=ScreenChar(winwidth(0),7) call DoRecordScreen() + let g:test ="Test 5: set linebreak list listchars and concealing part2" + let c_defines=['bbeeeeee ; some text'] + call append('$', c_defines) + $ + norm! zt + set nowrap ts=2 list linebreak listchars=tab:>- cole=2 concealcursor=n + syn clear + syn match meaning /;\s*\zs.*/ + syn match hasword /^\x\{8}/ contains=word + syn match word /\<\x\{8}\>/ contains=beginword,endword contained + syn match beginword /\<\x\x/ contained conceal + syn match endword /\x\{6}\>/ contained + hi meaning guibg=blue + hi beginword guibg=green + hi endword guibg=red + redraw! + let line=ScreenChar(winwidth(0),1) + call DoRecordScreen() + let g:test ="Test 6: Screenattributes for comment" + $put =g:test + call append('$', ' /* and some more */') + exe "set ft=c ts=7 linebreak list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6" + syntax on + hi SpecialKey term=underline ctermfg=red guifg=red + let attr=[] + nnoremap GG ":let attr += ['".screenattr(screenrow(),screencol())."']\n" + $ + norm! zt0 + ]]) + feed('GGlGGlGGlGGlGGlGGlGGlGGlGGlGGl') + source([[ + call append('$', ['ScreenAttributes for test6:']) + if attr[0] != attr[1] && attr[1] != attr[3] && attr[3] != attr[5] + call append('$', "Attribut 0 and 1 and 3 and 5 are different!") + else + call append('$', "Not all attributes are different") + endif ]]) -- Assert buffer contents. @@ -102,6 +140,14 @@ describe('linebreak', function() #define >CDEFGH>----1 #define >_FILE>--------->--->---1 #define >_CONSOLE>---------->---2 - #define >_FILE_AND_CONSOLE>---------3 ]]) + #define >_FILE_AND_CONSOLE>---------3 + bbeeeeee ; some text + + Test 5: set linebreak list listchars and concealing part2 + eeeeee>--->-;>some text + Test 6: Screenattributes for comment + /* and some more */ + ScreenAttributes for test6: + Attribut 0 and 1 and 3 and 5 are different!]]) end) end) -- cgit From 8771e84db7f795dd15b04efa585f772b8b7e705d Mon Sep 17 00:00:00 2001 From: watiko Date: Mon, 25 Jan 2016 10:07:16 +0900 Subject: vim-patch:7.4.753 Problem: Appending in Visual mode with 'linebreak' set does not work properly. Also when 'selection' is "exclusive". (Ingo Karkat) Solution: Recalculate virtual columns. (Christian Brabandt) https://github.com/vim/vim/commit/74db34cc9162445e3d500ab2d61c5c19ce9af0ca --- src/nvim/normal.c | 138 +++++++++++++++++---------- src/nvim/testdir/test_listlbr.in | 10 ++ src/nvim/testdir/test_listlbr.ok | 5 + src/nvim/version.c | 2 +- test/functional/legacy/listlbr_utf8_spec.lua | 11 ++- 5 files changed, 111 insertions(+), 55 deletions(-) diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 2f57d8c610..a116b5a0bd 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -1430,6 +1430,9 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank) || VIsual_active ) && oap->op_type != OP_NOP) { // Avoid a problem with unwanted linebreaks in block mode + if (curwin->w_p_lbr) { + curwin->w_valid &= ~VALID_VIRTCOL; + } curwin->w_p_lbr = false; oap->is_VIsual = VIsual_active; if (oap->motion_force == 'V') @@ -1598,55 +1601,7 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank) virtual_op = virtual_active(); if (VIsual_active || redo_VIsual_busy) { - if (VIsual_mode == Ctrl_V) { /* block mode */ - colnr_T start, end; - - oap->motion_type = MBLOCK; - - getvvcol(curwin, &(oap->start), - &oap->start_vcol, NULL, &oap->end_vcol); - if (!redo_VIsual_busy) { - getvvcol(curwin, &(oap->end), &start, NULL, &end); - - if (start < oap->start_vcol) - oap->start_vcol = start; - if (end > oap->end_vcol) { - if (*p_sel == 'e' && start >= 1 - && start - 1 >= oap->end_vcol) - oap->end_vcol = start - 1; - else - oap->end_vcol = end; - } - } - - /* if '$' was used, get oap->end_vcol from longest line */ - if (curwin->w_curswant == MAXCOL) { - curwin->w_cursor.col = MAXCOL; - oap->end_vcol = 0; - for (curwin->w_cursor.lnum = oap->start.lnum; - curwin->w_cursor.lnum <= oap->end.lnum; - ++curwin->w_cursor.lnum) { - getvvcol(curwin, &curwin->w_cursor, NULL, NULL, &end); - if (end > oap->end_vcol) - oap->end_vcol = end; - } - } else if (redo_VIsual_busy) - oap->end_vcol = oap->start_vcol + redo_VIsual_vcol - 1; - /* - * Correct oap->end.col and oap->start.col to be the - * upper-left and lower-right corner of the block area. - * - * (Actually, this does convert column positions into character - * positions) - */ - curwin->w_cursor.lnum = oap->end.lnum; - coladvance(oap->end_vcol); - oap->end = curwin->w_cursor; - - curwin->w_cursor = oap->start; - coladvance(oap->start_vcol); - oap->start = curwin->w_cursor; - } + get_op_vcol(oap, redo_VIsual_vcol, true); if (!redo_VIsual_busy && !gui_yank) { /* @@ -1894,9 +1849,14 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank) else restart_edit_save = 0; restart_edit = 0; + // Restore linebreak, so that when the user edits it looks as before. - curwin->w_p_lbr = lbr_saved; - /* Reset finish_op now, don't want it set inside edit(). */ + if (curwin->w_p_lbr != lbr_saved) { + curwin->w_p_lbr = lbr_saved; + get_op_vcol(oap, redo_VIsual_mode, false); + } + + // Reset finish_op now, don't want it set inside edit(). finish_op = false; if (op_change(oap)) /* will call edit() */ cap->retval |= CA_COMMAND_BUSY; @@ -1974,7 +1934,10 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank) restart_edit = 0; // Restore linebreak, so that when the user edits it looks as before. - curwin->w_p_lbr = lbr_saved; + if (curwin->w_p_lbr != lbr_saved) { + curwin->w_p_lbr = lbr_saved; + get_op_vcol(oap, redo_VIsual_mode, false); + } op_insert(oap, cap->count1); @@ -1997,7 +1960,11 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank) CancelRedo(); } else { // Restore linebreak, so that when the user edits it looks as before. - curwin->w_p_lbr = lbr_saved; + if (curwin->w_p_lbr != lbr_saved) { + curwin->w_p_lbr = lbr_saved; + get_op_vcol(oap, redo_VIsual_mode, false); + } + op_replace(oap, cap->nchar); } break; @@ -7698,6 +7665,71 @@ static void nv_open(cmdarg_T *cap) n_opencmd(cap); } +// calculate start/end virtual columns for operating in block mode +static void get_op_vcol( + oparg_T *oap, + colnr_T redo_VIsual_vcol, + bool initial // when true: adjust position for 'selectmode' +) +{ + colnr_T start; + colnr_T end; + + if (VIsual_mode != Ctrl_V) { + return; + } + + oap->motion_type = MBLOCK; + + // prevent from moving onto a trail byte + if (has_mbyte) { + mb_adjustpos(curwin->w_buffer, &oap->end); + } + + getvvcol(curwin, &(oap->start), &oap->start_vcol, NULL, &oap->end_vcol); + getvvcol(curwin, &(oap->end), &start, NULL, &end); + + if (start < oap->start_vcol) { + oap->start_vcol = start; + } + if (end > oap->end_vcol) { + if (initial && *p_sel == 'e' + && start >= 1 + && start - 1 >= oap->end_vcol) { + oap->end_vcol = start - 1; + } else { + oap->end_vcol = end; + } + } + // if '$' was used, get oap->end_vcol from longest line + if (curwin->w_curswant == MAXCOL) { + curwin->w_cursor.col = MAXCOL; + oap->end_vcol = 0; + for (curwin->w_cursor.lnum = oap->start.lnum; + curwin->w_cursor.lnum <= oap->end.lnum; ++curwin->w_cursor.lnum) { + getvvcol(curwin, &curwin->w_cursor, NULL, NULL, &end); + if (end > oap->end_vcol) { + oap->end_vcol = end; + } + } + } else if (redo_VIsual_busy) { + oap->end_vcol = oap->start_vcol + redo_VIsual_vcol - 1; + } + + // Correct oap->end.col and oap->start.col to be the + // upper-left and lower-right corner of the block area. + // + // (Actually, this does convert column positions into character + // positions) + curwin->w_cursor.lnum = oap->end.lnum; + coladvance(oap->end_vcol); + oap->end = curwin->w_cursor; + + curwin->w_cursor = oap->start; + coladvance(oap->start_vcol); + oap->start = curwin->w_cursor; +} + // Handle an arbitrary event in normal mode static void nv_event(cmdarg_T *cap) { diff --git a/src/nvim/testdir/test_listlbr.in b/src/nvim/testdir/test_listlbr.in index 36235ea915..57202b46eb 100644 --- a/src/nvim/testdir/test_listlbr.in +++ b/src/nvim/testdir/test_listlbr.in @@ -60,11 +60,21 @@ STARTTEST :set cpo&vim linebreak :let g:test ="Test 6: set linebreak with visual block mode" :let line="REMOVE: this not" +:$put =g:test :$put =line :let line="REMOVE: aaaaaaaaaaaaa" :$put =line :1/^REMOVE: 0jf x:$put +:set cpo&vim linebreak +:let g:test ="Test 7: set linebreak with visual block mode and v_b_A" +:$put =g:test +Golong line: 40afoobar aTARGET at end +:exe "norm! $3B\eAx\" +:set cpo&vim linebreak sbr= +:let g:test ="Test 8: set linebreak with visual char mode and changing block" +:$put =g:test +Go1111-1111-1111-11-1111-1111-11110f-lv3lc2222bgj. :%w! test.out :qa! ENDTEST diff --git a/src/nvim/testdir/test_listlbr.ok b/src/nvim/testdir/test_listlbr.ok index ee74667661..82881234c4 100644 --- a/src/nvim/testdir/test_listlbr.ok +++ b/src/nvim/testdir/test_listlbr.ok @@ -32,7 +32,12 @@ Sabbbbbb bla ~ ~ ~ +Test 6: set linebreak with visual block mode this not aaaaaaaaaaaaa REMOVE: REMOVE: +Test 7: set linebreak with visual block mode and v_b_A +long line: foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar TARGETx at end +Test 8: set linebreak with visual char mode and changing block +1111-2222-1111-11-1111-2222-1111 diff --git a/src/nvim/version.c b/src/nvim/version.c index 2ffe41d6fd..9e2139c297 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -371,7 +371,7 @@ static int included_patches[] = { // 756 NA // 755, // 754, - // 753, + 753, // 752, // 751 NA // 750 NA diff --git a/test/functional/legacy/listlbr_utf8_spec.lua b/test/functional/legacy/listlbr_utf8_spec.lua index a327ae1857..86e8252063 100644 --- a/test/functional/legacy/listlbr_utf8_spec.lua +++ b/test/functional/legacy/listlbr_utf8_spec.lua @@ -99,6 +99,13 @@ describe('linebreak', function() else call append('$', "Not all attributes are different") endif + set cpo&vim linebreak selection=exclusive + let g:test ="Test 8: set linebreak with visual block mode and v_b_A and selection=exclusive and multibyte char" + $put =g:test + ]]) + feed("Golong line: 40afoobar aTARGETÃ' at end") + source([[ + exe "norm! $3B\eAx\" ]]) -- Assert buffer contents. @@ -148,6 +155,8 @@ describe('linebreak', function() Test 6: Screenattributes for comment /* and some more */ ScreenAttributes for test6: - Attribut 0 and 1 and 3 and 5 are different!]]) + Attribut 0 and 1 and 3 and 5 are different! + Test 8: set linebreak with visual block mode and v_b_A and selection=exclusive and multibyte char + long line: foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar TARGETÃx' at end]]) end) end) -- cgit From 8721e1fe088943134fe67ee267a9e6b27df291f0 Mon Sep 17 00:00:00 2001 From: watiko Date: Mon, 25 Jan 2016 11:24:58 +0900 Subject: vim-patch:7.4.949 Problem: When using 'colorcolumn' and there is a sign with a fullwidth character the highlighting is wrong. (Andrew Stewart) Solution: Only increment vcol when in the right state. (Christian Brabandt) https://github.com/vim/vim/commit/32a214e78df0120f92fe049eab1385c60f0cdb0b --- src/nvim/screen.c | 28 ++++++++------- src/nvim/version.c | 2 +- test/functional/legacy/listlbr_utf8_spec.lua | 52 +++++++++++++++++++++++++++- 3 files changed, 68 insertions(+), 14 deletions(-) diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 0d0c645c3d..43bc2c1f68 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -3975,20 +3975,24 @@ win_line ( ScreenAttrs[off] = char_attr; if (has_mbyte && (*mb_char2cells)(mb_c) > 1) { - /* Need to fill two screen columns. */ - ++off; - ++col; - if (enc_utf8) - /* UTF-8: Put a 0 in the second screen char. */ + // Need to fill two screen columns. + off++; + col++; + if (enc_utf8) { + // UTF-8: Put a 0 in the second screen char. ScreenLines[off] = 0; - else - /* DBCS: Put second byte in the second screen char. */ + } else { + // DBCS: Put second byte in the second screen char. ScreenLines[off] = mb_c & 0xff; - ++vcol; - /* When "tocol" is halfway through a character, set it to the end of - * the character, otherwise highlighting won't stop. */ - if (tocol == vcol) - ++tocol; + } + if (draw_state > WL_NR && filler_todo <= 0) { + vcol++; + } + // When "tocol" is halfway through a character, set it to the end of + // the character, otherwise highlighting won't stop. + if (tocol == vcol) { + tocol++; + } if (wp->w_p_rl) { /* now it's time to backup one cell */ --off; diff --git a/src/nvim/version.c b/src/nvim/version.c index 9e2139c297..1efabe9b1b 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -175,7 +175,7 @@ static int included_patches[] = { // 952, // 951, 950, - // 949, + 949, // 948 NA // 947, 946, diff --git a/test/functional/legacy/listlbr_utf8_spec.lua b/test/functional/legacy/listlbr_utf8_spec.lua index 86e8252063..64e1325e90 100644 --- a/test/functional/legacy/listlbr_utf8_spec.lua +++ b/test/functional/legacy/listlbr_utf8_spec.lua @@ -33,16 +33,19 @@ describe('linebreak', function() $put =g:line wincmd p endfu + " let g:test ="Test 1: set linebreak + set list + fancy listchars" exe "set linebreak list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6" redraw! let line=ScreenChar(winwidth(0),4) call DoRecordScreen() + " let g:test ="Test 2: set nolinebreak list" set list nolinebreak redraw! let line=ScreenChar(winwidth(0),4) call DoRecordScreen() + " let g:test ="Test 3: set linebreak nolist" $put =\"\t*mask = nil;\" $ @@ -51,6 +54,7 @@ describe('linebreak', function() redraw! let line=ScreenChar(winwidth(0),4) call DoRecordScreen() + " let g:test ="Test 4: set linebreak list listchars and concealing" let c_defines=['#define ABCDE 1','#define ABCDEF 1','#define ABCDEFG 1','#define ABCDEFGH 1', '#define MSG_MODE_FILE 1','#define MSG_MODE_CONSOLE 2','#define MSG_MODE_FILE_AND_CONSOLE 3','#define MSG_MODE_FILE_THEN_CONSOLE 4'] call append('$', c_defines) @@ -62,6 +66,7 @@ describe('linebreak', function() redraw! let line=ScreenChar(winwidth(0),7) call DoRecordScreen() + " let g:test ="Test 5: set linebreak list listchars and concealing part2" let c_defines=['bbeeeeee ; some text'] call append('$', c_defines) @@ -80,6 +85,7 @@ describe('linebreak', function() redraw! let line=ScreenChar(winwidth(0),1) call DoRecordScreen() + " let g:test ="Test 6: Screenattributes for comment" $put =g:test call append('$', ' /* and some more */') @@ -106,6 +112,38 @@ describe('linebreak', function() feed("Golong line: 40afoobar aTARGETÃ' at end") source([[ exe "norm! $3B\eAx\" + " + let g:test ="Test 9: a multibyte sign and colorcolumn" + let attr=[] + let attr2=[] + $put ='' + $put ='a b c' + $put ='a b c' + set list nolinebreak cc=3 + sign define foo text=+ + sign place 1 name=foo line=50 buffer=2 + norm! 2kztj + let line1=line('.') + ]]) + feed('0GGlGGlGGlGGl') + source([[ + let line2=line('.') + let attr2=attr + let attr=[] + ]]) + feed('0GGlGGlGGlGGl') + source([[ + redraw! + let line=ScreenChar(winwidth(0),3) + call DoRecordScreen() + call append('$', ['ScreenAttributes for test9:']) + call append('$', ["Line: ".line1. " ". string(g:attr),"Line: ".line2. " ". string(g:attr2)]) + " expected: attr[2] is different because of colorcolumn + if attr[0] != attr2[0] || attr[1] != attr2[1] || attr[2] != attr2[2] + call append('$', "Screen attributes are different!") + else + call append('$', "Screen attributes are the same!") + endif ]]) -- Assert buffer contents. @@ -157,6 +195,18 @@ describe('linebreak', function() ScreenAttributes for test6: Attribut 0 and 1 and 3 and 5 are different! Test 8: set linebreak with visual block mode and v_b_A and selection=exclusive and multibyte char - long line: foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar TARGETÃx' at end]]) + long line: foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar foobar TARGETÃx' at end + + a b c + a b c + + Test 9: a multibyte sign and colorcolumn + ¶ + +a b c¶ + a b c¶ + ScreenAttributes for test9: + Line: 50 ['0', '0', '72', '0'] + Line: 51 ['0', '0', '72', '0'] + Screen attributes are the same!]]) end) end) -- cgit From db51ff10f40f4f65b2b32ca1f9d3ff80f87752b9 Mon Sep 17 00:00:00 2001 From: watiko Date: Mon, 25 Jan 2016 12:09:17 +0900 Subject: vim-patch:7.4.963 Problem: test_listlbr_utf8 sometimes fails. Solution: Don't use a literal multibyte character but uXXXX. Do not dump the screen highlighting. (Christian Brabandt, closes #518) https://github.com/vim/vim/commit/1c57fe8b9450eb29c3e42a94527d4b7514f853e2 --- src/nvim/version.c | 2 +- test/functional/legacy/listlbr_utf8_spec.lua | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/nvim/version.c b/src/nvim/version.c index 1efabe9b1b..41bcd7d738 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -161,7 +161,7 @@ static int included_patches[] = { // 966 NA // 965 NA // 964 NA - // 963, + 963, // 962 NA // 961, // 960 NA diff --git a/test/functional/legacy/listlbr_utf8_spec.lua b/test/functional/legacy/listlbr_utf8_spec.lua index 64e1325e90..df0e817533 100644 --- a/test/functional/legacy/listlbr_utf8_spec.lua +++ b/test/functional/legacy/listlbr_utf8_spec.lua @@ -120,7 +120,9 @@ describe('linebreak', function() $put ='a b c' $put ='a b c' set list nolinebreak cc=3 - sign define foo text=+ + ]]) + feed(':sign define foo text=uff0b') + source([[ sign place 1 name=foo line=50 buffer=2 norm! 2kztj let line1=line('.') @@ -136,8 +138,6 @@ describe('linebreak', function() redraw! let line=ScreenChar(winwidth(0),3) call DoRecordScreen() - call append('$', ['ScreenAttributes for test9:']) - call append('$', ["Line: ".line1. " ". string(g:attr),"Line: ".line2. " ". string(g:attr2)]) " expected: attr[2] is different because of colorcolumn if attr[0] != attr2[0] || attr[1] != attr2[1] || attr[2] != attr2[2] call append('$', "Screen attributes are different!") @@ -201,12 +201,9 @@ describe('linebreak', function() a b c Test 9: a multibyte sign and colorcolumn - ¶ - +a b c¶ - a b c¶ - ScreenAttributes for test9: - Line: 50 ['0', '0', '72', '0'] - Line: 51 ['0', '0', '72', '0'] + ¶ + +a b c¶ + a b c¶ Screen attributes are the same!]]) end) end) -- cgit