Mercurial > vim
comparison src/testdir/test_cursorline.vim @ 30687:f936d46cc9c1 v9.0.0678
patch 9.0.0678: using exclamation marks on :function
Commit: https://github.com/vim/vim/commit/97f0eb169bf805c372b13c6bc9a03da2e75e3354
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Oct 6 19:49:13 2022 +0100
patch 9.0.0678: using exclamation marks on :function
Problem: Using exclamation marks on :function.
Solution: Use :func and :endfunc as usual.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 06 Oct 2022 21:00:04 +0200 |
parents | f7a2de8a4ddc |
children | 1ec91bab6129 |
comparison
equal
deleted
inserted
replaced
30686:08d086d76489 | 30687:f936d46cc9c1 |
---|---|
1 " Test for cursorline and cursorlineopt | 1 " Test for cursorline and cursorlineopt |
2 | 2 |
3 source check.vim | 3 source check.vim |
4 source screendump.vim | 4 source screendump.vim |
5 | 5 |
6 function! s:screen_attr(lnum) abort | 6 func s:screen_attr(lnum) abort |
7 return map(range(1, 8), 'screenattr(a:lnum, v:val)') | 7 return map(range(1, 8), 'screenattr(a:lnum, v:val)') |
8 endfunction | 8 endfunc |
9 | 9 |
10 function! s:test_windows(h, w) abort | 10 func s:test_windows(h, w) abort |
11 call NewWindow(a:h, a:w) | 11 call NewWindow(a:h, a:w) |
12 endfunction | 12 endfunc |
13 | 13 |
14 function! s:close_windows() abort | 14 func s:close_windows() abort |
15 call CloseWindow() | 15 call CloseWindow() |
16 endfunction | 16 endfunc |
17 | 17 |
18 function! s:new_hi() abort | 18 func s:new_hi() abort |
19 redir => save_hi | 19 redir => save_hi |
20 silent! hi CursorLineNr | 20 silent! hi CursorLineNr |
21 redir END | 21 redir END |
22 let save_hi = join(split(substitute(save_hi, '\s*xxx\s*', ' ', ''), "\n"), '') | 22 let save_hi = join(split(substitute(save_hi, '\s*xxx\s*', ' ', ''), "\n"), '') |
23 exe 'hi' save_hi 'ctermbg=0 guibg=Black' | 23 exe 'hi' save_hi 'ctermbg=0 guibg=Black' |
24 return save_hi | 24 return save_hi |
25 endfunction | 25 endfunc |
26 | 26 |
27 func Test_cursorline_highlight1() | 27 func Test_cursorline_highlight1() |
28 let save_hi = s:new_hi() | 28 let save_hi = s:new_hi() |
29 try | 29 try |
30 call s:test_windows(10, 20) | 30 call s:test_windows(10, 20) |