diff options
author | Ubaldo Tiberi <ubaldo.tiberi@google.com> | 2024-06-18 20:18:20 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-06-18 20:24:54 +0200 |
commit | a48637c105ce5ccf6f3296958c889d15dc3faaa4 (patch) | |
tree | 20871867481477aab5e6c89617584ca4e049abad /src | |
parent | 9718ed7ab989c0a0be88a0d749f24321eb0e6af1 (diff) |
patch 9.1.0497: termdebug can be further improvedv9.1.0497
Problem: termdebug can be further improved
Solution: refactor save/restore, update docs,
add a new save/restore test (Ubaldo Tiberi)
closes: #15032
Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/testdir/test_termdebug.vim | 32 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 33 insertions, 1 deletions
diff --git a/src/testdir/test_termdebug.vim b/src/testdir/test_termdebug.vim index a9762df8a2..d3bf5f489c 100644 --- a/src/testdir/test_termdebug.vim +++ b/src/testdir/test_termdebug.vim @@ -297,6 +297,9 @@ func Test_termdebug_mapping() call assert_true(maparg('+', 'n', 0, 1).buffer) call assert_equal(':echom "bK"<cr>', maparg('K', 'n', 0, 1).rhs) + nunmap K + nunmap + + nunmap - %bw! endfunc @@ -339,14 +342,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 diff --git a/src/version.c b/src/version.c index 14a5922a99..8174104768 100644 --- a/src/version.c +++ b/src/version.c @@ -705,6 +705,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 497, +/**/ 496, /**/ 495, |