From ed65724e57d2af13cedc380ecfe4a495dae3afb7 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 14 Aug 2022 07:07:32 +0800 Subject: vim-patch:8.2.1653: expand('') does not include the final line number Problem: Expand('') does not include the final line number. Solution: Add the line nuber. (closes vim/vim#6927) https://github.com/vim/vim/commit/4f25b1aba050b85fa97ca2316aa04dd4b0b22530 --- src/nvim/testdir/test_expand_func.vim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_expand_func.vim b/src/nvim/testdir/test_expand_func.vim index 388620f87e..3094aad3a4 100644 --- a/src/nvim/testdir/test_expand_func.vim +++ b/src/nvim/testdir/test_expand_func.vim @@ -39,9 +39,9 @@ endfunc func Test_expand_sfile_and_stack() call assert_match('test_expand_func\.vim$', s:sfile) - let expected = 'script .*testdir/runtest.vim\[\d\+\]\.\.function RunTheTest\[\d\+\]\.\.Test_expand_sfile_and_stack$' - call assert_match(expected , expand('')) - call assert_match(expected , expand('')) + let expected = 'script .*testdir/runtest.vim\[\d\+\]\.\.function RunTheTest\[\d\+\]\.\.Test_expand_sfile_and_stack' + call assert_match(expected .. '$', expand('')) + call assert_match(expected .. '\[4\]' , expand('')) " Call in script-local function call assert_match('script .*testdir/runtest.vim\[\d\+\]\.\.function RunTheTest\[\d\+\]\.\.Test_expand_sfile_and_stack\[7\]\.\.\d\+_expand_sfile$', s:expand_sfile()) @@ -53,11 +53,12 @@ func Test_expand_sfile_and_stack() " Use from sourced script. let lines =<< trim END + " comment here let g:stack_value = expand('') END call writefile(lines, 'Xstack') source Xstack - call assert_match('\