comparison src/testdir/test_signs.vim @ 26266:365e7f083f02 v8.2.3664

patch 8.2.3664: cannot adjust sign highlighting for 'cursorline' Commit: https://github.com/vim/vim/commit/e413ea04b716effb28eb49dbc98ad3f9f761545a Author: Bram Moolenaar <Bram@vim.org> Date: Wed Nov 24 16:20:13 2021 +0000 patch 8.2.3664: cannot adjust sign highlighting for 'cursorline' Problem: Cannot adjust sign highlighting for 'cursorline'. Solution: Add CursorLineSign and CursorLineFold highlight groups. (Gregory Anders, closes #9201)
author Bram Moolenaar <Bram@vim.org>
date Wed, 24 Nov 2021 17:30:06 +0100
parents cb0868062915
children f6ca4276c4cc
comparison
equal deleted inserted replaced
26265:e3e34a2ed54d 26266:365e7f083f02
13 " We can specify icons even if not all versions of vim support icons as 13 " We can specify icons even if not all versions of vim support icons as
14 " icon is ignored when not supported. "(not supported)" is shown after 14 " icon is ignored when not supported. "(not supported)" is shown after
15 " the icon name when listing signs. 15 " the icon name when listing signs.
16 sign define Sign1 text=x 16 sign define Sign1 text=x
17 17
18 call Sign_command_ignore_error('sign define Sign2 text=xy texthl=Title linehl=Error icon=../../pixmaps/stock_vim_find_help.png') 18 call Sign_command_ignore_error('sign define Sign2 text=xy texthl=Title linehl=Error culhl=Search icon=../../pixmaps/stock_vim_find_help.png')
19 19
20 " Test listing signs. 20 " Test listing signs.
21 let a=execute('sign list') 21 let a=execute('sign list')
22 call assert_match('^\nsign Sign1 text=x \nsign Sign2 ' . 22 call assert_match('^\nsign Sign1 text=x \nsign Sign2 ' .
23 \ 'icon=../../pixmaps/stock_vim_find_help.png .*text=xy ' . 23 \ 'icon=../../pixmaps/stock_vim_find_help.png .*text=xy ' .
24 \ 'linehl=Error texthl=Title$', a) 24 \ 'linehl=Error texthl=Title culhl=Search$', a)
25 25
26 let a=execute('sign list Sign1') 26 let a=execute('sign list Sign1')
27 call assert_equal("\nsign Sign1 text=x ", a) 27 call assert_equal("\nsign Sign1 text=x ", a)
28 28
29 " Split the window to the bottom to verify sign jump will stay in the 29 " Split the window to the bottom to verify sign jump will stay in the
390 " Remove all the signs 390 " Remove all the signs
391 call sign_unplace('*') 391 call sign_unplace('*')
392 call sign_undefine() 392 call sign_undefine()
393 393
394 " Tests for sign_define() 394 " Tests for sign_define()
395 let attr = {'text' : '=>', 'linehl' : 'Search', 'texthl' : 'Error'} 395 let attr = {'text' : '=>', 'linehl' : 'Search', 'texthl' : 'Error',
396 \ 'culhl': 'Visual'}
396 call assert_equal(0, "sign1"->sign_define(attr)) 397 call assert_equal(0, "sign1"->sign_define(attr))
397 call assert_equal([{'name' : 'sign1', 'texthl' : 'Error', 398 call assert_equal([{'name' : 'sign1', 'texthl' : 'Error',
398 \ 'linehl' : 'Search', 'text' : '=>'}], sign_getdefined()) 399 \ 'linehl' : 'Search', 'culhl' : 'Visual', 'text' : '=>'}],
400 \ sign_getdefined())
399 401
400 " Define a new sign without attributes and then update it 402 " Define a new sign without attributes and then update it
401 call sign_define("sign2") 403 call sign_define("sign2")
402 let attr = {'text' : '!!', 'linehl' : 'DiffAdd', 'texthl' : 'DiffChange', 404 let attr = {'text' : '!!', 'linehl' : 'DiffAdd', 'texthl' : 'DiffChange',
403 \ 'icon' : 'sign2.ico'} 405 \ 'culhl': 'DiffDelete', 'icon' : 'sign2.ico'}
404 call Sign_define_ignore_error("sign2", attr) 406 call Sign_define_ignore_error("sign2", attr)
405 call assert_equal([{'name' : 'sign2', 'texthl' : 'DiffChange', 407 call assert_equal([{'name' : 'sign2', 'texthl' : 'DiffChange',
406 \ 'linehl' : 'DiffAdd', 'text' : '!!', 'icon' : 'sign2.ico'}], 408 \ 'linehl' : 'DiffAdd', 'culhl' : 'DiffDelete', 'text' : '!!',
407 \ "sign2"->sign_getdefined()) 409 \ 'icon' : 'sign2.ico'}], "sign2"->sign_getdefined())
408 410
409 " Test for a sign name with digits 411 " Test for a sign name with digits
410 call assert_equal(0, sign_define(0002, {'linehl' : 'StatusLine'})) 412 call assert_equal(0, sign_define(0002, {'linehl' : 'StatusLine'}))
411 call assert_equal([{'name' : '2', 'linehl' : 'StatusLine'}], 413 call assert_equal([{'name' : '2', 'linehl' : 'StatusLine'}],
412 \ sign_getdefined(0002)) 414 \ sign_getdefined(0002))