207 Commits

Author SHA1 Message Date
ea528a9482 patch 9.1.1537: helptoc: still some issues when markdown code blocks
Problem:  helptoc: still some issues when parsing markdown code blocks
          (VimWei)
Solution: assign nextline to curline before starting the next loop
          iteration; when processing fenced code blocks, flip the
          skip_fence variable, update the test to be more comprehensive

related: https://github.com/vim/vim/issues/17699#issuecomment-3055603968
closes: #17716

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-10 20:44:51 +02:00
6715b3510e patch 9.1.1533: helptoc: does not handle code sections in markdown well
Problem:  helptoc: does not handle code sections in markdown well
          (VimWei)
Solution: Skip over fenced code sections (lacygoill), add a test.

fixes: #17699
closes: #17710

Co-authored-by: lagygoill <lacygoill@lacygoill.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-09 20:26:07 +02:00
c4bca1de0b patch 9.1.1532: termdebug: not enough ways to configure breakpoints
Problem:  termdebug: not enough ways to configure breakpoints
Solution: add the termdebug_config['signs'] config setting, rework the
          termdebug test cases (Dimitry Ishenko)

Allow to configure custom breakpoint signs so one can do something like
this:

```vim
let g:termdebug_config['signs'] = ['>1', '>2', '>3', '>4', '>5', '>6', '>7', '>8', '>9']
let g:termdebug_config['sign'] = '>>'
```

where the first 9 breakpoints will have their own signs and the rest
will be the same (>>).

While at it, rework the test for the termdebug plugin:

- Added test for g:termdebug_config['signs'].
- Added test for g:termdebug_config['sign'].
- Moved test for g:termdebug_config['sign_decimal'] into
  Test_termdebug_basic()

closes: #17694

Signed-off-by: Dimitry Ishenko <dimitry.ishenko@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-08 23:13:14 +02:00
b3eaae21b9 runtime(netrw): restore blank line cleanup after file listing
Problem:  v182 refactoring removed blank line cleanup (g/^$/d) from
          s:LocalListing(), causing empty lines between directories
          and files.
Solution: Add the missing cleanup after append() in s:PerformListing()
          (uma-chan).

closes: #17672

Co-authored-by: Luca Saccarola <96259932+saccarosium@users.noreply.github.com>
Signed-off-by: uma-chan <127664533+i9wa4@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-07-07 22:04:11 +02:00
ba479348d4 runtime(netrw): upstream snapshot of v183
relevant commits:
- distribution: remove NetrwSettings.vim

closes: #17635

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-30 20:26:03 +02:00
ef925556cb runtime(netrw): upstream snapshot of v182
relevant commits:
- refactor: cleanup netrw#BrowseX
- fix: correctly handle symlinks in treeview
- chore: add minimalrc for reproducing issues
- refactor: simplify s:NetrwInit with the 'newer' assignment syntax
- refactor: remove balloon functionality
- Tune local file listing especially for Windows network drives
- interim fix for browse open with multiple windows

closes: #17616

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-27 18:28:17 +02:00
2249cc0a47 runtime(netrw): remove the fun from netrw :)
closes: #17584

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-25 21:23:43 +02:00
1cbe3e89c9 runtime(comment): add <Plug>-mappings
vim9script <expr> mappings relying on imports cannot be evaluated
outside of the script file with the imports, so do not work with plugins
like vim-which-key, which evaluates <expr> mappings to apply them.

Using <Plug> mappings is one way to address this, and has the added
benefit of reading like a description for users finding the mappings.

fixes: #17523
closes: #17563

Signed-off-by: Mark Woods <mwoods.online.ie@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-22 20:20:34 +02:00
7e47c1e735 runtime(netrw): remove g:netrw_quiet and reindent to 4 spaces
closes: #17539

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-15 15:26:44 +02:00
aef2e53cf8 runtime(comment): handle special chars ^$[ robustly
Make sure comment toggling works when 'commentstring' contains
any of the following regex special characters by escaping them:

^ $ [

closes: #17537

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-13 20:18:50 +02:00
f5e3b5c04f runtime(netrw): refactor netrw#ErrorMsg -> netrw#msg#Notify
closes: #17526

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-12 21:51:42 +02:00
532a5fb131 patch 9.1.1456: comment plugin fails toggling if 'cms' contains \
Problem:  comment plugin fails toggling if 'cms' contains \
Solution: escape backslash (Maxim Kim)

groff could be commented using \" or \# and comment plugin fails to
uncomment such things.

NOTE: if newstyle comment would be introduced, e.g. .\#
for groff test would need to be adjusted.

closes: #17530

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-12 21:31:00 +02:00
600cd88cdf runtime(netrw): remove comment separators
closes: #17514

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-11 20:42:41 +02:00
1319009d59 runtime(netrw): get rid of s:Strlen() and use strdisplaywidth()
closes: #17498

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-10 20:39:50 +02:00
09a62e6f64 runtime(netrw): cleanup Decho related comments
closes: #17465

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-09 16:04:05 +02:00
d1a975ae64 runtime(netrw): upstream snapshot of v181
closes: #17461

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-06-07 17:35:18 +02:00
ba0062b0c7 runtime(helptoc): the helptoc package can be improved
Adds the following changes:
- New Maintainer: Pete Kenny
- New filetypes supported (asciidoc, html, tex, vim, xhtml)
- improved Markdown support
- Sanitised ToCs and popup presentation
- Configuration improvements and options
- Add helptoc.txt help file

closes: #17255

Signed-off-by: Peter Kenny <github.com@k1w1.cyou>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-05-05 20:15:39 +02:00
fbe4a8f5c0 runtime(doc): Fix notation of "Vim script" and "Vim9 script"
closes: #17213

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-27 15:28:30 +02:00
dd776dd5f0 patch 9.1.1336: comment plugin does not support case-insensitive 'commentstring'
Problem:  comment plugin does not support case-insensitive
          'commentstring' (char101)
Solution: Use pattern '\c' to make the regex case-insensitive
          (Maxim Kim)

fixes: #17184
closes: #17186

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-22 20:14:30 +02:00
839fd94265 runtime(netrw): remove deprecated functions
closes: #17124

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-15 20:28:09 +02:00
d62377386c runtime(netrw): upstream snapshot of v180
relevant commits:
- fix(gvim): don't set previous jump
- don't overwrite copy, copydir, mkdir and move command options
- fix: correctly name deprecate function
- refactor: remove s:NetrwBufRemover
- refactor: s:NetrwDelete -> netrw#fs#Remove
- defaults!: remove g:netrw_use_errorwindow

fixes: #17114
closes: #17123

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-15 18:26:32 +02:00
0e59e67a63 patch 9.1.1293: comment plugin does not handle 'exclusive' selection for comment object
Problem:  comment plugin does not handle 'exclusive' selection for
          comment object (@mawkish)
Solution: handle special case selection='exclusive' for inline comment
          object (Maxim Kim)

fixes: #17023
closes: #17098

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-04-12 11:34:08 +02:00
a580761a45 patch 9.1.1259: some issues with comment package and tailing spaces
Problem:  some issues with comment package and tailing spaces
Solution: correctly capture trailing spaces with the ac/ic text object
          (Maxim Kim)

This commit fixes a few issues with the comment package:

1) both ac and ic incorrectly miss the last //

```
// hello trailing spaces
//
```

2) fix ac/ic with last empty comment line,
   vac should also select last line with #

```py
 # print("hello")
 # print("world")
 #
 #
$endofbuffer$
```

closes: #17013

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-30 14:55:26 +02:00
08283b28af patch 9.1.1240: Regression with ic/ac text objects and comment plugin
Problem:  Regression with ic/ac text objects and comment plugin
Solution: Fix regression, update tests (Maxim Kim)

fix regression: sometimes ic/ac should be line-wise

```
int main() {
    // multilple comments
    // cursor is between them
}

 # dac ->

int main() {
}
```

closes: #16947
closes: #16980

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-26 19:05:35 +01:00
e14aa3c035 runtime(hlyank): update the hlyank package
closes: #16944

Signed-off-by: Hirohito Higashi <h.east.727@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-22 15:58:59 +01:00
9712a2534f patch 9.1.1229: the comment plugin can be improved
Problem:  the comment plugin can be improved
Solution: add comment text objects "ic" and "ac"
          (Maxim Kim)

closes: #16938

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-21 18:04:37 +01:00
83d74404bb runtime(hlyank): add the hlyank package
closes: #16919
related: #16866

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-19 21:55:59 +01:00
ce4f9d2a10 runtime(nohlsearch): fix CursorHold loop
fix exception when entering the insert mode with paste

closes: #16818

Co-authored-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: qaqland <qaq@qaq.land>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-08 17:16:18 +01:00
29d596c80a runtime(netrw): upstream snapshot of v179
closes: #16787

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-03-04 20:36:31 +01:00
da53af57a7 runtime(netrw): correctly handle shellslash variable
closes: #16758

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-28 17:30:25 +01:00
5b97947bbd runtime(netrw): runtime(netrw): upstream snapshot of v178
relevant commits:
- refactor: netrw#own#Deprecate -> netrw#msg#Deprecate
- refactor: netrw#own#PathJoin -> netrw#fs#PathJoin
- fix: typos
- refactor: netrw#own#Open -> netrw#os#Open
- deprecate!: netrw#WinPath
- refactor: netrw#WinPath -> netrw#fs module
- refactor: s:ShellEscape -> netrw#os module
- refactor: s:NetrwExe -> netrw#os module
- refactor: s:NetrwGlob -> netrw#fs module
- refactor: s:NetrwGetcwd -> netrw#fs module
- refactor: s:NetrwFullPath -> netrw#fs module
- refactor: s:ComposePath -> netrw#fs module

closes: #16718

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-23 20:37:39 +01:00
ee1a24b21d runtime(netrw): fix s:NetrwHome() regression
If $MYVIMDIR is unset netrw creates a directory called '$MYVIMDIR' in
the current directory

fixes: #16609

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-18 20:11:51 +01:00
73d8222b31 runtime(netrw): upstream snapshot of v177
relevant commits:
- defaults!: use 'suffixes' for 'g:netrw_sort_sequence'
- refactor: remove associated buffer when deliting a file
- refactor: s:NetrwLocalRm
- refactor: s:NetrwDelete
- refactor: s:NetrwLocalRmFile
- feat: use vim.notify on neovim
- fix: prefer v:lua instead of luaeval for vim.deprecate
- chore: remove old batteries

closes: #16638

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-02-14 17:54:22 +01:00
6d6ec2ee05 runtime(netrw): correct wrong version check
The version check introduced with commit edd4ac3e8 has a logic error.
Also it should only trigger when trying to use the netrw plugin and not
always.

fixes: #16541

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-30 11:00:35 +01:00
ec961b05dc runtime(netrw): upstream snapshot of v176
relevant commits:
- deprecate!: netrw#Launch, netrw#Open and gx mappings
- refactor: move some utility functions in a private file
- feat: add function to deprecate features
- refactor!: remove NetrwClean command and function
- refactor: use appropriate directories to store temporary files
- refactor: better way to call vim.ui.open
- refactor(Open): prefer lua wrapper function instead of cmdline
- refactor!: drop vim 7 checks
- refactor: use vim.ui.open when using neovim
- refactor: remove s:CheckIfKde
- refactor: balloon functionality
- refactor!: remove netrw#Access function

closes: #16519

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-29 18:39:30 +01:00
c729d6d154 runtime: decouple Open and Launch commands and gx mapping from netrw
closes: #16494
fixes: ##16486

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-25 16:07:12 +01:00
d402ba81e2 runtime(netrw): upstream snapshot of v175
Relevant commits:
- release: netrw v175
- fix: prevent netrw to load into the built-in terminal
- fix: restore correctly cpo settings
- fix(docs): mispelled original authors name
- chore: move viml files to new formatting standard

fixes: #16463
closes: #16465

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-18 17:36:02 +01:00
9cfdabb074 runtime(netrw): change netrw maintainer
Dr. Chip retired some time ago and is no longer maintaining the netrw
plugin. However as a runtime plugin distributed by Vim, it important to
maintain the netrw plugin in the future and fix bugs as they are
reported.

So, split out the netrw plugin as an additional package, however include
some stubs to make sure the plugin is still loaded by default and the
documentation is accessible as well.

closes: #16368

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-01-17 13:03:53 +01:00
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
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
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
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
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
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
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
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
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
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
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
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