mirror of
https://github.com/neovim/neovim.git
synced 2026-06-15 16:23:48 +00:00
backport: fix(termdebug): fix evaluate display with gdb pretty print (#39475)
Calling `set print pretty on` in GDB will: > Cause GDB to print structures in an indented format with one member per line However, `termdebug` just renders the newlines as raw `\n` characters. This is a regression of[1]. Glancing through the history it looks to have been caused bycd1b14f027which removed the output splitting when displaying the eval results, so this changes adds that behaviour back. As a quick reproduction/test, compile the following C program: ```c struct Foo { char *name; }; int main(void) { struct Foo f = {"hello"}; printf("%s\n", f.name); return 0; } ``` Then launch `nvim` and run: :Termdebug main :Gdb (gdb) set print pretty on (gdb) break main (gdb) run :Source Place the cursor on the `f` variable and call `:Evaluate`. Before this change:  With this change:  Link: https://github.com/neovim/neovim/issues/10020 [1] (cherry picked from commitc06e3d6f81) Co-authored-by: Matthew Hughes <matthewhughes934@gmail.com>
This commit is contained in:
committed by
GitHub
parent
34bf0472ab
commit
24a4bf20c0
@@ -1487,7 +1487,7 @@ func s:HandleEvaluate(msg)
|
||||
" evaluation arrives in two separate messages, one for the address
|
||||
" itself and the other for the value in that address. So with the stock
|
||||
" focus option, the second message will focus the window containing the
|
||||
" first message.
|
||||
" first message.
|
||||
let s:eval_float_win_id = luaeval('select(2, vim.lsp.util.open_floating_preview(_A))', split(s:evalFromBalloonExprResult, '\\n'))
|
||||
else
|
||||
echomsg $'"{s:evalexpr}": {value}'
|
||||
|
||||
Reference in New Issue
Block a user