neovim/runtime
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
..
autoload vim-patch:8750e3cf81f1 (#26163) 2023-11-23 17:02:53 +08:00
colors vim-patch:dbf749bd5aae (#25665) 2023-10-16 16:36:25 +08:00
compiler vim-patch:fc93594d562d 2023-09-13 17:23:45 +02:00
doc build: don't define FUNC_ATTR_* as empty in headers (#26317) 2023-11-30 15:51:05 +08:00
ftplugin vim-patch:9.0.2128: runtime(swig): add syntax and filetype plugins 2023-11-26 00:41:59 +01:00
indent vim-patch:813a538bb3ce 2023-11-25 17:33:05 +01:00
keymap vim-patch:caee7956a21a 2023-11-05 21:56:56 +01:00
lua fix(treesitter): fix parens stacking in inspector display (#26304) 2023-11-30 07:04:20 -06:00
macros vim-patch:e8d6f03f6a61 2023-08-23 20:36:16 +01:00
pack/dist/opt vim-patch:2dd613f57bf1 (#26009) 2023-11-13 05:44:30 +08:00
plugin fix(man): set the nested flag for the BufReadCmd autocommand (#26285) 2023-11-28 17:02:44 -06:00
queries feat(lsp): use treesitter for stylize markdown 2023-09-19 14:47:37 +01:00
spell
syntax vim-patch:a9058440b7b9 2023-11-29 21:00:07 +01:00
tools
tutor fix(tutor): Tutor steps don't work on Windows #25251 2023-09-26 06:31:35 -07:00
CMakeLists.txt refactor(build): move the last generator from scripts/ to src/nvim/generators 2023-04-21 16:46:35 +02:00
delmenu.vim vim-patch:e978b4534a5e (#24697) 2023-08-13 13:25:10 +01:00
filetype.lua fix(filetype): make sure buffer is valid before call nvim_buf_call (#24922) 2023-08-30 10:14:58 -05:00
ftoff.vim vim-patch:e978b4534a5e (#24697) 2023-08-13 13:25:10 +01:00
ftplugin.vim vim-patch:e978b4534a5e (#24697) 2023-08-13 13:25:10 +01:00
ftplugof.vim vim-patch:e978b4534a5e (#24697) 2023-08-13 13:25:10 +01:00
indent.vim vim-patch:e978b4534a5e (#24697) 2023-08-13 13:25:10 +01:00
indoff.vim vim-patch:e978b4534a5e (#24697) 2023-08-13 13:25:10 +01:00
macmap.vim
makemenu.vim vim-patch:9.0.2104: wast filetype should be replaced by wat filetype 2023-11-14 21:51:28 +01:00
menu.vim vim-patch:e059fae10044 2023-08-24 11:33:06 +09:00
mswin.vim vim-patch:e978b4534a5e (#24697) 2023-08-13 13:25:10 +01:00
neovim.ico
nvim.appdata.xml NVIM v0.9.0 2023-04-07 13:26:29 +02:00
nvim.desktop
nvim.png
optwin.vim vim-patch:0b8b145bf8bf 2023-08-31 10:58:54 +02:00
synmenu.vim vim-patch:9.0.2104: wast filetype should be replaced by wat filetype 2023-11-14 21:51:28 +01:00