Commit Graph

28291 Commits

Author SHA1 Message Date
Jongwook Choi
2cdea852e8 docs: auto-generate docs for vim.lpeg and vim.re
- Add section `VIM.LPEG` and `VIM.RE` to docs/lua.txt.

- Add `_meta/re.lua` which adds luadoc and type annotations, for the
  vendored `vim.re` package.

- Fix minor style issues on `_meta/lpeg.lua` luadoc for better vimdocs
  generation.

- Fix a bug on `gen_vimdoc` where non-helptags in verbatim code blocks
  were parsed as helptags, affecting code examples on `vim.lpeg.Cf`,
  etc.

- Also move the `vim.regex` section below so that it can be located
  closer to `vim.lpeg` and `vim.re`.
2024-01-14 11:08:33 +00:00
Jongwook Choi
ce4ea638c7 fix(lsp): fix incorrect typing and doc for vim.lsp.rpc
Typings introduced in #26032 and #26552 have a few conflicts, so we
merge and clean them up. We also fix some incorrect type annotation in
the `vim.lsp.rpc` package. See the associated PR for more details.

Summary:

- vim.rpc.Dispatchers -> vim.lsp.rpc.Dispatchers
- vim.lsp.rpc.Error -> lsp.ResponseError
- Revise docs
2024-01-14 09:02:45 +01:00
zeertzjq
92c59c39c3
fix(ops.c): remove duplicate u_save_cursor() 2024-01-14 08:47:57 +08:00
zeertzjq
2bdd8fad4c
docs(builtin): fix mapset() signature (#27008) 2024-01-14 08:44:16 +08:00
Evgeni Chasnovski
0c850add3e
fix(colorscheme): default statusline groups usability #26921
Problem: Current values of `StatusLine` and `StatusLineNC` are currently
  designed to be visually distinctive while being not intrusive.
  However, the compromise was more shifted towards "not intrusive".
  After the feedback, statusline highlight groups should be designed to:
  - Make current window clearly noticeable. Meaning `StatusLine` and
    `StatusLineNC` should obviously differ.
  - Make non-current windows clearly separable. Meaning `StatusLineNC`
    and `Normal`/`NormalNC` should obviously differ.

Solution:
  - Update `StatusLineNC` to have more visible background.
  - Update `StatusLine` to be inverted variant of `StatusLineNC`.
  - Update `WinBar` and `WinBarNC` to not link to `StatusLine` and
    `StatusLineNC` because it makes two goals harder to achieve.
  - Update `TabLine` to link to `StatusLineNC` instead of `StatusLine`
    to not be very visually intrusive.
2024-01-13 16:35:37 -08:00
bfredl
bab5e7fe17
Merge pull request #26869 from luukvbaal/decor
refactor: minor decor refactors
2024-01-13 18:10:53 +01:00
Luuk van Baal
4f544b3119 refactor(marktree): unpaired marktree_get_alt() returns itself
Avoids checking for invalid mark at callsite.
2024-01-13 17:15:19 +01:00
Luuk van Baal
e6ddceda31 refactor(decorations): more conservative redraw range
Problem:  Decor range is being redrawn unconditionally, negating the
          more conservative line redrawing that follows.
Solution: Get rid of unconditional redraw_buf_range_later() call.
2024-01-13 17:15:04 +01:00
bfredl
2dc439c672
Merge pull request #26734 from bfredl/splitaroo
fix(buffer_updates): correct buffer updates when splitting empty line
2024-01-13 10:59:46 +01:00
bfredl
e5d9b15044 fix(buffer_updates): correct buffer updates when splitting empty line
fixes #11591
2024-01-13 10:39:32 +01:00
zeertzjq
89b0f5ac5a
vim-patch:9.1.0022: Coverity complains about improper use of negative value (#27001)
Problem:  Coverity complains about improper use of negative value
Solution: Add a condition to validate that keytyped is larger or equal
          to 0

Apparently patch 9.1.0006 made it more explicit for Coverity, that the
TOLOWER_LOC() macros do not handle negative values properly. However,
that condition has always been there even before that, so add a
condition to verify that keytyped is indeed at least 0

closes: vim/vim#13824

49471963fe

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-13 13:23:42 +08:00
zeertzjq
786089013d
Merge pull request #26911 from zeertzjq/vim-8.2.3439
vim-patch:8.2.3439,9.1.{0015,0021}
2024-01-13 08:47:18 +08:00
zeertzjq
64a50d08c4 vim-patch:9.1.0021: i_CTRL-R- doesn't work for multibyte chars in Replace mode
Problem:  i_CTRL-R- doesn't work for multibyte chars in Replace mode,
          Coverity complains missing return value for u_save_cursor()
Solution: Use mb_charlen() and del_chars() instead, handle failure mode
          for u_save_cursor() correctly (@zeertzjq)

closes: vim/vim#13846

424ec1f235
2024-01-13 08:31:01 +08:00
zeertzjq
2783b6b0a4 vim-patch:9.1.0015: i_CTRL-R- no longer works in replace mode
Problem:  i_CTRL-R- no longer works in replace mode
Solution: delete characters in replace mode before putting, add a test,
          add a bit warning into the documentation, that i_CTRL-R-P/O
          is not supported in Replace mode for now

fixes: vim/vim#13792
closes: vim/vim#13816

5d5cbb2b9a

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-13 08:29:47 +08:00
zeertzjq
4142b8cd2c vim-patch:8.2.3439: deleted lines go to wrong yank register
Problem:    Deleted lines go to wrong yank register.
Solution:   Reset y_append when not calling get_yank_register(). (Christian
            Brabandt, closes vim/vim#8872)

78eb9cce91

Nvim has removed y_append static variable and already works as expected.

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-13 08:29:47 +08:00
dundargoc
c8f696f2b0 vim-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: vim/vim#13848

dc4c37b9d5

Co-authored-by: dundargoc <gocdundar@gmail.com>
2024-01-12 22:24:52 +01:00
LamprosPitsillos
e32af31ee8
fix(flake): clang-tools moved to nativeBuildInputs (#26955)
* fix(flake): clang-tools moved to nativeBuildInputs

Buildtime binaries should go in `nativeBuildInputs`
Before `clang-tools` version was overwriten breaking the Lsp.

Relevant issues:
https://github.com/NixOS/nixpkgs/issues/76486

* remove cmake, available in the nixpkgs derivation
2024-01-12 21:12:43 +01:00
Lewis Russell
07a7c0ec99
Merge pull request #26994 from lewis6991/vimhelpers
test: big cleanup
2024-01-12 19:40:58 +00:00
Lewis Russell
795f896a57 test: rename (meths, funcs) -> (api, fn) 2024-01-12 18:59:14 +00:00
Christian Clason
7f249936a9 vim-patch:2357765304e4
runtime(netrw): Decode multibyte percent-encoding filename correctly (vim/vim#13842)

Use `printf("%c")` instead of `nr2char()` to handle '%xx' as a byte.

Close vim/vim#13787

2357765304

Co-authored-by: K.Takata <kentkt@csc.jp>
2024-01-12 19:45:15 +01:00
Lewis Russell
4f81f506f9 test: normalise nvim bridge functions
- remove helpers.cur*meths
- remove helpers.nvim
2024-01-12 17:53:27 +00:00
Lewis Russell
c30f2e3182 test: typing for helpers.meths 2024-01-12 13:01:06 +00:00
Christian Clason
061a0d5a48 vim-patch:5f4cc8ea65e8
runtime(colorschemes): Add initial support for Added/Removed/Changed highlight groups (vim/vim#13830)

For some of the colorschemes where diffAdded and diffRemoved were explicitly set up.

5f4cc8ea65

Co-authored-by: Maxim Kim <habamax@gmail.com>
2024-01-12 13:52:26 +01:00
Christian Clason
f46ae13685 vim-patch:9.1.0016: default diff highlighting is too noisy
Problem:  default diff highlighting is too noisy
Solution: Link diff highlighting groups to new
          Added/Removed/Changed, revert previous change
          (Romain Lafourcade)

Remove diff* links added in vim/vim#13776 and doc added in commit b1392be

The links added in vim/vim#13776 are way too noisy for the contexts in which
the `diff` syntax is applied (git commits, patches, etc.).

This commit:

- removes those links
- adds new default highlighting groups Added, Changed and
  Removed
- links the diff highlighting groups to those new defaults
- removes the doc changes
- adjusts the syntax_completion test for those newly added group
  names

Note: Changes to the default color schemes will be handled separately,
by adding links to those newly created Added/Removed/Changed
highlighting groups.

related: vim/vim#13776
closes vim/vim#13825

124371c5a1

Co-authored-by: Romain Lafourcade <romain.lafourcade@razorfish.fr>
2024-01-12 13:52:26 +01:00
Lewis Russell
284e0ad26d test: use vim.mpack and vim.uv directly 2024-01-12 12:04:20 +00:00
Lewis Russell
56a2ec5c79 test: use vim.inspect directly 2024-01-12 12:04:20 +00:00
Lewis Russell
7a259d01ae test: remove helpers.sleep() 2024-01-12 12:04:19 +00:00
Lewis Russell
d33e1da9b7 test: do not inject vim module into global helpers 2024-01-12 12:04:18 +00:00
zeertzjq
3bcf8e5622
vim-patch:9.1.0011: regexp cannot match combining chars in collection (#26992)
Problem:  regexp cannot match combining chars in collection
Solution: Check for combining characters in regex collections for the
          NFA and BT Regex Engine

Also, while at it, make debug mode work again.

fixes vim/vim#10286
closes: vim/vim#12871

d2cc51f9a1

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-12 14:09:10 +08:00
dundargoc
1813661a61 refactor(IWYU): fix headers
Remove `export` pramgas from defs headers as it causes IWYU to believe
that the definitions from the defs headers comes from main header, which
is not what we really want.
2024-01-11 21:37:23 +01:00
bfredl
1514982484
Merge pull request #26961 from bfredl/drawend
refactor(screen): simplify grid_clear() and win_draw_end()
2024-01-11 21:20:28 +01:00
bfredl
478b1af511 refactor(screen): simplify grid_clear() and win_draw_end()
grid_put_linebuf() used grid_clear() internally to handle clearing the
left part of a rightleft line. By reimplementing that internally, we
can instead use grid_put_linebuf() as the implementation of
grid_clear(), which in the end is a net reduction of code as grid_fill()
is used for nothing else.

win_draw_end: Implement "draw_margin" on a per-row basis which closer reflects how
terminals work. Also use the magic mirror for 'rightleft'
2024-01-11 19:53:21 +01:00
Lewis Russell
2f9ee9b6cf fix(doc): improve doc generation of types using lpeg
Added a lpeg grammar for LuaCATS and use it in lua2dox.lua
2024-01-11 16:24:12 +00:00
JD
a767c046f4
feat(vim.iter): add Iter:flatten (#26786)
Co-authored-by: Gregory Anders <greg@gpanders.com>
Co-authored-by: Jongwook Choi <wookayin@gmail.com>
2024-01-10 20:57:51 -06:00
zeertzjq
a7550a20e0
fix(pum): handle right-click menu repositioning with multigrid (#26975) 2024-01-10 12:56:43 +08:00
Gregory Anders
fa17a5ab49
fix(terminal): use terminal buffer for TermRequest autocommand (#26974) 2024-01-09 21:31:37 -06:00
Barrett Ruth
63a17322dd
fix(health): improve python executable check error handling (#26954)
Credit to @wookayin for the fix.
2024-01-10 07:05:44 +08:00
Barrett Ruth
c67efe3a9c
fix(health): correctly expand and resolve PYENV_ROOT (#26953) 2024-01-10 06:28:18 +08:00
Christian Clason
595f684c5b vim-patch:71d0ba07a33a
runtime(netrw): Sync with netrw 174b (vim/vim#13836)

* Import netrw v174b
* Revert unwanted changes
* Fix indent
* Revert some changes
* Update tags
* Break long line

71d0ba07a3

Co-authored-by: K.Takata <kentkt@csc.jp>
2024-01-09 23:22:48 +01:00
Famiu Haque
10f36af84d
refactor(options): remove OPT_FREE (#26963)
Problem: `OPT_FREE` macro doesn't seem to do anything as `P_ALLOCED`
already handles allocations.

Solution: Remove `OPT_FREE`.
2024-01-10 06:15:22 +08:00
dundargoc
501cf32357
vim-patch:3a5b3df7764d (#26956)
runtime(tar): fix a few problems with the tar plugin

From: vim/vim#138331:
  - Updating .tar.zst files was broken. Fixes vim/vim#12639.
  - Extracting files from .tar.zst / .tzs files was also broken and
    works now.
From: vim/vim#12637:
  - Fixes variable assignment and typo
From: vim/vim#8109:
  - Rename .tzs to the more standard .tzst

fixes: vim/vim#12639
fixes: vim/vim#8105
closes: vim/vim#8109
closes: vim/vim#12637
closes: vim/vim#13831

3a5b3df776

Co-authored-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Martin Rys <martin@rys.pw>
Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
Co-authored-by: Carlo Teubner <carlo@cteubner.net>
2024-01-10 06:03:09 +08:00
Ghjuvan Lacambre
beca827212
feat(terminal): trigger TermRequest autocommand events (#22159)
This commit implements a new TermRequest autocommand event and has Neovim
emit this event when children of terminal buffers emit an OSC or DCS sequence
libvterm does not handle.

The TermRequest autocommand event has additional data in the
v:termrequest variable.

Co-authored-by: Gregory Anders <greg@gpanders.com>
2024-01-09 08:27:56 -06:00
Jongwook Choi
f40df63bdc fix(docs): make lines not overflow in vim docs
Problem: Some lines in the generated vim doc are overflowing, not
correctly wrapped at 78 characters. This happens when docs body contains
several consecutive 'inline' elements generated by doxygen.

Solution: Take into account the current column offset of the last line,
and prepend some padding before doc_wrap().
2024-01-09 13:33:18 +00:00
zeertzjq
d54156ed08
fix(extmarks): blending space shouldn't overwrite wide char (#26960) 2024-01-09 19:16:44 +08:00
zeertzjq
b2c92eebc0
refactor(drawline): remove unused save_extra argument (#26959) 2024-01-09 14:52:05 +08:00
zeertzjq
ee3d4f6b90
fix(extmarks): handle overwriting right half of wide char (#26951) 2024-01-09 05:37:08 +08:00
bfredl
c4acbb87ba
Merge pull request #26872 from bfredl/fillschar
refactor(options): use schar_T for fillchars and listchars
2024-01-08 18:25:52 +01:00
bfredl
aeb053907d refactor(options): use schar_T representation for fillchars and listchars
A bit big, but practically it was a lot simpler to change over all
fillchars and all listchars at once, to not need to maintain two
parallel implementations.

This is mostly an internal refactor, but it also removes an arbitrary
limitation: that 'fillchars' and 'listchars' values can only be
single-codepoint characters. Now any character which fits into a single
screen cell can be used.
2024-01-08 14:37:55 +01:00
Jongwook Choi
fbe40caa7c docs(treesitter): improve 'no parser' error message for InspectTree
Improve error messages for `:InspectTree`, when no parsers are available
for the current buffer and filetype. We can show more informative and
helpful error message for users (e.g., which lang was searched for):

```
 ... No parser available for the given buffer:
+... no parser for 'custom_ft' language, see :help treesitter-parsers
```

Also improve the relevant docs for *treesitter-parsers*.
2024-01-08 09:27:03 +00:00
James McCoy
367e52cc79
fix(tui): use buflen to calculate remaining buffer size (#26942)
buf is a pointer argument, not a local char array, so sizeof(buf) is just the size of a pointer type on the platform.  This is always an incorrect value, but on 32-bit platforms it actually has an impact, since sizeof(buf) is just 4 and causes the buffer to get truncated.
2024-01-07 12:25:25 -05:00