diff options
| author | Riley Bruins <ribru17@hotmail.com> | 2024-07-03 19:13:16 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-04 11:13:16 +0900 |
| commit | fa611f612a7b04c239d07f61ba80e09cb95c5af4 (patch) | |
| tree | 97f80f2b28bfb731854f8eaf264fed162f01dd4b /tests/indent | |
| parent | fix(prolog): switch to github mirror (diff) | |
| download | nvim-treesitter-fa611f612a7b04c239d07f61ba80e09cb95c5af4.tar nvim-treesitter-fa611f612a7b04c239d07f61ba80e09cb95c5af4.tar.gz nvim-treesitter-fa611f612a7b04c239d07f61ba80e09cb95c5af4.tar.bz2 nvim-treesitter-fa611f612a7b04c239d07f61ba80e09cb95c5af4.tar.lz nvim-treesitter-fa611f612a7b04c239d07f61ba80e09cb95c5af4.tar.xz nvim-treesitter-fa611f612a7b04c239d07f61ba80e09cb95c5af4.tar.zst nvim-treesitter-fa611f612a7b04c239d07f61ba80e09cb95c5af4.zip | |
fix(ecma): indent single-line if statements (#6846)
Fixes #5898.
Diffstat (limited to 'tests/indent')
| -rw-r--r-- | tests/indent/ecma/if_else.js | 6 | ||||
| -rw-r--r-- | tests/indent/javascript_spec.lua | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/indent/ecma/if_else.js b/tests/indent/ecma/if_else.js index 4f971c8fc..990ccd19a 100644 --- a/tests/indent/ecma/if_else.js +++ b/tests/indent/ecma/if_else.js @@ -11,3 +11,9 @@ if (cond1) { } else { do_fallback() } + +if (true) + console.log('hi') +console.log('hi') + +if (true) diff --git a/tests/indent/javascript_spec.lua b/tests/indent/javascript_spec.lua index 827539eeb..5659b22a1 100644 --- a/tests/indent/javascript_spec.lua +++ b/tests/indent/javascript_spec.lua @@ -75,6 +75,8 @@ describe("indent JavaScript:", function() { 9, 2 }, { 12, 2 }, { 13, 0 }, + { 16, 0 }, + { 19, 2 }, } do run:new_line("ecma/if_else.js", { on_line = info[1], text = "hello()", indent = info[2] }, info[3], info[4]) end |
