To: vim_dev@googlegroups.com Subject: Patch 8.2.4208 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4208 Problem: Using setbufvar() may change the window title. Solution: Do not redraw when creating the autocommand window. (closes #9613) Files: src/autocmd.c, src/testdir/test_functions.vim *** ../vim-8.2.4207/src/autocmd.c 2022-01-07 15:45:13.495500428 +0000 --- src/autocmd.c 2022-01-24 20:00:00.016600359 +0000 *************** *** 1518,1524 **** --- 1518,1527 ---- p_acd = FALSE; #endif + // no redrawing and don't set the window title + ++RedrawingDisabled; (void)win_split_ins(0, WSP_TOP, aucmd_win, 0); + --RedrawingDisabled; (void)win_comp_pos(); // recompute window positions p_ea = save_ea; #ifdef FEAT_AUTOCHDIR *** ../vim-8.2.4207/src/testdir/test_functions.vim 2021-12-19 18:33:17.321954811 +0000 --- src/testdir/test_functions.vim 2022-01-24 19:57:54.599277407 +0000 *************** *** 1630,1635 **** --- 1630,1657 ---- bwipe! endfunc + func Test_setbufvar_keep_window_title() + CheckRunVimInTerminal + + let lines =<< trim END + edit Xa.txt + let g:buf = bufadd('Xb.txt') + inoremap =setbufvar(g:buf, '&autoindent', 1) ?? '' + END + call writefile(lines, 'Xsetbufvar') + let buf = RunVimInTerminal('-S Xsetbufvar', {}) + call assert_match('Xa.txt', term_gettitle(buf)) + + call term_sendkeys(buf, "i\") + call TermWait(buf) + call term_sendkeys(buf, "\") + call TermWait(buf) + call assert_match('Xa.txt', term_gettitle(buf)) + + call StopVimInTerminal(buf) + call delete('Xsetbufvar') + endfunc + func Test_redo_in_nested_functions() nnoremap g. :set opfunc=Operatorg@ function Operator( type, ... ) *************** *** 2308,2314 **** func Test_state() CheckRunVimInTerminal - let g:test_is_flaky = 1 let getstate = ":echo 'state: ' .. g:state .. '; mode: ' .. g:mode\" --- 2330,2335 ---- *** ../vim-8.2.4207/src/version.c 2022-01-24 18:36:34.470382930 +0000 --- src/version.c 2022-01-24 19:42:41.073604629 +0000 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 4208, /**/ -- Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us. (Calvin) /// 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 ///