mirror of
https://github.com/chenasraf/nvim-treesitter.git
synced 2026-05-18 01:39:00 +00:00
fix(nickel): wrong indent on line after top level comment (#4792)
* fix(nickel): wrong indent on line after top level comment
Previous incorrect indentation on line after top level comment:
```
# no indent after this comment
{
another = 1
}
```
Expected result:
```
# no indent after this comment
{
another = 1
}
````
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
[
|
||||
(term)
|
||||
(atom (uni_record)) ; for {...}
|
||||
(atom terms: (term)) ; for [...]
|
||||
] @indent.begin
|
||||
|
||||
[
|
||||
"]"
|
||||
"}"
|
||||
] @indent.branch
|
||||
] @indent.end @indent.branch
|
||||
|
||||
[
|
||||
"]"
|
||||
"}"
|
||||
] @indent.end
|
||||
(comment)
|
||||
] @indent.auto
|
||||
|
||||
@@ -7,3 +7,8 @@
|
||||
key4 = 4
|
||||
}
|
||||
}
|
||||
|
||||
# no indent after this line
|
||||
{
|
||||
another = 1
|
||||
}
|
||||
|
||||
@@ -20,5 +20,6 @@ describe("indent Nickel:", function()
|
||||
run:new_line("indent-newline.ncl", { on_line = 5, text = "stmt", indent = 2 })
|
||||
run:new_line("indent-newline.ncl", { on_line = 6, text = "stmt", indent = 4 })
|
||||
run:new_line("indent-newline.ncl", { on_line = 7, text = "}", indent = 2 })
|
||||
run:new_line("indent-newline.ncl", { on_line = 11, text = "stmt", indent = 0 })
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user