Files
neovim/test/old/testdir/test_gui.vim
zeertzjq 9d85f086d9 vim-patch:9.1.1622: Patch v9.1.1432 causes performance regressions (#35288)
Problem:  Patch v9.1.1432 causes performance regressions
Solution: Revert "patch 9.1.1432: GTK GUI: Buffer menu does not handle
          unicode correctly" (Yee Cheng Chin).

This reverts commit 08896dd330c6dc8324618fde482db968e6f71088.

The previous change to support Unicode characters properly in the
buffers menu resorted to removing all buffer menus and re-add the
buffers after doing a sort, per each buffer addition. This was quite
slow because if Vim is trying to load in multiple buffers at once (e.g.
when loading a session) this scales in O(n^2) and Vim can freeze for
dozens of seconds when adding a few hundred buffers.

related: vim/vim#17405
related: vim/vim#17928
fixes: vim/vim#17897

cda0d17f59

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-08-10 09:11:13 +00:00

48 lines
1.5 KiB
VimL

func SetUp()
source $VIMRUNTIME/menu.vim
endfunc
func Test_colorscheme()
" call assert_equal('16777216', &t_Co)
let colorscheme_saved = exists('g:colors_name') ? g:colors_name : 'default'
let g:color_count = 0
augroup TestColors
au!
au ColorScheme * let g:color_count += 1
\ | let g:after_colors = g:color_count
\ | let g:color_after = expand('<amatch>')
au ColorSchemePre * let g:color_count += 1
\ | let g:before_colors = g:color_count
\ | let g:color_pre = expand('<amatch>')
augroup END
colorscheme torte
redraw!
call assert_equal('dark', &background)
call assert_equal(1, g:before_colors)
call assert_equal(2, g:after_colors)
call assert_equal('torte', g:color_pre)
call assert_equal('torte', g:color_after)
call assert_equal("\ntorte", execute('colorscheme'))
let a = substitute(execute('hi Search'), "\n\\s\\+", ' ', 'g')
" FIXME: temporarily check less while the colorscheme changes
" call assert_match("\nSearch xxx term=reverse cterm=reverse ctermfg=196 ctermbg=16 gui=reverse guifg=#ff0000 guibg=#000000", a)
" call assert_match("\nSearch xxx term=reverse ", a)
call assert_fails('colorscheme does_not_exist', 'E185:')
call assert_equal('does_not_exist', g:color_pre)
call assert_equal('torte', g:color_after)
exec 'colorscheme' colorscheme_saved
augroup TestColors
au!
augroup END
unlet g:color_count g:after_colors g:before_colors
redraw!
endfunc
" vim: shiftwidth=2 sts=2 expandtab