mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
fix: add more indentations for ruby (#3139)
This commit is contained in:
parent
ab3183107a
commit
9587db3d07
4 changed files with 19 additions and 0 deletions
|
|
@ -16,6 +16,8 @@
|
|||
(until)
|
||||
(for)
|
||||
(begin)
|
||||
(unless)
|
||||
(assignment)
|
||||
] @indent
|
||||
|
||||
[
|
||||
|
|
|
|||
2
tests/indent/ruby/indent-assignment.rb
Normal file
2
tests/indent/ruby/indent-assignment.rb
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
ret =
|
||||
2
|
||||
2
tests/indent/ruby/indent-unless.rb
Normal file
2
tests/indent/ruby/indent-unless.rb
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
unless true
|
||||
end
|
||||
13
tests/indent/ruby_spec.lua
Normal file
13
tests/indent/ruby_spec.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
local Runner = require("tests.indent.common").Runner
|
||||
|
||||
local run = Runner:new(it, "tests/indent/ruby", {
|
||||
shiftwidth = 2,
|
||||
expandtab = true,
|
||||
})
|
||||
|
||||
describe("indent Ruby:", function()
|
||||
describe("new line:", function()
|
||||
run:new_line("indent-unless.rb", { on_line = 1, text = "stmt", indent = 2 })
|
||||
run:new_line("indent-assignment.rb", { on_line = 1, text = "1 +", indent = 2 })
|
||||
end)
|
||||
end)
|
||||
Loading…
Add table
Add a link
Reference in a new issue