Mercurial > vim
comparison src/testdir/test_listlbr_utf8.vim @ 15406:63b02fcf1361 v8.1.0711
patch 8.1.0711: test files still use function!
commit https://github.com/vim/vim/commit/1e1153600c0377472d62cc553173fe555ddcf5a7
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jan 9 23:01:02 2019 +0100
patch 8.1.0711: test files still use function!
Problem: Test files still use function!.
Solution: Remove the exclamation mark. Fix overwriting a function.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 09 Jan 2019 23:15:05 +0100 |
parents | 18373179040e |
children | f38fcbf343ce |
comparison
equal
deleted
inserted
replaced
15405:3a8785d45112 | 15406:63b02fcf1361 |
---|---|
7 finish | 7 finish |
8 endif | 8 endif |
9 | 9 |
10 source view_util.vim | 10 source view_util.vim |
11 | 11 |
12 function s:screen_lines(lnum, width) abort | 12 func s:screen_lines(lnum, width) abort |
13 return ScreenLines(a:lnum, a:width) | 13 return ScreenLines(a:lnum, a:width) |
14 endfunction | 14 endfunc |
15 | 15 |
16 function! s:compare_lines(expect, actual) | 16 func s:compare_lines(expect, actual) |
17 call assert_equal(a:expect, a:actual) | 17 call assert_equal(a:expect, a:actual) |
18 endfunction | 18 endfunc |
19 | 19 |
20 function s:screen_attr(lnum, chars, ...) abort | 20 func s:screen_attr(lnum, chars, ...) abort |
21 let line = getline(a:lnum) | 21 let line = getline(a:lnum) |
22 let attr = [] | 22 let attr = [] |
23 let prefix = get(a:000, 0, 0) | 23 let prefix = get(a:000, 0, 0) |
24 for i in range(a:chars[0], a:chars[1]) | 24 for i in range(a:chars[0], a:chars[1]) |
25 let scol = strdisplaywidth(strcharpart(line, 0, i-1)) + 1 | 25 let scol = strdisplaywidth(strcharpart(line, 0, i-1)) + 1 |
26 let attr += [screenattr(a:lnum, scol + prefix)] | 26 let attr += [screenattr(a:lnum, scol + prefix)] |
27 endfor | 27 endfor |
28 return attr | 28 return attr |
29 endfunction | 29 endfunc |
30 | 30 |
31 function s:test_windows(...) | 31 func s:test_windows(...) |
32 call NewWindow(10, 20) | 32 call NewWindow(10, 20) |
33 setl ts=4 sw=4 sts=4 linebreak sbr=+ wrap | 33 setl ts=4 sw=4 sts=4 linebreak sbr=+ wrap |
34 exe get(a:000, 0, '') | 34 exe get(a:000, 0, '') |
35 endfunction | 35 endfunc |
36 | 36 |
37 function s:close_windows(...) | 37 func s:close_windows(...) |
38 call CloseWindow() | 38 call CloseWindow() |
39 exe get(a:000, 0, '') | 39 exe get(a:000, 0, '') |
40 endfunction | 40 endfunc |
41 | 41 |
42 func Test_linebreak_with_fancy_listchars() | 42 func Test_linebreak_with_fancy_listchars() |
43 call s:test_windows("setl list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6") | 43 call s:test_windows("setl list listchars=nbsp:\u2423,tab:\u2595\u2014,trail:\u02d1,eol:\ub6") |
44 call setline(1, "\tabcdef hijklmn\tpqrstuvwxyz\u00a01060ABCDEFGHIJKLMNOP ") | 44 call setline(1, "\tabcdef hijklmn\tpqrstuvwxyz\u00a01060ABCDEFGHIJKLMNOP ") |
45 redraw! | 45 redraw! |