runtime(syntax-tests): Adapt "runtime/syntax/testdir/vimcmd" for 
"src/testdir/util/shared.vim"

Commit: 
https://github.com/vim/vim/commit/5516fc534ea03ba4ee42da2cc14e76d9d26151bc
Author: Aliaksei Budavei <[email protected]>
Date:   Fri Jan 9 17:19:18 2026 +0000

    runtime(syntax-tests): Adapt "runtime/syntax/testdir/vimcmd" for 
"src/testdir/util/shared.vim"
    
    Problem:  When "util/shared.vim" is sourced and GetVimCommand is called on
              behalf of the syntax test runner, the "vimcmd" file will be 
searched
              in the current working directory, i.e. "src/testdir", whereas the
              desired file is in "runtime/syntax/testdir".
    Solution: Temporarily copy "vimcmd" between test directories.
    
    closes: #19127
    
    Signed-off-by: Aliaksei Budavei <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/runtime/syntax/testdir/runtest.vim 
b/runtime/syntax/testdir/runtest.vim
index 6dce6508a..9392a4667 100644
--- a/runtime/syntax/testdir/runtest.vim
+++ b/runtime/syntax/testdir/runtest.vim
@@ -69,6 +69,16 @@ endif
 " Use the script for source code screendump testing.  It sources other scripts,
 " therefore we must "cd" there.
 cd ../../src/testdir
+
+let s:vimcmdSyntaxFname = fnameescape(syntaxDir .. '/testdir/vimcmd')
+
+" Adapt "runtime/syntax/testdir/vimcmd" for "src/testdir/util/shared.vim".
+if filereadable(s:vimcmdSyntaxFname)
+  call delete('vimcmd')
+  call filecopy(s:vimcmdSyntaxFname, 'vimcmd')
+  exe 'au ExitPre <buffer> call delete("' .. fnameescape(getcwd() .. 
'/vimcmd') .. '")'
+endif
+
 source util/screendump.vim
 source util/term_util.vim
 exe 'cd ' .. fnameescape(syntaxDir)

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1veGJH-004cFM-Mm%40256bit.org.

Raspunde prin e-mail lui