0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

169 Commits

Author SHA1 Message Date
D. Ben Knoble
c74a87eea2
runtime(helptoc): reload cached g:helptoc.shell_prompt when starting toc
Follow up on PR 10446 [1] so that changes at run-time (or after loading
a vimrc) are reflected at next use. Instead of "uncaching" the variable
by computing SHELL_PROMPT on each use, which could negatively impact
performance, reload any user settings before creating the TOC.

Also make sure, changes to the shell prompt variable do correctly
invalidate b:toc, so that the table of content is correctly re-created
after user makes any changes.

[1]: https://github.com/vim/vim/pull/10446#issuecomment-2485169333

closes: #16097

Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-12-01 16:06:18 +01:00
Ubaldo Tiberi
ae1c8b790b
patch 9.1.0878: termdebug: cannot enable DEBUG mode
Problem:  termdebug: cannot enable DEBUG mode
Solution: Allow to specify DEBUG mode (Ubaldo Tiberi)

closes: #16080

Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@volvo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-19 22:32:30 +01:00
Ella Moss
5e7f43b6ac
runtime(termdebug): allow to use decimal signs
closes: #16011

Co-authored-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Ella Moss <ella.moss@utah.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-09 11:32:15 +01:00
lagygoill
b3ec5643cd
runtime(doc): include a TOC Vim9 plugin
closes: #10446

See :h help-TOC

Signed-off-by: lagygoill <lacygoill@lacygoill.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-11-02 17:58:33 +01:00
Peter Wolf
8f1d09828a
patch 9.1.0817: termdebug: cannot evaluate expr in a popup
Problem:  termdebug: cannot evaluate expr in a popup
Solution: enhance termdebug plugin and allow to evaluate expressions in
          a popup window, add a unit test (Peter Wolf).

fixes: #15877
closes: #15933

Signed-off-by: Peter Wolf <pwolf2310@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-27 21:51:14 +01:00
Maxim Kim
f64bafd98a
runtime(comment): fix commment toggle with mixed tabs & spaces
- fix regression where toggling doesn't properly remove comment chars in
  files with tabs indents only.
- refactor toggling comments for mixed tabs & spaces sources

closes: #15861

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-13 19:20:53 +02:00
h-east
a4205471ad
runtime(misc): Use consistent "Vim script" spelling
References: https://groups.google.com/g/vim_dev/c/3Z5yM8KER2w/m/wAqws0QSEAAJ

closes: #15863

Signed-off-by: h-east <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-13 19:16:42 +02:00
Konfekt
7b27fc49a8
runtime(comment): consider &tabstop in lines after whitespace indent
The count `strlen()` in

```vim
line = printf(indent_start .. substitute(cms, '%s\@!', '%%', 'g'),
                       strpart(getline(lnum), strlen(indent_start)))
```

is too large if the block of lines to be operated on contains different
whitespace indenting (tab vs. spaces).

Considering using `2gcc` on the first line with 4 spaces as indenting
and on the next line using a single tab character (with &tabstop value
of 8):

Using `strlen(indent_start) = 4` for an initial indent of 4 spaces is
correct for the first line, but wrong for the next line and will
therefore wrongly comment out the tab-indented line (and possibly
deleting some content).

The new check is still too simple because it assumes that as soon as
there's a tab the whole indent is made of tabs; it's a start of entering
the mixed tab and whitespace indent rabbit hole.

fixes: #15797
closes: #15805

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-05 16:19:40 +02:00
Konfekt
e021f39b79
runtime(comment): commenting might be off by one column
getpos columns start at 1 and not 0 as do arrays

closes: #15774

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-10-01 20:02:15 +02:00
Konfekt
0fb25515cc
runtime(comment): fix syntax error
fixes: #15767
closes: #15770

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-09-30 19:30:34 +02:00
Konfekt
9142136161
runtime(comment): add gC mapping to (un)comment rest of line
fixes: #15727
closes: #15737

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-09-29 10:48:40 +02:00
Ubaldo Tiberi
bbeb38db4e
runtime(termdebug): Fix wrong test for balloon feature
fixes: #15359
closes: #15487

Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-08-14 14:41:02 +02:00
Maxim Kim
5753d99ff6
runtime(nohlsearch): add missing loaded_hlsearch guard
related: #15039
closes: #15402

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-31 22:07:43 +02:00
Christian Brabandt
2979cfc262
patch 9.1.0613: tests: termdebug test may fail and leave file around
Problem:  tests: termdebug test may fail and leave temp file around
          (Dominique Pellé)
Solution: only run balloon_show() if the function exists, validate
          termdebug is running using the g: termdebug_is_running var,
          use defer to delete temporary files

fixes: #15334

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-24 21:41:55 +02:00
Ubaldo Tiberi
a90b0b4ba2
patch 9.1.0607: termdebug: uses inconsistent style
Problem:  termdebug: uses inconsistent style
Solution: termdebug: deprecate numeric values for v:true/false,
          fix white space style in the plugin
          (Ubaldo Tiberi)

closes: #15304

Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-20 12:06:07 +02:00
zeertzjq
aef6179bcf
patch 9.1.0599: Termdebug: still get E1023 when specifying arguments
Problem:  Termdebug: still get E1023 when specifying arguments and using
          a prompt buffer.
Solution: Use empty() instead of len().  Add a test.  Fix wrong order of
          arguments to assert_equal() in Test_termdebug_basic().
          (zeertzjq)

closes: #15288

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-18 20:35:42 +02:00
Ubaldo Tiberi
2736cc725d
runtime(termdebug): gdb file/folder check is now performed only in CWD.
closes: #15268

Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-17 20:16:02 +02:00
Ubaldo Tiberi
27f53346a3
runtime(termdebug): quote filename arguments using double quotes
closes: #15270

Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-17 20:15:07 +02:00
Ubaldo Tiberi
c3837a46ff
runtime(termdebug): fix a few issues
Fix a few minor issues:
1. filename with whitespaces issue should be fixed now, fixes: #12357
2. ":Termdebug args" should work now, fixes: #15254

closes: #15261

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
2024-07-14 16:58:32 +02:00
Ubaldo Tiberi
e54fd3f7d8
runtime(termdebug): Add Deprecation warnings
closes: #15091

Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-07-04 17:14:03 +02:00
Ubaldo Tiberi
225d4d9212
runtime(termdebug): Refactored StartDebug_term and EndDebug functions
- Functions are way too long. Readability and maintainability should
be slightly improved.

- Some variables are re-assigned to their initial value at teardown.
This should not be needed since all internal variables are
re-initialized at startup of every Termdebug session.

closes: #15086

Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-23 17:25:05 +02:00
Yinzuo Jiang
549ecc8636
runtime(termdebug): Change some variables to Enums
Problem:  The types of some script variables in Termdebug
          can be changed for readability
Solution: Change the type of some vars from string to `enum`
          (Yinzuo Jiang)

closes: #15068

Signed-off-by: Yinzuo Jiang <jiangyinzuo@foxmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-22 16:28:19 +02:00
Ubaldo Tiberi
f7f8f0b76d
patch 9.1.0508: termdebug plugin can be further improved
Problem:  termdebug plugin can be further improved
Solution: add sanity-check, timeout config, change vars to bool
          update docs, add more tests (Ubaldo Tiberi)

fixes: #15061
closes: #15057

Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-20 22:24:26 +02:00
Ubaldo Tiberi
46f2823807
patch 9.1.0501: too complicated mapping restore in termdebug
Problem:  too complicated mapping restore in termdebug
Solution: simplify unmapping logic, add a few more tests
          (Ubaldo Tiberi)

closes: #15046

Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-19 19:50:32 +02:00
Maxim Kim
aeca7176f3
runtime(nohlsearch): simplify mapping
Use <cmd> instead of <expr> with execute(...)[-1]

closes: #15047

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-19 19:42:47 +02:00
Ubaldo Tiberi
a48637c105
patch 9.1.0497: termdebug can be further improved
Problem:  termdebug can be further improved
Solution: refactor save/restore, update docs,
          add a new save/restore test (Ubaldo Tiberi)

closes: #15032

Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-18 20:24:54 +02:00
Maxim Kim
26de90c631
runtime(nohlsearch): include the the simple nohlsearch package
fixes: #15039
closes: #15042

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-18 19:32:39 +02:00
shane.xb.qian
a5af73ae34
runtime(termdebug): properly check mapping variables using null_dict
closes: #15013

Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-16 16:44:53 +02:00
shane.xb.qian
f127dce188
runtime(termdebug): using wrong type for PlaceSign()
Make sure to convert them to numbers.

fixes: #14994
closes: #15015

Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-16 08:37:23 +02:00
Damien Riegel
17e702a51a
runtime(termdebug): make TermDebugSendCommand() a global function again
TermDebugSendCommand lost it's global visibility when converted to
vim9script. Restore it.

Fixes: 23f29ffc6427 ("runtime(termdebug): convert termdebug plugin to
       Vim9 script")
closes: #14997

Signed-off-by: Damien Riegel <damien@riegel.io>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-14 20:42:35 +02:00
Damien Riegel
fce324f557
runtime(termdebug): close all buffers in the same way
For ASM and Variables buffer, check were done to make sure they existed
before attempting to close them, but not for debugged program or gdb
communication. The debugged program window is a user-facing one and
user might close it manually, so it's better to check if it exists.

Signed-off-by: Damien Riegel <damien@riegel.io>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-14 20:41:36 +02:00
Ubaldo Tiberi
ef8eab86e2
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>
2024-06-13 19:23:07 +02:00
Yegappan Lakshmanan
83d0028026
runtime(termdebug): Use string interpolation instead of string concat
closes: #14972

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-12 20:37:05 +02:00
Yegappan Lakshmanan
971378eed9
runtime(termdebug): remove line-continuation characters
Those are no longer needed for Vim9.

related: #14961

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-11 19:17:36 +02:00
Ernie Rael
dfc21db0b0
runtime(termdebug): fix mousemodel restoration by comparing against null_string
closes: #14951

Signed-off-by: Ernie Rael <errael@raelity.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-10 18:12:07 +02:00
laburnumT
477402ecf9
runtime(termdebug): Fix saved_mousemodel check
Fix issue introduced by 23f29ffc64276dd790581f98b86a0a6435b7eb22 where
saved_mousemodel is introduced as a variable, so the exists check will
always be true.

Move to check the value of saved_mousemodel instead.

closes: #14946

Signed-off-by: laburnumT <laburnumtec@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-09 18:38:37 +02:00
Yegappan Lakshmanan
03a3df15ca
runtime(termdebug: Fix errors in using the latest termdebug.vim
closes: #14941

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-09 16:42:45 +02:00
Christian Brabandt
ae4641d68e
runtime(termdebug): Fix wrong email address
related: #14903

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-05 22:24:24 +02:00
Ubaldo Tiberi
23f29ffc64
runtime(termdebug): convert termdebug plugin to Vim9 script
closes: #14903

Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@volvo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-05 21:37:53 +02:00
Christian Brabandt
98fb81846d
runtime(comment): clarify the usage of 'commentstring' option value
fixes: #14905

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-06-04 20:59:08 +02:00
Christian Brabandt
f2d74e3b63
runtime(comment): add missing help tags file
fixes: #14829

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-23 07:24:29 +02:00
Ubaldo Tiberi
62ccaa60d5
runtime(termdebug): check for gdb file/dir before using as buffer name
Add test so that this doesn't regress.

fixes: #12718
closes: #14792

Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@volvo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-21 23:33:03 +02:00
Christian Brabandt
8cf29e4c4a
runtime(matchit): update matchit plugin to v1.20
fixes: #14814

Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-05-20 20:02:16 +02:00
Maxim Kim
5400a5d426
runtime(comment): include a simple comment toggling plugin
fixes #14626
closes: #14634

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-04-26 19:53:13 +02:00
Mihai Ciuraru
d3c0ff5d5a
runtime(termdebug): allow multibyte characters as breakpoint signs (#14274)
Allow multibyte characters as termdebug signs using slice() function

Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Mihai Ciuraru <mihai.ciuraru@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-24 09:11:06 +01:00
dundargoc
dc4c37b9d5
patch 9.1.0025: A few typos in tests and justify.vim
Problem:  A few typos in tests and justify.vim
Solution: fix them

closes: #13848

Signed-off-by: dundargoc <gocdundar@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-12 18:02:10 +01:00
iam28th
323dda1484
runtime(termdebug): add Tbreak command
closes: #13656

Signed-off-by: iam28th <artyom28th@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-12-14 20:33:43 +01:00
Shane-XB-Qian
2dd613f57b
runtime(termdebug): improve the breakpoint sign label (#13525)
// related #12589
// that should be the last chat (I) with Bram, r.i.p

Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-11-12 16:53:39 +01:00
shane.xb.qian
ca48202b6f
runtime(termdebug): improve window handling, shorten var types
closes #13474

Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-11-08 22:03:26 +01:00
shane.xb.qian
7fbbd7fdc6
runtime(termdebug): handle buffer-local mappings properly
closes: #13475

Signed-off-by: shane.xb.qian <shane.qian@foxmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-11-08 21:46:30 +01:00