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-3055603968closes: #17716
Signed-off-by: Christian Brabandt <cb@256bit.org>
Problem: helptoc: does not handle code sections in markdown well
(VimWei)
Solution: Skip over fenced code sections (lacygoill), add a test.
fixes: #17699closes: #17710
Co-authored-by: lagygoill <lacygoill@lacygoill.me>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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>
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>
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>
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: #17523closes: #17563
Signed-off-by: Mark Woods <mwoods.online.ie@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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>
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>
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>
Problem: comment plugin does not support case-insensitive
'commentstring' (char101)
Solution: Use pattern '\c' to make the regex case-insensitive
(Maxim Kim)
fixes: #17184closes: #17186
Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #17023closes: #17098
Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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>
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: #16947closes: #16980
Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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>
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>
If $MYVIMDIR is unset netrw creates a directory called '$MYVIMDIR' in
the current directory
fixes: #16609
Signed-off-by: Christian Brabandt <cb@256bit.org>
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>
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>
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>
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-2485169333closes: #16097
Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #15877closes: #15933
Signed-off-by: Peter Wolf <pwolf2310@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
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: #15797closes: #15805
Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>