diff options
| author | Stephan Seitz <stephan.seitz@fau.de> | 2022-01-21 21:34:16 +0100 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-02-05 18:54:55 +0100 |
| commit | 3ff725e654ea01c32852f856413c060e8e2fa80d (patch) | |
| tree | f46c99ac3517cf0541bf5cd7d8a03abe042dc78a | |
| parent | ci: combine "Compile parsers" steps into a single step (diff) | |
| download | nvim-treesitter-3ff725e654ea01c32852f856413c060e8e2fa80d.tar nvim-treesitter-3ff725e654ea01c32852f856413c060e8e2fa80d.tar.gz nvim-treesitter-3ff725e654ea01c32852f856413c060e8e2fa80d.tar.bz2 nvim-treesitter-3ff725e654ea01c32852f856413c060e8e2fa80d.tar.lz nvim-treesitter-3ff725e654ea01c32852f856413c060e8e2fa80d.tar.xz nvim-treesitter-3ff725e654ea01c32852f856413c060e8e2fa80d.tar.zst nvim-treesitter-3ff725e654ea01c32852f856413c060e8e2fa80d.zip | |
indents(c): fix ternary
| -rw-r--r-- | queries/c/indents.scm | 1 | ||||
| -rw-r--r-- | tests/indent/c_spec.lua | 3 | ||||
| -rw-r--r-- | tests/indent/cpp_spec.lua | 3 |
3 files changed, 2 insertions, 5 deletions
diff --git a/queries/c/indents.scm b/queries/c/indents.scm index 959678f6e..7803a477f 100644 --- a/queries/c/indents.scm +++ b/queries/c/indents.scm @@ -4,7 +4,6 @@ (preproc_arg) (field_declaration_list) (case_statement) - (conditional_expression) (enumerator_list) (struct_specifier) (compound_literal_expression) diff --git a/tests/indent/c_spec.lua b/tests/indent/c_spec.lua index 5a7baa916..58ee96022 100644 --- a/tests/indent/c_spec.lua +++ b/tests/indent/c_spec.lua @@ -12,7 +12,6 @@ describe("indent C:", function() describe("whole file:", function() runner:whole_file(".", { expected_failures = { - "./ternary.c", "./preproc_func.c", "./label.c", "./comment.c", @@ -37,7 +36,7 @@ describe("indent C:", function() runner:new_line("string.c", { on_line = 4, text = '"brave new "', indent = 4 }) runner:new_line("struct.c", { on_line = 4, text = "int y;", indent = 8 }) runner:new_line("switch.c", { on_line = 3, text = "x++;", indent = 12 }) - runner:new_line("ternary.c", { on_line = 4, text = ": (x == 0) : 0", indent = 8 }, "expected failure", XFAIL) + runner:new_line("ternary.c", { on_line = 4, text = ": (x == 0) : 0", indent = 8 }) -- the line after inserted one will be left with wrong indent but we only care about the inserted one runner:new_line("no_braces.c", { on_line = 4, text = "x++;", indent = 8 }) runner:new_line("no_braces.c", { on_line = 7, text = "x++;", indent = 8 }) diff --git a/tests/indent/cpp_spec.lua b/tests/indent/cpp_spec.lua index 693279b89..ab7ae407f 100644 --- a/tests/indent/cpp_spec.lua +++ b/tests/indent/cpp_spec.lua @@ -15,7 +15,6 @@ describe("indent C++:", function() run:whole_file({ "c/", "cpp/" }, { expected_failures = { -- C - "c/ternary.c", "c/preproc_func.c", "c/label.c", "c/comment.c", @@ -44,7 +43,7 @@ describe("indent C++:", function() run:new_line("c/string.c", { on_line = 4, text = '"brave new "', indent = 4 }) run:new_line("c/struct.c", { on_line = 4, text = "int y;", indent = 8 }) run:new_line("c/switch.c", { on_line = 3, text = "x++;", indent = 12 }) - run:new_line("c/ternary.c", { on_line = 4, text = ": (x == 0) : 0", indent = 8 }, "expected failure", XFAIL) + run:new_line("c/ternary.c", { on_line = 4, text = ": (x == 0) : 0", indent = 8 }) -- the line after inserted one will be left with wrong indent but we only care about the inserted one run:new_line("c/no_braces.c", { on_line = 4, text = "x++;", indent = 8 }) run:new_line("c/no_braces.c", { on_line = 7, text = "x++;", indent = 8 }) |
