# Author: Bram Moolenaar
# Copyright: Vim license applies, see ":help license"
-# Last Change: 2025 Jul 08
+# Last Change: 2025 Aug 24
# Converted to Vim9: Ubaldo Tiberi <ubaldo.tiberi@gmail.com>
# WORK IN PROGRESS - The basics works stable, more to come
enddef
# Variables to keep their status among multiple instances of Termdebug
-# Avoid to source the script twice.
-if exists('g:termdebug_loaded')
- if DEBUG
- Echoerr('Termdebug already loaded.')
- endif
- finish
-endif
-g:termdebug_loaded = true
g:termdebug_is_running = false
unlet g:termdebug_config
endfunction
-function Test_termdebug_config_debug()
- let s:error_message = '\[termdebug\] Termdebug already loaded'
-
- " USER mode: No error message shall be displayed
- packadd termdebug
- call assert_true(execute('messages') !~ s:error_message)
-
- " DEBUG mode: Error message shall now be displayed
- let g:termdebug_config = {}
- let g:termdebug_config['debug'] = 1
- packadd termdebug
- call assert_true(execute('messages') =~ s:error_message)
-
- unlet g:termdebug_config
- unlet g:termdebug_loaded
- " Revert DEBUG mode, by reloading the plugin
- source $VIMRUNTIME/pack/dist/opt/termdebug/plugin/termdebug.vim
-endfunction
" vim: shiftwidth=2 sts=2 expandtab