mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat(python): add match-case indents
This commit is contained in:
parent
a072d923c7
commit
1ffa019856
3 changed files with 23 additions and 0 deletions
15
tests/indent/python/match_case.py
Normal file
15
tests/indent/python/match_case.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
a = 0
|
||||
|
||||
def test_match_case():
|
||||
match a:
|
||||
case 1:
|
||||
return
|
||||
|
||||
|
||||
def test_match():
|
||||
match a:
|
||||
|
||||
|
||||
def test_case():
|
||||
match a:
|
||||
case b:
|
||||
|
|
@ -84,6 +84,10 @@ describe("indent Python:", function()
|
|||
run:new_line("line_after_indent.py", { on_line = 49, text = "x", indent = 0 })
|
||||
run:new_line("line_after_indent.py", { on_line = 55, text = "x", indent = 4 })
|
||||
run:new_line("line_after_indent.py", { on_line = 63, text = "x", indent = 4 })
|
||||
run:new_line("match_case.py", { on_line = 4, text = "pass", indent = 8 })
|
||||
run:new_line("match_case.py", { on_line = 5, text = "pass", indent = 12 })
|
||||
run:new_line("match_case.py", { on_line = 10, text = "pass", indent = 8 })
|
||||
run:new_line("match_case.py", { on_line = 15, text = "pass", indent = 12 })
|
||||
|
||||
for _, line in ipairs { 2, 5, 8, 11, 16, 21, 24, 27, 34, 39 } do
|
||||
run:new_line("return_dedent.py", { on_line = line, text = "x", indent = 0 })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue