diff options
| author | john muhl | 2024-11-10 11:26:33 -0600 |
|---|---|---|
| committer | Eli Zaretskii | 2024-11-14 10:14:46 +0200 |
| commit | d592832504554c6ee30bea263e55dc84feaec18d (patch) | |
| tree | c0f14eddc82e6c74d45cbeec99ad46d1af7c4c42 /test/lisp | |
| parent | 6bc44ccf287a398d47563ddf60d13784cd64720f (diff) | |
| download | emacs-d592832504554c6ee30bea263e55dc84feaec18d.tar.gz emacs-d592832504554c6ee30bea263e55dc84feaec18d.zip | |
Improve comment indenting in 'lua-ts-mode'
* lisp/progmodes/lua-ts-mode.el (lua-ts--simple-indent-rules):
Align single line comments with the surrounding context.
(lua-ts--comment-first-sibling-matcher): Check that comment is
the first sibling.
(lua-ts--multi-line-comment-start): New function.
* test/lisp/progmodes/lua-ts-mode-resources/indent.erts:
Add tests. (Bug#74298)
Diffstat (limited to 'test/lisp')
| -rw-r--r-- | test/lisp/progmodes/lua-ts-mode-resources/indent.erts | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/lisp/progmodes/lua-ts-mode-resources/indent.erts b/test/lisp/progmodes/lua-ts-mode-resources/indent.erts index ba7bad1b452..b0ece4cc261 100644 --- a/test/lisp/progmodes/lua-ts-mode-resources/indent.erts +++ b/test/lisp/progmodes/lua-ts-mode-resources/indent.erts | |||
| @@ -360,6 +360,10 @@ multi-line | |||
| 360 | ]] | 360 | ]] |
| 361 | return true | 361 | return true |
| 362 | end | 362 | end |
| 363 | |||
| 364 | --[[ | ||
| 365 | Long comment. | ||
| 366 | ]] | ||
| 363 | =-= | 367 | =-= |
| 364 | --[[ | 368 | --[[ |
| 365 | Multi-line | 369 | Multi-line |
| @@ -373,6 +377,44 @@ multi-line | |||
| 373 | ]] | 377 | ]] |
| 374 | return true | 378 | return true |
| 375 | end | 379 | end |
| 380 | |||
| 381 | --[[ | ||
| 382 | Long comment. | ||
| 383 | ]] | ||
| 384 | =-=-= | ||
| 385 | |||
| 386 | Name: Comment Indent | ||
| 387 | |||
| 388 | =-= | ||
| 389 | local fn1 = function (a, b) | ||
| 390 | -- comment | ||
| 391 | return a + b | ||
| 392 | end | ||
| 393 | |||
| 394 | local tb1 = { | ||
| 395 | first = 1, | ||
| 396 | -- comment | ||
| 397 | second = 2, | ||
| 398 | } | ||
| 399 | |||
| 400 | local tb9 = { one = 1, | ||
| 401 | -- comment | ||
| 402 | two = 2 } | ||
| 403 | =-= | ||
| 404 | local fn1 = function (a, b) | ||
| 405 | -- comment | ||
| 406 | return a + b | ||
| 407 | end | ||
| 408 | |||
| 409 | local tb1 = { | ||
| 410 | first = 1, | ||
| 411 | -- comment | ||
| 412 | second = 2, | ||
| 413 | } | ||
| 414 | |||
| 415 | local tb9 = { one = 1, | ||
| 416 | -- comment | ||
| 417 | two = 2 } | ||
| 376 | =-=-= | 418 | =-=-= |
| 377 | 419 | ||
| 378 | Name: Argument Indent | 420 | Name: Argument Indent |