From b4aea3d1c8db13970f4c2743d20c2df989db6ac0 Mon Sep 17 00:00:00 2001 From: "Andy K. Massimino" Date: Mon, 29 Mar 2021 19:39:28 -0400 Subject: vim-patch:8.2.2612: col('.') may get outdated column value Problem: col('.') may get outdated column value. Solution: Add a note to the help how to make this work and add a test for it. (closes vim/vim#7971) https://github.com/vim/vim/commit/18b7d86d7fa997bbb02a069dafacb32a0f73ca1e --- src/nvim/testdir/test_mapping.vim | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src') diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim index c4807797ff..48b207e392 100644 --- a/src/nvim/testdir/test_mapping.vim +++ b/src/nvim/testdir/test_mapping.vim @@ -427,6 +427,30 @@ func Test_error_in_map_expr() exe buf .. 'bwipe!' endfunc +func Test_expr_map_gets_cursor() + new + call setline(1, ['one', 'some w!rd']) + func StoreColumn() + let g:exprLine = line('.') + let g:exprCol = col('.') + return 'x' + endfunc + nnoremap x StoreColumn() + 2 + nmap ! f!x + call feedkeys("!", 'xt') + call assert_equal('some wrd', getline(2)) + call assert_equal(2, g:exprLine) + call assert_equal(7, g:exprCol) + + bwipe! + unlet g:exprLine + unlet g:exprCol + delfunc ExprMapped + nunmap x + nunmap ! +endfunc + " Test for mapping errors func Test_map_error() call assert_fails('unmap', 'E474:') -- cgit From 756f55959986eaa0de07a46e30512d7031766252 Mon Sep 17 00:00:00 2001 From: "Andy K. Massimino" Date: Mon, 29 Mar 2021 19:46:21 -0400 Subject: vim-patch:8.2.2613: new test throws exception Problem: New test throws exception. Solution: Adjust the function cleanup. https://github.com/vim/vim/commit/6ccfd99b923cc3452a6e6450dfdd7e31ea602dfd --- src/nvim/testdir/test_mapping.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/testdir/test_mapping.vim b/src/nvim/testdir/test_mapping.vim index 48b207e392..0191dbf33e 100644 --- a/src/nvim/testdir/test_mapping.vim +++ b/src/nvim/testdir/test_mapping.vim @@ -446,7 +446,7 @@ func Test_expr_map_gets_cursor() bwipe! unlet g:exprLine unlet g:exprCol - delfunc ExprMapped + delfunc StoreColumn nunmap x nunmap ! endfunc -- cgit