#ifdef FEAT_EVAL
// Set flag that any command was executed, used by ex_vim9script().
- if (getline_equal(ea.getline, ea.cookie, getsourceline))
+ if (getline_equal(ea.getline, ea.cookie, getsourceline)
+ && current_sctx.sc_sid > 0)
SCRIPT_ITEM(current_sctx.sc_sid)->sn_had_command = TRUE;
/*
" Test the :compiler command
source check.vim
+source shared.vim
func Test_compiler()
if !executable('perl')
call assert_match(runtime .. '/compiler/xmlwf.vim$', a[-1])
endfunc
+" Test executing :compiler from the command line, not from a script
+func Test_compiler_commandline()
+ call system(GetVimCommandClean() .. ' --not-a-term -c "compiler gcc" -c "call writefile([b:current_compiler], ''XcompilerOut'')" -c "quit"')
+ call assert_equal(0, v:shell_error)
+ call assert_equal(["gcc"], readfile('XcompilerOut'))
+
+ call delete('XcompilerOut')
+endfunc
+
func Test_compiler_completion()
call feedkeys(":compiler \<C-A>\<C-B>\"\<CR>", 'tx')
call assert_match('^"compiler ant bcc .* xmlwf$', @:)