summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-08-09 14:33:55 +0200
committerBram Moolenaar <Bram@vim.org>2020-08-09 14:33:55 +0200
commit3896a105eb3697b1a399255ac31c742c8840bd69 (patch)
tree6c01db70d33fdbd680389734dd19fc7a09027134 /src/testdir
parent94f6c06ac54401ea34a07f8c45242f11bd1e1e3a (diff)
downloadvim-git-3896a105eb3697b1a399255ac31c742c8840bd69.tar.gz
patch 8.2.1403: Vim9: Vim highlighting may fail in cmdline windowv8.2.1403
Problem: Vim9: Vim highlighting fails in cmdline window if it uses Vim9 commands. Solution: Allow using :vim9script, :import and :export while in the cmdline window. (closes #6656)
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_vim9_script.vim31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_script.vim b/src/testdir/test_vim9_script.vim
index 6c04316bc..2f7d5654d 100644
--- a/src/testdir/test_vim9_script.vim
+++ b/src/testdir/test_vim9_script.vim
@@ -3009,6 +3009,37 @@ def Test_vim9_autoload()
&rtp = save_rtp
enddef
+def Test_cmdline_win()
+ # if the Vim syntax highlighting uses Vim9 constructs they can be used from
+ # the command line window.
+ mkdir('rtp/syntax', 'p')
+ let export_lines =<< trim END
+ vim9script
+ export let That = 'yes'
+ END
+ writefile(export_lines, 'rtp/syntax/Xexport.vim')
+ let import_lines =<< trim END
+ vim9script
+ import That from './Xexport.vim'
+ END
+ writefile(import_lines, 'rtp/syntax/vim.vim')
+ let save_rtp = &rtp
+ &rtp = getcwd() .. '/rtp' .. ',' .. &rtp
+ syntax on
+ augroup CmdWin
+ autocmd CmdwinEnter * g:got_there = 'yes'
+ augroup END
+ # this will open and also close the cmdline window
+ feedkeys('q:', 'xt')
+ assert_equal('yes', g:got_there)
+
+ augroup CmdWin
+ au!
+ augroup END
+ &rtp = save_rtp
+ delete('rtp', 'rf')
+enddef
+
" Keep this last, it messes up highlighting.
def Test_substitute_cmd()
new