0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.1.0238: 'buftype' is cleared when using ":term ++hidden cat"

Problem:    'buftype' is cleared when using ":term ++hidden cat". (Marcin
            Szamotulski)
Solution:   Set the "options initialized" flag earlier. (closes #3278)
This commit is contained in:
Bram Moolenaar
2018-08-04 16:54:11 +02:00
parent 87ea64ca96
commit 7da1fb5532
3 changed files with 20 additions and 0 deletions

View File

@@ -529,6 +529,8 @@ term_start(
set_string_option_direct((char_u *)"buftype", -1, set_string_option_direct((char_u *)"buftype", -1,
(char_u *)"terminal", OPT_FREE|OPT_LOCAL, 0); (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 /* Mark the buffer as not modifiable. It can only be made modifiable after
* the job finished. */ * the job finished. */

View File

@@ -1605,3 +1605,19 @@ func Test_zz2_terminal_guioptions_bang()
set guioptions& set guioptions&
call delete(filename) call delete(filename)
endfunc 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\<CR>")
call WaitForAssert({-> assert_match('asdf', term_getline(bnr, 2))})
call term_sendkeys(bnr, "\<C-D>")
call WaitForAssert({-> assert_equal('finished', term_getstatus(bnr))})
bwipe!
endfunc

View File

@@ -794,6 +794,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
238,
/**/ /**/
237, 237,
/**/ /**/