mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-07 05:50:04 -04:00
feat(indent): ecma - support try_catch and if_else
This commit is contained in:
parent
bb60706433
commit
8f9d4ada35
6 changed files with 75 additions and 0 deletions
|
|
@ -31,6 +31,7 @@ local get_indents = tsutils.memoize_by_buf_tick(function(bufnr, root, lang)
|
|||
local map = {
|
||||
auto = {},
|
||||
indent = {},
|
||||
indent_end = {},
|
||||
dedent = {},
|
||||
branch = {},
|
||||
ignore = {},
|
||||
|
|
@ -70,6 +71,9 @@ function M.get_indent(lnum)
|
|||
if is_empty_line then
|
||||
local prevlnum = vim.fn.prevnonblank(lnum)
|
||||
node = get_last_node_at_line(root, prevlnum)
|
||||
if q.indent_end[node:id()] then
|
||||
node = get_first_node_at_line(root, lnum)
|
||||
end
|
||||
else
|
||||
node = get_first_node_at_line(root, lnum)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue