Skip to content

Commit 47e8952

Browse files
committed
fix: comma between rows in table
1 parent b96b9b6 commit 47e8952

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed

languages/nu.scm

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -354,22 +354,36 @@
354354
entry: _ @append_begin_scope
355355
.
356356
entry: _ @prepend_spaced_softline @prepend_end_scope
357-
(#multi_line_only!)
358357
(#scope_id! "consecutive_scope")
358+
(#multi_line_only!)
359359
)
360360

361361
(record_body
362362
entry: _ @append_delimiter
363-
(#multi_line_only!)
364363
(#delimiter! ",")
364+
(#multi_line_only!)
365365
)
366366

367367
(record_body
368368
entry: _ @append_begin_scope
369369
.
370370
entry: _ @prepend_spaced_softline @prepend_end_scope
371-
(#multi_line_only!)
372371
(#scope_id! "consecutive_scope")
372+
(#multi_line_only!)
373+
)
374+
375+
(val_table
376+
row: _ @append_delimiter
377+
.
378+
row: _
379+
(#delimiter! ", ")
380+
(#single_line_only!)
381+
)
382+
383+
(val_table
384+
row: _ @append_delimiter @prepend_spaced_softline
385+
(#delimiter! ",")
386+
(#multi_line_only!)
373387
)
374388

375389
(ctrl_match
@@ -397,10 +411,6 @@
397411
(#delimiter! ",")
398412
)
399413

400-
(val_table
401-
row: _ @prepend_spaced_softline
402-
)
403-
404414
;; type notation
405415
(collection_type
406416
[

test/expected_data.nu

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,12 @@ export const config = {
247247
],
248248
}
249249

250-
const table = [[a, b]; [1, 2] [2, [4, 4]]]
250+
const table = [[a, b]; [1, 2], [2, [4, 4]]]
251+
const multi_line_table = [
252+
[a, b];
253+
[1, 2],
254+
[2, [4, 4]],
255+
]
251256
const table_no_row = [[a, b]; ]
252257

253258
mut foo: record<"a", b, "c": int, d: list<any>> = {}

test/input_data.nu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ export const config = {
248248
}
249249

250250
const table = [[a b]; [1 2] [2 [4 4]]]
251+
const multi_line_table = [[a b]; [1 2]
252+
[2 [4 4]]]
251253
const table_no_row = [[a b];]
252254

253255
mut foo : record<"a", b "c": int d: list<any>> = {}

0 commit comments

Comments
 (0)