]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.1.0482: termdebug plugin needs more love v9.1.0482
authorUbaldo Tiberi <ubaldo.tiberi@volvo.com>
Thu, 13 Jun 2024 17:23:07 +0000 (19:23 +0200)
committerChristian Brabandt <cb@256bit.org>
Thu, 13 Jun 2024 17:23:07 +0000 (19:23 +0200)
commitef8eab86e29091eaff0d3fb0bc3f7c90f468f6aa
treedc415a61aa6be82a9ca97ed7b17db1836a568f1d
parent1a946044fe3993bc87c36960d38ad2934df9c649
patch 9.1.0482: termdebug plugin needs more love

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>
runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
src/testdir/test_termdebug.vim
src/version.c