To: vim_dev@googlegroups.com Subject: Patch 8.1.1079 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.1079 Problem: No need for a separate ScreenLinesUtf8() test function. Solution: Get the composing characters with ScreenLines(). Files: src/testdir/view_util.vim, src/testdir/test_listchars.vim, src/testdir/test_utf8.vim *** ../vim-8.1.1078/src/testdir/view_util.vim 2019-03-29 14:16:34.142861770 +0100 --- src/testdir/view_util.vim 2019-03-30 15:42:00.064646502 +0100 *************** *** 5,33 **** finish endif - " Get text on the screen, without composing characters. - " ScreenLines(lnum, width) or - " ScreenLines([start, end], width) - function! ScreenLines(lnum, width) abort - redraw! - if type(a:lnum) == v:t_list - let start = a:lnum[0] - let end = a:lnum[1] - else - let start = a:lnum - let end = a:lnum - endif - let lines = [] - for l in range(start, end) - let lines += [join(map(range(1, a:width), 'nr2char(screenchar(l, v:val))'), '')] - endfor - return lines - endfunction - " Get text on the screen, including composing characters. " ScreenLines(lnum, width) or " ScreenLines([start, end], width) ! function! ScreenLinesUtf8(lnum, width) abort redraw! if type(a:lnum) == v:t_list let start = a:lnum[0] --- 5,14 ---- finish endif " Get text on the screen, including composing characters. " ScreenLines(lnum, width) or " ScreenLines([start, end], width) ! function! ScreenLines(lnum, width) abort redraw! if type(a:lnum) == v:t_list let start = a:lnum[0] *** ../vim-8.1.1078/src/testdir/test_listchars.vim 2019-03-30 15:34:42.715472004 +0100 --- src/testdir/test_listchars.vim 2019-03-30 15:41:24.208877625 +0100 *************** *** 130,136 **** \ ] redraw! call cursor(1, 1) ! let got = ScreenLinesUtf8(1, virtcol('$')) bw! call assert_equal(expected, got) let &encoding=oldencoding --- 130,136 ---- \ ] redraw! call cursor(1, 1) ! let got = ScreenLines(1, virtcol('$')) bw! call assert_equal(expected, got) let &encoding=oldencoding *** ../vim-8.1.1078/src/testdir/test_utf8.vim 2019-03-29 14:16:34.142861770 +0100 --- src/testdir/test_utf8.vim 2019-03-30 15:41:40.588772034 +0100 *************** *** 91,97 **** call assert_equal("", screenstring(1, 4)) call assert_equal("\u3046\u3099", screenstring(1, 5)) ! call assert_equal([text . ' '], ScreenLinesUtf8(1, 8)) bwipe! endfunc --- 91,97 ---- call assert_equal("", screenstring(1, 4)) call assert_equal("\u3046\u3099", screenstring(1, 5)) ! call assert_equal([text . ' '], ScreenLines(1, 8)) bwipe! endfunc *** ../vim-8.1.1078/src/version.c 2019-03-30 15:34:42.715472004 +0100 --- src/version.c 2019-03-30 15:40:47.517114213 +0100 *************** *** 777,778 **** --- 777,780 ---- { /* Add new patch number below this line */ + /**/ + 1079, /**/ -- hundred-and-one symptoms of being an internet addict: 159. You get excited whenever discussing your hard drive. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///