summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUbaldo Tiberi <ubaldo.tiberi@volvo.com>2024-06-13 19:23:07 +0200
committerChristian Brabandt <cb@256bit.org>2024-06-13 19:23:07 +0200
commitef8eab86e29091eaff0d3fb0bc3f7c90f468f6aa (patch)
treedc415a61aa6be82a9ca97ed7b17db1836a568f1d /src
parent1a946044fe3993bc87c36960d38ad2934df9c649 (diff)
patch 9.1.0482: termdebug plugin needs more lovev9.1.0482
Problem: termdebug plugin needs more love Solution: start with some more Vim9 refactoring to improve maintenance and readability (Ubaldo Tiberi) List of Changes and the Reasoning Behind Them: 1) Introduction of InitScriptVariables() Function: Reasoning: This function has been introduced to ensure that when you open and close Termdebug, and then open it again, there are no leftover script variable values from the previous session. Leftover values could potentially cause issues. The goal is for each Termdebug session to be independent of previous sessions. At startup, all script variables are initialized. The only exception is g:termdebug_loaded located at the very beginning of the script to prevent sourcing the script twice. The variables are declared at script level and defined in InitScriptVariables(). 2) More Descriptive Variable Names: Reasoning: The names of variables have been made more comprehensive. Almost every Termdebug buffer now has a variable to indicate its name and another variable to indicate its number, improving code readability and maintainability. Due to the latest discussion around the &mousemodel option save/restore mechanism, perhaps some other variables shall be prepended with saved_. 3) Consistent Naming for GDB Terminal Buffers: Reasoning: The name of the GDB terminal buffer now matches the name of the GDB program being used, e.g., 'gdb', 'mygdb', 'arm-eabi-none-gdb', etc. This ensures clarity and consistency in identifying buffers. 4) Other minor improvements: Moved EchoErr() on top, added another test, some refactoring, mainly changed several 0 and 1 to true and false closes: #14980 Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@volvo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src')
-rw-r--r--src/testdir/test_termdebug.vim11
-rw-r--r--src/version.c2
2 files changed, 13 insertions, 0 deletions
diff --git a/src/testdir/test_termdebug.vim b/src/testdir/test_termdebug.vim
index 62cafccb69..a9762df8a2 100644
--- a/src/testdir/test_termdebug.vim
+++ b/src/testdir/test_termdebug.vim
@@ -338,5 +338,16 @@ func Test_termdebug_bufnames()
unlet g:termdebug_config
endfunc
+function Test_termdebug_save_restore_variables()
+ let &mousemodel=''
+ 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))})
+endfunction
+
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/src/version.c b/src/version.c
index 1360d1cfc3..43a09d308b 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 */
/**/
+ 482,
+/**/
481,
/**/
480,