From 2b1bcd446b6d95f608161818addecf7c6a2beeaa Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 13 Jan 2018 19:59:05 +0100 Subject: runtime: include en.utf-8.spl Install en.utf-8.spl by default. - Allows spell-related tests to run. - Avoids download prompt for spelllang=en users --- src/nvim/testdir/shared.vim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/nvim/testdir/shared.vim') diff --git a/src/nvim/testdir/shared.vim b/src/nvim/testdir/shared.vim index 72cfea96c6..d8e2d1d718 100644 --- a/src/nvim/testdir/shared.vim +++ b/src/nvim/testdir/shared.vim @@ -1,5 +1,21 @@ " Functions shared by several tests. +" {Nvim} +" Filepath captured from output may be truncated, like this: +" /home/va...estdir/Xtest-tmpdir/nvimxbXN4i/10 +" Get last 2 segments, then combine with $TMPDIR. +func! Fix_truncated_tmpfile(fname) + " sanity check + if $TMPDIR ==# '' + throw '$TMPDIR is empty' + endif + if a:fname !~# $TMPDIR + throw '$TMPDIR not in fname: '.a:fname + endif + let last2segments = matchstr(a:fname, '[\/][^\/]\+[\/][^\/]\+$') + return $TMPDIR.last2segments +endfunc + " Get the name of the Python executable. " Also keeps it in s:python. func PythonProg() -- cgit