runtime(termdebug): allow multibyte characters as breakpoint signs (vim/vim#14274)
Allow multibyte characters as termdebug signs using slice() function
d3c0ff5d5a
Co-authored-by: Mihai Ciuraru <mihai.ciuraru@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Problem:
- The :Evaluate result window is not cleaned up when the cursor moves.
- This window is not focusable.
Solution:
Replace the old implementation from autozimu/LanguageClient-neovim with
vim.lsp.util.open_floating_preview and implement custom focusing logic.
Also remove g:termdebug_useFloatingHover option now that it's working
correctly.
runtime(termdebug): improve the breakpoint sign label (vim/vim#13525)
// related vim/vim#12589
// that should be the last chat (I) with Bram, r.i.p
2dd613f57b
Co-authored-by: Shane-XB-Qian <shane.qian@foxmail.com>
Problem: It is not easy to restore saved mappings.
Solution: Make mapset() accept a dict argument. (Ernie Rael, closesvim/vim#10295)
51d04d16f2
Co-authored-by: Ernie Rael <errael@raelity.com>
runtime(termdebug): more termdebug fixes and improvements (vim/vim#12892)
- Fix and attempt to simplify :Frame/:Up/:Down documentation.
- Accept a count instead for :Up/:Down/+/-.
- Update the "Last Change" dates.
- Fix a missing :let (caused an error if gdb fails to start).
- Wipe the prompt buffer when ending prompt mode (if it exists and wasn't wiped
by the user first). Avoids issues with stale prompt buffers (such as E95 when
starting a new prompt mode session).
- Kill the gdb job if the prompt buffer is unloaded (similar to what's done for
a terminal buffer). Fixes not being able to start a new termdebug session if
the buffer was wiped by the user, for example.
3d3a9152fa
runtime(termdebug): add frame related commands (vim/vim#12511)
implementing `:Frame`, `:Up` and `:Down'
2ae7ffe0bc
Use maparg() for saving K as it's since been ported (and supports Lua callbacks
and the other API fields).
Use the 3 argument variant of mapset(), as the single argument one isn't ported
yet (v8.2.4861).
Co-authored-by: Simon Sobisch <simonsobisch@web.de>
Unlike Vim's job_stop(), Nvim's jobstop() does not take a signal argument, and
always sends SIGTERM/KILL.
:Stop and Ctrl-C in prompt mode is supposed to interrupt the program like in
terminal mode, not kill GDB.
Also, maybe libuv's kill() works on Windows? If so, the logic above could be
removed, but I don't have a Windows machine available to test that.
Also "set nomodified" when ending prompt mode, like Vim (avoids E37).
runtime(termdebug): Fix various Termdebug issues (vim/vim#12875)
* Fix some Termdebug issues after vim/vim#12403
* Fix :Asm in Termdebug prompt mode
* Fix Termdebug s:DecodeMessage escaping logic
a76f3221cd
Adjust disassembly message forwarding for Nvim, as its callback can receive
many lines at once.
Currently, just forward each disassembly line individually to s:CommOutput();
it's possible to do this in batch instead, but this is simpler.
I suggested moving to a GDB MI-based approach for the disassemble stuff
upstream, which should simplify the logic a lot if implemented (and possibly
allow for getting rid of the `&"disassemble ...` special-casing).
Also, correct "(gdb)" to include a trailing space; the stray GDB prompts were
being ignored by s:CommOutput() anyway, so this had caused no ill effects.
Vim splits lines on "\r", then trims any prefixed "\n".
But in Nvim, job output lines are split on "\n" (like readfile() in binary
mode), so trim any suffixed "\r" instead.
This gets rid of the trailing "^M" character in messages parsed from the jobs.
runtime(termdebug): refactor error printing (vim/vim#12856)
// vs not act like exception from vim or termdebug
f6fb52b667
Co-authored-by: Shane-XB-Qian <shane.qian@foxmail.com>
Runtime(termdebug): Add support to view local and argument variables
closes: 12403
9f29621415
Rename the existing "s:running" (#16790) to "s:gdb_running" to not clash with
the "s:running" introduced in this patch (which instead relates to whether the
debugged program is currently running in gdb).
Keep the file `:retab`bed as before.
Co-authored-by: laburnumT <flo.striker@gmail.com>
Problem: Termdebug: error with more than 99 breakpoints.
Solution: Use a different sign for breakpoint 100 and over. (closesvim/vim#12589,
closesvim/vim#12588)
e7d9ca2b3b
Co-authored-by: skywind3000 <skywind3000@163.com>
Problem: Termdebug on MS-Windows: some file names are not recognized.
Solution: Do not always change \t and \n. (Christian Brabandt,
closesvim/vim#12565, closesvim/vim#12560, closesvim/vim#12550)
c9a4a8ab28
Co-authored-by: Christian Brabandt <cb@256bit.org>
Vimball is an outdated feature that is rarely used these days. It is not
a maintenance burden on its own, but it is nonetheless dead weight and
something we'd need to tell users to ignore when they inevitably ask
what it is.
See: https://github.com/neovim/neovim/pull/21369#issuecomment-1347615173
Problem:
Job callbacks in termdebug cannot handle partial lines.
Solution:
Add a wrapper function that handles partial lines and only passes full
lines to the real callback.
Fix#22929.
vim-patch:9.0.0341: mapset() does not restore <Nop> mapping properly
Problem: mapset() does not restore <Nop> mapping properly.
Solution: Use an empty string for <Nop>. (closesvim/vim#11022)
92a3d20682
Problem: The terminal debugger can't set a breakpoint with the mouse.
Solution: Add popup menu entries.
71137fed4d
This ports missing popup menu code to termdebug plugin.
Despite the commit message, the code is copied from latest Vim.
WinBar code is commented out and WinBar docs is not ported.
Problem: The terminal debugger uses various global variables.
Solution: Add a dictionary to hold the terminal debugger preferences.
c9a431c763
Omit popup menu.
s:EndTermDebug should only be called when exiting if the debugger started
without error, otherwise the plugin breaks.
Vim handles this by using job_setoptions to set the on_exit callback to
s:EndTermDebug after startup succeeds. However, Nvim does not have such
functionality; instead; use s:starting to mimic this behaviour.
Also, introduce s:running to fix s:CheckGdbRunning; it did not work correctly
due to the "[Process exited X]" message keeping the job's channel alive (though
the stream is closed). This means nvim_get_chan_info cannot be used to check if
the debugger has exited, as it may still return a non-empty dict.