To: vim_dev@googlegroups.com Subject: Patch 8.1.0238 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.0238 Problem: 'buftype' is cleared when using ":term ++hidden cat". (Marcin Szamotulski) Solution: Set the "options initialized" flag earlier. (closes #3278) Files: src/terminal.c, src/testdir/test_terminal.vim *** ../vim-8.1.0237/src/terminal.c 2018-07-08 20:49:03.427359658 +0200 --- src/terminal.c 2018-08-04 16:52:59.228476711 +0200 *************** *** 529,534 **** --- 529,536 ---- set_string_option_direct((char_u *)"buftype", -1, (char_u *)"terminal", OPT_FREE|OPT_LOCAL, 0); + // Avoid that 'buftype' is reset when this buffer is entered. + curbuf->b_p_initialized = TRUE; /* Mark the buffer as not modifiable. It can only be made modifiable after * the job finished. */ *** ../vim-8.1.0237/src/testdir/test_terminal.vim 2018-07-08 20:49:03.427359658 +0200 --- src/testdir/test_terminal.vim 2018-08-04 16:51:08.821245793 +0200 *************** *** 1605,1607 **** --- 1605,1623 ---- set guioptions& call delete(filename) endfunc + + func Test_terminal_hidden() + if !has('unix') + return + endif + term ++hidden cat + let bnr = bufnr('$') + call assert_equal('terminal', getbufvar(bnr, '&buftype')) + exe 'sbuf ' . bnr + call assert_equal('terminal', &buftype) + call term_sendkeys(bnr, "asdf\") + call WaitForAssert({-> assert_match('asdf', term_getline(bnr, 2))}) + call term_sendkeys(bnr, "\") + call WaitForAssert({-> assert_equal('finished', term_getstatus(bnr))}) + bwipe! + endfunc *** ../vim-8.1.0237/src/version.c 2018-08-04 15:13:31.034718130 +0200 --- src/version.c 2018-08-04 16:53:18.336344327 +0200 *************** *** 796,797 **** --- 796,799 ---- { /* Add new patch number below this line */ + /**/ + 238, /**/ -- -rwxr-xr-x 1 root 24 Oct 29 1929 /bin/ed -rwxr-xr-t 4 root 131720 Jan 1 1970 /usr/ucb/vi -rwxr-xr-x 1 root 5.89824e37 Oct 22 1990 /usr/bin/emacs /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///