To: vim_dev@googlegroups.com Subject: Patch 9.0.0059 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0059 Problem: Test file has wrong name. Solution: Rename the file. Various small fixes. (closes #10674) Files: src/getchar.c, src/vim.h, src/testdir/Make_all.mak, src/testdir/test_alot.vim, src/testdir/test_feedkeys.vim, src/testdir/test_input.vim, src/testdir/test_options.vim, src/testdir/test_statusline.vim, src/testdir/test_termcodes.vim, src/testdir/test_timers.vim *** ../vim-9.0.0058/src/getchar.c 2022-07-06 13:31:25.295370106 +0100 --- src/getchar.c 2022-07-23 06:05:18.476789522 +0100 *************** *** 2436,2442 **** int local_State = get_real_state(); int is_plug_map = FALSE; ! // If typehead starts with then remap, even for a "noremap" mapping. if (typebuf.tb_len >= 3 && typebuf.tb_buf[typebuf.tb_off] == K_SPECIAL && typebuf.tb_buf[typebuf.tb_off + 1] == KS_EXTRA --- 2436,2442 ---- int local_State = get_real_state(); int is_plug_map = FALSE; ! // If typeahead starts with then remap, even for a "noremap" mapping. if (typebuf.tb_len >= 3 && typebuf.tb_buf[typebuf.tb_off] == K_SPECIAL && typebuf.tb_buf[typebuf.tb_off + 1] == KS_EXTRA *** ../vim-9.0.0058/src/vim.h 2022-06-29 18:39:05.015841419 +0100 --- src/vim.h 2022-07-23 06:05:18.476789522 +0100 *************** *** 2819,2825 **** #define UC_BUFFER 1 // -buffer: local to current buffer #define UC_VIM9 2 // {} argument: Vim9 syntax. ! // flags used by vim_strsave_escaped() #define VSE_NONE 0 #define VSE_SHELL 1 // escape for a shell command #define VSE_BUFFER 2 // escape for a ":buffer" command --- 2819,2825 ---- #define UC_BUFFER 1 // -buffer: local to current buffer #define UC_VIM9 2 // {} argument: Vim9 syntax. ! // flags used by vim_strsave_fnameescape() #define VSE_NONE 0 #define VSE_SHELL 1 // escape for a shell command #define VSE_BUFFER 2 // escape for a ":buffer" command *** ../vim-9.0.0058/src/testdir/Make_all.mak 2022-07-02 16:29:15.027193547 +0100 --- src/testdir/Make_all.mak 2022-07-23 06:09:31.576896023 +0100 *************** *** 125,131 **** test_expand_func \ test_expr \ test_expr_utf8 \ - test_feedkeys \ test_file_perm \ test_file_size \ test_filechanged \ --- 125,130 ---- *************** *** 164,169 **** --- 163,169 ---- test_increment \ test_increment_dbcs \ test_indent \ + test_input \ test_ins_complete \ test_ins_complete_no_halt \ test_interrupt \ *************** *** 408,413 **** --- 408,414 ---- test_increment.res \ test_increment_dbcs.res \ test_indent.res \ + test_input.res \ test_ins_complete.res \ test_ins_complete_no_halt.res \ test_interrupt.res \ *** ../vim-9.0.0058/src/testdir/test_alot.vim 2022-04-09 13:25:14.000000000 +0100 --- src/testdir/test_alot.vim 2022-07-23 06:09:46.376901192 +0100 *************** *** 11,17 **** source test_expand.vim source test_expand_dllpath.vim source test_expand_func.vim - source test_feedkeys.vim source test_file_perm.vim source test_fnamemodify.vim source test_ga.vim --- 11,16 ---- *** ../vim-9.0.0058/src/testdir/test_feedkeys.vim 2022-05-02 22:44:31.000000000 +0100 --- src/testdir/test_feedkeys.vim 1970-01-01 00:00:00.000000000 +0000 *************** *** 1,37 **** - " Test feedkeys() function. - - func Test_feedkeys_x_with_empty_string() - new - call feedkeys("ifoo\") - call assert_equal('', getline('.')) - call feedkeys('', 'x') - call assert_equal('foo', getline('.')) - - " check it goes back to normal mode immediately. - call feedkeys('i', 'x') - call assert_equal('foo', getline('.')) - quit! - endfunc - - func Test_feedkeys_with_abbreviation() - new - inoreabbrev trigger value - call feedkeys("atrigger ", 'x') - call feedkeys("atrigger ", 'x') - call assert_equal('value value ', getline(1)) - bwipe! - iunabbrev trigger - endfunc - - func Test_feedkeys_escape_special() - nnoremap … let g:got_ellipsis += 1 - call feedkeys('…', 't') - call assert_equal('…', getcharstr()) - let g:got_ellipsis = 0 - call feedkeys('…', 'xt') - call assert_equal(1, g:got_ellipsis) - unlet g:got_ellipsis - nunmap … - endfunc - - " vim: shiftwidth=2 sts=2 expandtab --- 0 ---- *** ../vim-9.0.0058/src/testdir/test_input.vim 2022-07-23 06:24:37.917103110 +0100 --- src/testdir/test_input.vim 2022-07-23 06:13:39.336971345 +0100 *************** *** 0 **** --- 1,61 ---- + " Tests for character input and feedkeys() function. + + func Test_feedkeys_x_with_empty_string() + new + call feedkeys("ifoo\") + call assert_equal('', getline('.')) + call feedkeys('', 'x') + call assert_equal('foo', getline('.')) + + " check it goes back to normal mode immediately. + call feedkeys('i', 'x') + call assert_equal('foo', getline('.')) + quit! + endfunc + + func Test_feedkeys_with_abbreviation() + new + inoreabbrev trigger value + call feedkeys("atrigger ", 'x') + call feedkeys("atrigger ", 'x') + call assert_equal('value value ', getline(1)) + bwipe! + iunabbrev trigger + endfunc + + func Test_feedkeys_escape_special() + nnoremap … let g:got_ellipsis += 1 + call feedkeys('…', 't') + call assert_equal('…', getcharstr()) + let g:got_ellipsis = 0 + call feedkeys('…', 'xt') + call assert_equal(1, g:got_ellipsis) + unlet g:got_ellipsis + nunmap … + endfunc + + func Test_input_simplify_ctrl_at() + new + " feeding unsimplified CTRL-@ should still trigger i_CTRL-@ + call feedkeys("ifoo\A\<*C-@>x", 'xt') + call assert_equal('foofo', getline(1)) + bw! + endfunc + + func Test_input_simplify_noremap() + call feedkeys("i\<*C-M>", 'nx') + call assert_equal('', getline(1)) + call assert_equal([0, 2, 1, 0, 1], getcurpos()) + bw! + endfunc + + func Test_input_simplify_timedout() + inoremap a b + call feedkeys("i\<*C-M>", 'xt') + call assert_equal('', getline(1)) + call assert_equal([0, 2, 1, 0, 1], getcurpos()) + iunmap a + bw! + endfunc + + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-9.0.0058/src/testdir/test_options.vim 2022-06-29 18:39:05.015841419 +0100 --- src/testdir/test_options.vim 2022-07-23 06:05:18.476789522 +0100 *************** *** 65,71 **** --- 65,73 ---- let &pastetoggle = str call assert_equal(str, &pastetoggle) call assert_equal("\n pastetoggle=" .. strtrans(str), execute('set pastetoggle?')) + unlet str + set pastetoggle& endfunc func Test_wildchar() *************** *** 899,905 **** func Test_rightleftcmd() CheckFeature rightleft set rightleft - set rightleftcmd let g:l = [] func AddPos() --- 901,906 ---- *************** *** 908,913 **** --- 909,921 ---- endfunc cmap AddPos() + set rightleftcmd= + call feedkeys("/\abc\\\\\" .. + \ "\\\", 'xt') + call assert_equal([2, 5, 3, 4], g:l) + + let g:l = [] + set rightleftcmd=search call feedkeys("/\abc\\\\\" .. \ "\\\", 'xt') call assert_equal([&co - 1, &co - 4, &co - 2, &co - 3], g:l) *** ../vim-9.0.0058/src/testdir/test_statusline.vim 2022-05-09 21:01:53.000000000 +0100 --- src/testdir/test_statusline.vim 2022-07-23 06:21:41.645073720 +0100 *************** *** 7,12 **** --- 7,20 ---- source check.vim source screendump.vim + func SetUp() + set laststatus=2 + endfunc + + func TearDown() + set laststatus& + endfunc + func s:get_statusline() return ScreenLines(&lines - 1, &columns)[0] endfunc *************** *** 35,41 **** func Test_caught_error_in_statusline() let s:func_in_statusline_called = 0 - set laststatus=2 let statusline = '%{StatuslineWithCaughtError()}' let &statusline = statusline redrawstatus --- 43,48 ---- *************** *** 46,52 **** func Test_statusline_will_be_disabled_with_error() let s:func_in_statusline_called = 0 - set laststatus=2 let statusline = '%{StatuslineWithError()}' try let &statusline = statusline --- 53,58 ---- *************** *** 73,79 **** call assert_match('^ ((2) of 2)\s*$', s:get_statusline()) only - set laststatus=2 set splitbelow call setline(1, range(1, 10000)) --- 79,84 ---- *************** *** 432,438 **** %bw! call delete('Xstatusline') set statusline& - set laststatus& set splitbelow& endfunc --- 437,442 ---- *************** *** 518,524 **** " with a custom 'statusline' func Test_statusline_mbyte_fillchar() only - set laststatus=2 set fillchars=vert:\|,fold:-,stl:━,stlnc:═ set statusline=a%=b call assert_match('^a\+━\+b$', s:get_statusline()) --- 522,527 ---- *************** *** 526,532 **** call assert_match('^a\+━\+b━a\+═\+b$', s:get_statusline()) wincmd w call assert_match('^a\+═\+b═a\+━\+b$', s:get_statusline()) ! set statusline& fillchars& laststatus& %bw! endfunc --- 529,535 ---- call assert_match('^a\+━\+b━a\+═\+b$', s:get_statusline()) wincmd w call assert_match('^a\+═\+b═a\+━\+b$', s:get_statusline()) ! set statusline& fillchars& %bw! endfunc *** ../vim-9.0.0058/src/testdir/test_termcodes.vim 2022-04-28 14:01:05.000000000 +0100 --- src/testdir/test_termcodes.vim 2022-07-23 06:05:18.476789522 +0100 *************** *** 2437,2464 **** call assert_notequal(-1, index(output, 'builtin_dumb')) endfunc - func Test_simplify_ctrl_at() - " feeding unsimplified CTRL-@ should still trigger i_CTRL-@ - call feedkeys("ifoo\A\<*C-@>x", 'xt') - call assert_equal('foofo', getline(1)) - bw! - endfunc - - func Test_simplify_noremap() - call feedkeys("i\<*C-M>", 'nx') - call assert_equal('', getline(1)) - call assert_equal([0, 2, 1, 0, 1], getcurpos()) - bw! - endfunc - - func Test_simplify_timedout() - inoremap a b - call feedkeys("i\<*C-M>", 'xt') - call assert_equal('', getline(1)) - call assert_equal([0, 2, 1, 0, 1], getcurpos()) - iunmap a - bw! - endfunc - " vim: shiftwidth=2 sts=2 expandtab --- 2437,2441 ---- *** ../vim-9.0.0058/src/testdir/test_timers.vim 2022-07-01 19:11:20.385531915 +0100 --- src/testdir/test_timers.vim 2022-07-23 06:05:18.476789522 +0100 *************** *** 369,375 **** " Test that the garbage collector isn't triggered if a timer callback invokes " vgetc(). ! func Test_timer_nocatch_garbage_collect() " 'uptimetime. must be bigger than the timer timeout set ut=200 call test_garbagecollect_soon() --- 369,375 ---- " Test that the garbage collector isn't triggered if a timer callback invokes " vgetc(). ! func Test_nocatch_timer_garbage_collect() " 'uptimetime. must be bigger than the timer timeout set ut=200 call test_garbagecollect_soon() *** ../vim-9.0.0058/src/version.c 2022-07-23 05:04:07.580839529 +0100 --- src/version.c 2022-07-23 06:08:06.624864353 +0100 *************** *** 737,738 **** --- 737,740 ---- { /* Add new patch number below this line */ + /**/ + 59, /**/ -- hundred-and-one symptoms of being an internet addict: 98. The Alta Vista administrators ask you what sites are missing in their index files. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///