Commit Graph

27860 Commits

Author SHA1 Message Date
Gregory Anders
ce2f770aaa fix(termkey): do not sign extend mode value 2023-11-30 12:02:10 -06:00
dundargoc
404043e74c build: vendor libtermkey
This is a proof of concept/WIP to evaluate the viability of vendoring
libtermkey as it's been deprecated.
2023-11-30 12:02:10 -06:00
Gregory Anders
7feed6ccb7
refactor: explicitly abort on OOM condition (#26330)
assert() would not abort in release builds, meaning an OOM condition
would be undetected.
2023-11-30 11:05:33 -06:00
Pham Huy Hoang
f5573fba3d
fix: Remove nested for_each_tree in TSTreeView (#26328)
Problem:
`LanguageTree:for_each_tree` calls itself for child nodes, so when we
calls `for_each_tree` inside `for_each_tree`, this quickly leads to
exponential tree calls.

Solution:
Use `pairs(child:trees())` directly in this case, as we don't need the
extra callback for each children, this is already handled from the outer
`for_each_tree` call
2023-11-30 10:37:42 -06:00
Gregory Anders
758fdc287d
refactor: suppress unused variable warnings in release builds (#26327) 2023-11-30 09:31:25 -06:00
zeertzjq
a6f26c86cb
refactor(IWYU): fix includes for cmdhist.h (#26324) 2023-11-30 22:48:15 +08:00
Gregory Anders
884a83049b
fix(tui): grow termkey's internal buffer for large escape sequences (#26309)
Some escape sequences (in particular, OSC 52 paste responses) can be
very large, even unbounded in length. These can easily overflow
termkey's internal buffer. In order to process these long sequences,
dynamically grow termkey's internal buffer.
2023-11-30 08:04:33 -06:00
Gregory Anders
01b91deec7
fix(treesitter): fix parens stacking in inspector display (#26304)
When first opened, the tree-sitter inspector traverses all of the nodes
in the buffer to calculate an array of nodes. This traversal is done
only once, and _all_ nodes (both named and anonymous) are included.
Toggling anonymous nodes in the inspector only changes how the tree is
drawn in the buffer, but does not affect the underlying data structure
at all.

When the buffer is traversed and the list of nodes is calculated, we
don't know whether or not anonymous nodes will be displayed in the
inspector or not. Thus, we cannot determine during traversal where to
put closing parentheses. Instead, this must be done when drawing.

When we draw, the tree structure has been flatted into a single array,
so we lose parent-child relationships that would otherwise make
determining the number of closing parentheses straightforward. However,
we can instead rely on the fact that a delta between the depth of a node
and the depth of the successive node _must_ mean that more closing
parentheses are required:

  (foo
    (bar)
  (baz)  ↑
         │
         └ (bar) and (baz) have different depths, so (bar) must have an
           extra closing parenthesis

This does not depend on whether or not anonymous nodes are displayed and
so works in both cases.
2023-11-30 07:04:20 -06:00
zeertzjq
52d738826c
ci(release): perform a full checkout when building (#26323)
Ref #13471
2023-11-30 21:03:25 +08:00
zeertzjq
c8e37a589a
refactor(IWYU): move typedefs out of globals.h (#26322) 2023-11-30 19:52:23 +08:00
bfredl
3b6dd8608d
Merge pull request #23657 from luukvbaal/extmark
fix(extmark): restore extmarks when completing original text
2023-11-30 11:48:16 +01:00
zeertzjq
95dbf1af73
refactor: move extern variables out of _defs.h files (#26320) 2023-11-30 18:41:52 +08:00
zeertzjq
ce56e0a845
refactor(IWYU): move UI and LineFlags to ui_defs.h (#26318) 2023-11-30 17:16:57 +08:00
zeertzjq
543e0256c1
build: don't define FUNC_ATTR_* as empty in headers (#26317)
FUNC_ATTR_* should only be used in .c files with generated headers.
Defining FUNC_ATTR_* as empty in headers causes misuses of them to be
silently ignored. Instead don't define them by default, and only define
them as empty after a .c file has included its generated header.
2023-11-30 15:51:05 +08:00
zeertzjq
85be914879
test: unskip more terminal tests on Windows (#26315) 2023-11-30 10:55:21 +08:00
zeertzjq
62dff43947
test(ex_terminal_spec): match descriptions (#26314) 2023-11-30 08:56:21 +08:00
zeertzjq
463b577afb
Merge pull request #25994 from luki446/windows-path-terminal-fix
Fix a bug in usage of windows-style paths as SHELL path.
2023-11-30 07:56:47 +08:00
zeertzjq
90b213990f test: :terminal when 'shell' uses backslashes 2023-11-30 07:32:28 +08:00
Luki446
5ca6c9e046 fix(terminal): make backslashes in 'shell' work on Windows
If backslashes are used in 'shell' option, escape them to make Terminal
mode work.
2023-11-30 07:32:28 +08:00
zeertzjq
65de1a22c4
ci(lintcommit): fix empty and period check with multiple colons (#26312) 2023-11-30 07:31:22 +08:00
zeertzjq
73691b6c3d
test(ex_terminal_spec): unskip tests that work on Windows (#26310) 2023-11-30 07:06:23 +08:00
Luuk van Baal
8e97edb93f fix(extmark): restore extmarks when completing original text 2023-11-29 23:38:27 +01:00
Christian Clason
8594b0858f vim-patch:a9058440b7b9
runtime(html): Update syntax file (vim/vim#13591)

Add missing search element and update ARIA attribute list.

Add a very basic test file to check all elements are matched.

a9058440b7

Co-authored-by: dkearns <dougkearns@gmail.com>
2023-11-29 21:00:07 +01:00
Gregory Anders
4a8bf24ac6
fix(treesitter): adjust indentation in inspector highlights (#26302) 2023-11-29 10:17:53 -06:00
Gregory Anders
400b7842a9
fix(termcap): escape escapes in passthrough sequence (#26301)
When using the tmux passthrough sequence any escape characters in the
inner sequence must be escaped by adding another escape character.
2023-11-29 09:49:44 -06:00
Gregory Anders
9b4b23493d
fix(defaults): wait until VimEnter to set background (#26284)
The OptionSet autocommand does not fire until Vim has finished starting,
so setting 'background' before the VimEnter event would not fire the
OptionSet event. The prior implementation also waited until VimEnter to
set 'background', so this was a regression introduced when moving
background detection into Lua.
2023-11-29 09:43:11 -06:00
zeertzjq
86cc791deb
refactor: move function macros out of vim_defs.h (#26300) 2023-11-29 23:10:21 +08:00
Gregory Anders
18c1fd8e9d
docs: document TSNode:byte_length() (#26287)
Also update the type annotation of TSNode:id(), which returns a string,
not an integer.
2023-11-29 08:59:36 -06:00
Pham Huy Hoang
b6e339eb90
fix(treesitter): make InspectTree correctly handle nested injections (#26085)
Problem: Only injections under the top level tree are found.

Solution: Iterate through all trees to find injections. When two
injections are contained within the same node in the parent tree, prefer
the injection with the larger byte length.
2023-11-29 08:16:52 -06:00
Gregory Anders
7bc5ee7f93
fix(treesitter): use proper query syntax for inspector (#26274) 2023-11-29 08:10:02 -06:00
zeertzjq
a6cba103ce
refactor: move some constants out of vim_defs.h (#26298) 2023-11-29 20:32:40 +08:00
Luuk van Baal
f4001d27ef perf(column): only invalidate lines affected by added sign 2023-11-29 10:17:15 +00:00
bfredl
584c6c25cc
Merge pull request #26292 from luukvbaal/decor
fix(decorations): do not apply sign highlight id as range attr id
2023-11-29 11:12:25 +01:00
zeertzjq
640680ccce
vim-patch:9.0.2134: ml_get error when scrolling (#26264)
Problem:  ml_get error when scrolling after delete
Solution: mark topline to be validated in main_loop
          if it is larger than current buffers line
          count

reset_lnums() is called after e.g. TextChanged autocommands and it may
accidentally cause curwin->w_topline to become invalid, e.g. if the
autocommand has deleted some lines.

So verify that curwin->w_topline points to a valid line and if not, mark
the window to have w_topline recalculated in main_loop() in
update_topline() after reset_lnums() returns.

fixes: vim/vim#13568
fixes: vim/vim#13578

c4ffeddfe5

The error doesn't happen in Nvim because Nvim triggers TextChanged after
calling update_topline().

Co-authored-by: Christian Brabandt <cb@256bit.org>
2023-11-29 13:24:24 +08:00
zeertzjq
64b53b71ba
refactor(IWYU): create normal_defs.h (#26293) 2023-11-29 12:10:42 +08:00
Luuk van Baal
a0e9ef09d7 fix(decorations): do not apply sign highlight id as range attr id 2023-11-29 03:57:23 +01:00
zeertzjq
8868ecd401
vim-patch:9.0.2136: MSVC errorformat can be improved (#26283)
Problem:  MSVC errorformat can be improved
Solution: parse error type and column number in MSVC errorformat

closes: vim/vim#13587

8ceb99001b

Co-authored-by: Shawn Hatori <shawn.hatori@gmail.com>
2023-11-29 07:22:13 +08:00
Gregory Anders
a9b4dc9614
fix(man): set the nested flag for the BufReadCmd autocommand (#26285)
The nested flag must be set so that other autocommands can fire while
the BufReadCmd is still executing.
2023-11-28 17:02:44 -06:00
zeertzjq
aa9d9cafd0
vim-patch:9.0.2135: No test for mode() when executing Ex commands (#26282)
Problem:  No test for mode() when executing Ex commands
Solution: Add some test cases and simplify several other test cases.
          Also add a few more test cases for ModeChanged.

closes: vim/vim#13588

fcaeb3d42b
2023-11-29 06:51:00 +08:00
Gregory Anders
b7831c7f99
fix(termcap): use tmux passthrough sequence when running in tmux (#26281)
tmux intercepts and ignores XTGETTCAP so wrap the query in the tmux
passthrough sequence to make sure the query arrives at the "host"
terminal.

Users must still set the 'allow-passthrough' option in their tmux.conf.
2023-11-28 16:34:18 -06:00
dundargoc
79b6ff28ad refactor: fix headers with IWYU 2023-11-28 22:23:56 +01:00
bfredl
d85e9935f2
Merge pull request #26276 from luukvbaal/decor
refactor(decor): remove sign conditions that are always true
2023-11-28 20:39:59 +01:00
dundargoc
bcaff309b6 build: disable UnusedIncludes from clangd
Include Cleaner is enabled by default since clangd 17 and gives
incorrect suggestions.
2023-11-28 20:22:59 +01:00
Luuk van Baal
898f8d1f0b refactor(decor): remove sign conditions that are always true 2023-11-28 19:23:57 +01:00
Luuk van Baal
35cec0de4a fix(column): redraw and update signcols for paired extmark
Problem:  Signcolumn width does not increase when ranged sign does not
          start at sentinel line.
Solution: Handle paired range of added sign when checking signcols.
2023-11-28 16:44:20 +00:00
Samuel (ThinLinc team)
adb2258345
fix(rplugin): dont create data dir if it's a broken symlink #25726
Checking if it's non-empty and not a directory gets us quite far, but
not all the way. While a working symlink would trigger the earlier
checks, a broken symlink does not.

This commit fixes the special case where ~/.local/share/nvim  already
exists but is a broken symlink. Thus, it fixes the following error on
startup:

E739: Cannot create directory /home/samuel/.local/share/nvim: file
already exists
2023-11-28 03:17:39 -08:00
zeertzjq
c9f53d0e40
refactor: iwyu (#26269) 2023-11-28 19:00:14 +08:00
bfredl
ba564442ae
Merge pull request #26249 from bfredl/concealchar
feat(decoration): allow conceal_char to be a composing char
2023-11-28 11:01:21 +01:00
bfredl
ae3685798d feat(decoration): allow conceal_char to be a composing char
decor->text.str pointer must go. This removes it for conceal char,
in preparation for a larger PR which will also handle the sign case.

By actually allowing composing chars for a conceal chars, this
becomes a feature and not just a refactor, as a bonus.
2023-11-28 10:35:25 +01:00
zeertzjq
71e954ad30
refactor(IWYU): fix includes for ugrid.h (#26267) 2023-11-28 17:01:27 +08:00