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)
diff --git a/src/terminal.c b/src/terminal.c
index 22b90c8..427e027 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -529,6 +529,8 @@
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. */