Comments (8)
Hm, I think this patch should do it, no?
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
index d00cdded2..8f2e331ef 100644
--- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
+++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim
@@ -248,11 +248,13 @@ enddef
# Get the command to execute the debugger as a list, defaults to ["gdb"].
def GetCommand(): list<string>
- var cmd = 'gdb'
+ var cmd: any
if exists('g:termdebug_config')
cmd = get(g:termdebug_config, 'command', 'gdb')
elseif exists('g:termdebugger')
cmd = g:termdebugger
+ else
+ cmd = 'gdb'
endif
return type(cmd) == v:t_list ? copy(cmd) : [cmd]
@ubaldot please :)
from vim.
Only loosely related. I wonder if it's work copying all plain config globals, like
if exists('g:termdebugger')
g:termdebug_config.command = g:termdebugger
endif
during startup, and then only use g:termdebug_config
in the mainline code.
from vim.
Just wrote a quick fix for myself, I have not tested what happens if g:termdebug_config is set though.
# Get the command to execute the debugger as a list, defaults to ["gdb"].
def GetCommand(): list<string>
var cmd = ['gdb']
if exists('g:termdebug_config')
cmd = get(g:termdebug_config, 'command', ['gdb'])
elseif exists('g:termdebugger')
cmd = g:termdebugger
endif
return type(cmd) == v:t_list ? copy(cmd) : [cmd]
enddef
from vim.
Hm, I think this patch should do it, no?
diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index d00cdded2..8f2e331ef 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -248,11 +248,13 @@ enddef # Get the command to execute the debugger as a list, defaults to ["gdb"]. def GetCommand(): list<string> - var cmd = 'gdb' + var cmd: any if exists('g:termdebug_config') cmd = get(g:termdebug_config, 'command', 'gdb') elseif exists('g:termdebugger') cmd = g:termdebugger + else + cmd = 'gdb' endif return type(cmd) == v:t_list ? copy(cmd) : [cmd]@ubaldot please :)
Thanks, I am going to add it in #15057 (review)
from vim.
Only loosely related. I wonder if it's work copying all plain config globals, like
if exists('g:termdebugger') g:termdebug_config.command = g:termdebugger endifduring startup, and then only use
g:termdebug_config
in the mainline code.
This is indeed very elegant, I personally like it. :)
TBH 100% honest, I would add a deprecation warning saying that configuring variables of the form g:termdebugger
will be ditched at some point in the future, inviting the user to read the :h termdebug
to get guidance on how to update their configurations. That would clean up the code. But I don't know if this is inline with Vim vision. :)
from vim.
TBH 100% honest, I would add a deprecation warning saying that configuring variables of the form
g:termdebugger
will be ditched at some point in the future, inviting the user to read the:h termdebug
to get guidance on how to update their configurations. That would clean up the code. But I don't know if this is inline with Vim vision. :)
I'm in enough trouble without commenting on this. ;)
from vim.
But I don't know if this is inline with Vim vision. :)
We don't usually do this. But we can try it out in a plugin and see how people react 🙈. It's not something I'd recommend for core Vim, but for a plugin it should be fine. We should still support the deprecated version for half a year at least.
from vim.
But I don't know if this is inline with Vim vision. :)
We don't usually do this. But we can try it out in a plugin and see how people react 🙈. It's not something I'd recommend for core Vim, but for a plugin it should be fine. We should still support the deprecated version for half a year at least.
I was actually thinking exactly the same thing: for the core I am pretty sure it is a no-no, but perhaps for a plugin it may be allowed. I was also thinking exactly the same: 6-12 months as time window for keeping the deprecation warning before deprecating some feature/setting/whatever.
We may try with termdebug for like six months and see how many people will complain. We won't remove anything, just display a warning message. The sanity-check function looks like a good place to add such a warning. I may work on it during next week.
Loosely related: it would be great if we manage to separate the "frontend" and the "backend" of termdebug but it may be hard and time consuming. At the moment as "backend" we only have gdb, but it would be nice to be able to use also other debuggers (lldb, debugpy, etc.) or implement DAP. Well, food for thoughts...
from vim.
Related Issues (20)
- mousemodel=popup not working properly with many items on PopUp menu
- manpager.vim emits a "Changing a readonly file" error/warning
- foldexpr '<1' results in a level-3 fold HOT 2
- Clarification on expected behavior of <S-CR>
- A correction to the docs
- Clipboard and primary selection registers not working despite +clipboard HOT 7
- incsearch option to highlight matches without moving the cursor HOT 4
- xxd color output is inefficient
- vimscript wrong indentation
- Sudo vi/vim read-only files can be edited and forcibly saved! How to disable forced savings. HOT 4
- [vim9class] incorrect `string()` of funcref of object's function
- "Whole words" mode for fuzzy-searching for more than one word HOT 1
- [vim9script] unexpected behavior accessing `export const` variable from same file HOT 2
- Make listchars extends/precedes, fillchars lastline, and "<<<" consistent HOT 6
- I want to insert some titles when I create a new .v file, so I created a new function, and I want to set some autocmd commands to achieve this function, but the same au command works fine when written in ~/.vimr, but does not work in ~/.vim/pack/xxx/start/xxx/ftplugin/verilog.vim. Why is that?
- [vim9script] imports sourced in wrong order HOT 4
- .css file extensions add extra asterisks (*) when not supposed to HOT 1
- `g:markdown_md` variable has no effect HOT 2
- syn-iskeyword should not be global HOT 1
- <C-b> does not overlap two lines when starting from all the way at the bottom of the buffer HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim.