diff options
author | Yinzuo Jiang <jiangyinzuo@foxmail.com> | 2024-06-19 21:23:21 +0800 |
---|---|---|
committer | Yinzuo Jiang <jiangyinzuo@foxmail.com> | 2024-06-19 21:23:21 +0800 |
commit | b48192af37aa39d55e73420e3838cb63f471da99 (patch) | |
tree | 595daf1f13f004e7a9eec6c1533b36b423d02264 /test | |
parent | fe5d1279a4378582898e2e281fe5778d81c30017 (diff) | |
download | rneovim-b48192af37aa39d55e73420e3838cb63f471da99.tar.gz rneovim-b48192af37aa39d55e73420e3838cb63f471da99.tar.bz2 rneovim-b48192af37aa39d55e73420e3838cb63f471da99.zip |
vim-patch:partial:9.1.0497: termdebug can be further improved
Problem: termdebug can be further improved
Solution: refactor save/restore, update docs,
add a new save/restore test (Ubaldo Tiberi)
closes: vim/vim#15032
https://github.com/vim/vim/commit/a48637c105ce5ccf6f3296958c889d15dc3faaa4
Co-authored-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/old/testdir/test_termdebug.vim | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/test/old/testdir/test_termdebug.vim b/test/old/testdir/test_termdebug.vim index 38278cb326..c84478fefa 100644 --- a/test/old/testdir/test_termdebug.vim +++ b/test/old/testdir/test_termdebug.vim @@ -341,14 +341,41 @@ func Test_termdebug_bufnames() endfunc function Test_termdebug_save_restore_variables() + " saved mousemodel let &mousemodel='' + + " saved keys + nnoremap K :echo "hello world!"<cr> + let expected_map_K = maparg('K', 'n', 0 , 1) + nnoremap + :echo "hello plus!"<cr> + let expected_map_plus = maparg('+', 'n', 0 , 1) + let expected_map_minus = {} + + " saved &columns + let expected_columns = &columns + + " We want termdebug to overwrite 'K' map but not '+' map. + let g:termdebug_config = {} + let g:termdebug_config['map_K'] = 1 + Termdebug call WaitForAssert({-> assert_equal(3, winnr('$'))}) call WaitForAssert({-> assert_match(&mousemodel, 'popup_setpos')}) wincmd t quit! call WaitForAssert({-> assert_equal(1, winnr('$'))}) - call WaitForAssert({-> assert_true(empty(&mousemodel))}) + + call assert_true(empty(&mousemodel)) + + call assert_true(empty(expected_map_minus)) + call assert_equal(expected_map_K.rhs, maparg('K', 'n', 0, 1).rhs) + call assert_equal(expected_map_plus.rhs, maparg('+', 'n', 0, 1).rhs) + + call assert_equal(expected_columns, &columns) + + nunmap K + nunmap + + unlet g:termdebug_config endfunction |