patch 8.1.0445: setting 'term' does not store location for termcap options
Problem: Setting 'term' does not store location for termcap options.
Solution: Set the script context for termcap options that are changed when
'term' is set.
diff --git a/src/testdir/test_options.vim b/src/testdir/test_options.vim
index f341682..851da1e 100644
--- a/src/testdir/test_options.vim
+++ b/src/testdir/test_options.vim
@@ -270,6 +270,18 @@
call assert_fails('set t_foo=', 'E846:')
endfunc
+" Must be executed before other tests that set 'term'.
+func Test_000_term_option_verbose()
+ let verb_cm = execute('verbose set t_cm')
+ call assert_notmatch('Last set from', verb_cm)
+
+ let term_save = &term
+ set term=ansi
+ let verb_cm = execute('verbose set t_cm')
+ call assert_match('Last set from.*test_options.vim', verb_cm)
+ let &term = term_save
+endfunc
+
func Test_set_ttytype()
if !has('gui_running') && has('unix')
" Setting 'ttytype' used to cause a double-free when exiting vim and