Commit Graph

28408 Commits

Author SHA1 Message Date
Jongwook Choi
89ffdebd20 fix(diagnostic): fix typing on field |diagnostic-severity|
Problem: vim.diagnostic.{underline,float,virtual_text...}.severity
will have a type warning on list-like or table (min-max) inputs,
e.g. `vim.diagnostic.config { float = { severity = { min = INFO } } }`.

Solution: Correct the typing as documented in |diagnostic-severity|.
2024-01-23 11:43:57 +00:00
bfredl
d9946006c9
Merge pull request #27147 from bfredl/crash2
fix(extmark): another "step out" case
2024-01-23 11:56:16 +01:00
bfredl
79a558277b fix(extmark): fix crash when stepping out from internal node 2024-01-23 11:39:37 +01:00
Christian Clason
26143d7a5c fix(treesitter): update @markup default links
* use `Special` as default for `@markup.*`, especially `@markup.raw` and
  `@markup.math` (`@markup` itself is never used)
* use `Structure` for `@markup.environment`
* highlight all of `@markup.link` as Underlined (otherwise concealed
  links are invisible)
2024-01-23 11:38:52 +01:00
bfredl
d3fa8adea9
Merge pull request #27145 from bfredl/crash_meta
fix(extmarks): crash with sign after many marks
2024-01-23 09:38:52 +01:00
bfredl
54225bdb02 fix(extmarks): crash with sign after many marks
fixes #27137
2024-01-23 09:24:36 +01:00
zeertzjq
dc466f9a63
vim-patch:9.1.0043: ml_get: invalid lnum when :s replaces visual selection (#27140)
Problem:  ml_get: invalid lnum when :s replaces visual selection
          (@ropery)
Solution: substitute may decrement the number of lines in a buffer,
          so validate, that the bottom lines of the visual selection
          stays within the max buffer line

fixes: vim/vim#13890
closes: vim/vim#13892

7c71db3a58

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-23 06:51:10 +08:00
Christian Clason
a7eb1e6004 build(deps): bump luajit to HEAD - 3ca0a8071 2024-01-22 23:47:46 +01:00
Christian Clason
46aa1936e4 vim-patch:add31baedaf0
runtime(sh): Add handling for ksh93 shared-state comsubs and mksh valsubs (vim/vim#13884)

This commit adds support for ksh93 shared-state command
substitutions (syntax: ${ command; }) and mksh's value
substitutions (syntax: ${|command;}) in the sh syntax script.

Also add a syntax test for ksh subshares with dumps included
to make sure it doesn't regress.

fixes: vim/vim#9514

add31baeda

Co-authored-by: Johnothan King <johnothanking@protonmail.com>
2024-01-22 23:40:50 +01:00
Christian Clason
c7da55a835 vim-patch:3b2c27415d7d
runtime(chuck): include ChucK syntax file (vim/vim#13895)

3b2c27415d

Co-authored-by: Andrea C from The App <3269984+gacallea@users.noreply.github.com>
Co-authored-by: gacallea <gacallea@users.noreply.github.com>
2024-01-22 23:40:50 +01:00
Christian Clason
e2553c3d5d vim-patch:ea9a93e5b098
runtime(go): update Go syntax file (vim/vim#13896)

Update the Go syntax file with some recent changes made to vim-go.

ea9a93e5b0

Co-authored-by: Billie Cleek <bhcleek@users.noreply.github.com>
2024-01-22 23:40:50 +01:00
dundargoc
eb5d15e383 refactor: rewrite python provider in lua 2024-01-22 22:36:40 +01:00
Luuk van Baal
13d50c3b13 fix(column): clear "b_signcols" when marktree is cleared 2024-01-22 20:39:24 +00:00
bfredl
51f783f2fa
Merge pull request #27011 from bfredl/metatree
perf(extmarks): add metadata for efficient filtering of special decorations
2024-01-22 21:05:12 +01:00
bfredl
9af2be292d perf(extmarks): add metadata for efficient filtering of special decorations
This expands on the global "don't pay for what you don't use" rules for
these special extmark decorations:

- inline virtual text, which needs to be processed in plines.c when we
  calculate the size of text on screen
- virtual lines, which are needed when calculating "filler" lines
- signs, with text and/or highlights, both of which needs to be
  processed for the entire line already at the beginning of a line.

This adds a count to each node of the marktree, for how many special
marks of each kind can be found in the subtree for this node. This makes
it possible to quickly skip over these extra checks, when working in
regions of the buffer not containing these kind of marks, instead of
before where this could just be skipped if the entire _buffer_
didn't contain such marks.
2024-01-22 19:03:32 +01:00
Christian Clason
012cfced9b build(deps): bump tree-sitter-c to v0.2.7 2024-01-22 17:58:33 +01:00
zeertzjq
cb6320e13f
docs(options): remove misleading sentence (#27129)
Setting 'verbose' to 1 doesn't cause Nvim to produce messages. It adds
more information to existing messages, which is documented above.
2024-01-22 22:54:45 +08:00
dundargoc
b4da4783f9 build: make genappimage.sh work with existing CMAKE_INSTALL_PREFIX
Using CMAKE_INSTALL_PREFIX is unreliable as it's a cache variable,
meaning the users previous value will be used if not supplied. Instead,
use the `--prefix` flag which is guaranteed to always work.
2024-01-22 12:38:27 +01:00
Lewis Russell
1233ac467d
feat(fold): transparent foldtext
'foldtext' can be set to an empty string to disable and render the
line with:
  - extmark highlight
  - syntax highlighting
  - search highlighting
  - no line wrapping
  - spelling
  - conceal
  - inline virtual text
  - respects `fillchars:fold`

Currently normal virtual text is not displayed


Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2024-01-22 10:13:35 +00:00
bfredl
21b36c7d7f
Merge pull request #27076 from glepnir/extmark_hlgroup
refactor(api): use hl id directly in nvim_buf_set_extmark
2024-01-22 09:10:34 +01:00
Raphael
12d123959f
fix(eval): properly support checking v:lua function in exists() (#27124) 2024-01-22 16:04:50 +08:00
bfredl
d66ed4ea46 refactor(api): give "hl_group" more accurate _meta type
These can either be number or string in lua, so we can specify this
directly as "number|string".
2024-01-22 08:51:54 +01:00
zeertzjq
e68decab03
refactor: use "csarg" for CharsizeArg variables (#27123) 2024-01-22 10:39:37 +08:00
zeertzjq
8c6de9147c
Merge pull request #26813 from VanaIgr/screen-pos-speedup
perf: make screen size and position calculations more efficient

N/A patches for version.c:
vim-patch:9.1.0037: Calling get_breakindent_win() repeatedly when computing virtcol
vim-patch:9.1.0038: Unnecessary loop in getvcol()
2024-01-22 10:00:11 +08:00
VanaIgr
fd08de4b85 docs(news): expand the list of performance improvements
When computing on-screen size or position, the size 'breakindent' and 'showbreak' is now cached,
and checks for whether a faster character size function can be used are performed only once at the start.
Multibyte characters are not decodes multiple times anymore, and character decoding functions are more efficient.
Additionally, the amount of trailing spaces for pasted blockwise text is now calculated correctly for multibyte characters.
Internal lisp formatting now doesn't erroneously use inline virtual text from a different line.
2024-01-22 09:05:01 +08:00
VanaIgr
cdf848a314 perf: reuse fast character size calculation algorithm from getvcol() 2024-01-22 09:04:45 +08:00
VanaIgr
b5653984e5 perf: don't decode utf8 character multiple times in getvcol()
The optimized virtual column calculation loop in getvcol()
was decoding the current character twice: once in ptr2cells()
and the second time in utfc_ptr2len(). For combining charcters, they were
decoded up to 2 times in utfc_ptr2len(). Additionally, the function used to
decode the character could be further optimised.
2024-01-22 09:04:42 +08:00
zeertzjq
a25aeee856
test(core/channel_spec): fix lint failure 2024-01-22 08:15:13 +08:00
zeertzjq
18d62d129f
test(core/channels_spec): fix variable name 2024-01-22 08:02:21 +08:00
nwounkn
4d4092ac9e fix(rpc): assertion failure due to invalid msgpack input
Problem:
  rbuffer_consumed assertion fails if Unpacker fails to parse msgpack,
  because it doesn't consume bytes on errors

Solution:
  Call rbuffer_consumed_compact only if Unpacker isn't closed
2024-01-21 23:42:58 +00:00
dundargoc
f8310beeed build: create BINARY_LIB_DIR directory before adding parser
cmake -E copy_directory behaves differently depending on if the
directory in question exists or not. Always create it to ensure it
behaves consistently.
2024-01-22 00:30:27 +01:00
zeertzjq
215244f749
fix(extmarks): missing "spell" and "conceal" in details (#27116) 2024-01-22 06:25:06 +08:00
dundargoc
3f188bc533 build: fix parser installation location
Cmake's `install()` functions like rsync where a trailing slash changes
whether the directory or its contents will be copies.
2024-01-21 15:19:25 +01:00
Jongwook Choi
fa4b02fa67 feat(vim.version): add vim.version.le and vim.version.ge
- Problem: One cannot easily write something like, for example:
    `version_current >= {0, 10, 0}`; writing like
    `not vim.version.lt(version_current, {0, 10, 0})` is verbose.

- Solution: add {`le`,`ge`} in addition to {`lt`,`gt`}.

- Also improve typing on the operator methods: allow `string` as well.

- Update the example in `vim.version.range()` docs: `ge` in place of
  `gt` better matches the semantics of `range:has`.
2024-01-21 11:41:50 +01:00
Christian Clason
8df7978fe3 vim-patch:9.1.0042: Missing test for Chuck Filetype
Problem:  Missing test for Chuck filetype
          after commit 27a4632af6753
          (Christian Clason)
Solution: Add a filetype test

c1884c94c5

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-21 11:10:53 +01:00
Christian Clason
c75af76b71 vim-patch:27a4632af675
runtime(filetype): detect *.ck files as Chuck filetype (vim/vim#13888)

closes vim/vim#13886

27a4632af6

Co-authored-by: Christian Brabandt <cb@256bit.org>
2024-01-21 11:10:53 +01:00
Christian Clason
f5dc453109 feat(treesitter)!: new standard capture names
Problem: Sharing queries with upstream and Helix is difficult due to
different capture names.

Solution: Define and document a new set of standard captures that
matches tree-sitter "standard captures" (where defined) and is closer to
Helix' Atom-style nested groups.

This is a breaking change for colorschemes that defined highlights based
on the old captures. On the other hand, the default colorscheme now
defines links for all standard captures (not just those used in bundled
queries), improving the out-of-the-box experience.
2024-01-21 10:41:18 +01:00
glepnir
646fdf1073 refactor(api): use hl id directly in nvim_buf_set_extmark 2024-01-20 21:31:11 +08:00
Jongwook Choi
fa9a85ae46 fix(lsp): clean up duplicate and unused meta type annotations 2024-01-20 14:02:16 +01:00
dundargoc
f936a962d0 build: create separate targets for nvim with and without runtime files
This distinction is important for correct dependency management, as the
nvim binary is used to create some runtime files. The nvim binary (and
the target to build it) is thus called `nvim_bin` and the target to
build all of nvim (binary+runtime) is called `nvim`.
2024-01-20 12:59:27 +01:00
dundargoc
ed103cde28 ci: bump cache action to version 4 2024-01-20 12:49:43 +01:00
Raphael
98a4ed0a11
feat(api): support getting abbreviations (#26868) 2024-01-20 08:08:44 +08:00
Gregory Anders
d3a8e9217f
feat(ui): add chdir UI event (#27093)
When an embedded Nvim instance changes its current directory a "chdir"
UI event is emitted. Attached UIs can use this information however they
wish. In the TUI it is used to synchronize the cwd of the TUI process
with the cwd of the embedded Nvim process.
2024-01-19 14:51:10 -06:00
Jongwook Choi
5a8fe0769c fix(vim.deprecate): show deprecation warning in devel versions as well
Problem:

On devel(nightly) versions, deprecation warnings for hard-deprecated
features are not being displayed. E.g.,
  - to be removed in: 0.11
  - hard-deprecation since 0.10
  - soft-deprecation since 0.9

then 0.10-nightly (0.10.0-dev) versions as well as 0.10.0 (stable)
should display the deprecation warning message.

Solution:

Improve the code and logic on `vim.deprecate()`, and improve
test cases with mocked `vim.version()`.
2024-01-19 12:00:47 +00:00
altermo
9707363b09 refactor(lua): refactored glob 2024-01-19 11:54:04 +00:00
bfredl
0b36cbbafd
Merge pull request #27061 from luukvbaal/extmark
fix(extmarks): do not remove invalid marks from decor upon deletion
2024-01-19 10:49:13 +01:00
Junghyeon Park
96d0f4a2d7
docs(INSTALL.md): remove update-alternatives instructions (#27060)
There are various other ways people can mimic the old commands, and
plenty of people that have never heard of the old commands.
This increases the consistency of the whole document by restricting it
to the scope to installation of Nvim and its CLI commands.
2024-01-19 16:34:51 +08:00
VanaIgr
2f2f12122f perf: remove loop for computing last position in getvcol()
The function computed the start of the multibyte character and iterated
until the current character reached this position. The loop at the start of the function
handed the case where the index passed to the function was past the end of the line.
This loop can be removed if the function instead compares the next position against
the end position end exits the loop if it is greater than the end position.
2024-01-18 21:30:48 -06:00
VanaIgr
a9c551e5e3 perf: cache breakindent/showbreak width in win_lbr_chartabsize
breakindent was recomputed on every call to win_lbr_charbabsize() when the character
is past the end of the first row of a wrapped line. Even though the function for computing
breakindent cached the last result, reusing the cached value required strcmp of the cached line with the given line.
2024-01-18 21:30:47 -06:00
VanaIgr
77c3d66be9 test: add screenpos() benchmarks 2024-01-18 21:30:47 -06:00