aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp
diff options
context:
space:
mode:
authorjohn muhl2024-11-10 11:26:33 -0600
committerEli Zaretskii2024-11-14 10:14:46 +0200
commitd592832504554c6ee30bea263e55dc84feaec18d (patch)
treec0f14eddc82e6c74d45cbeec99ad46d1af7c4c42 /test/lisp
parent6bc44ccf287a398d47563ddf60d13784cd64720f (diff)
downloademacs-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.erts42
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
362end 362end
363
364 --[[
365Long 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
375end 379end
380
381 --[[
382Long comment.
383 ]]
384=-=-=
385
386Name: Comment Indent
387
388=-=
389local fn1 = function (a, b)
390-- comment
391return a + b
392end
393
394local tb1 = {
395 first = 1,
396-- comment
397 second = 2,
398}
399
400local tb9 = { one = 1,
401-- comment
402 two = 2 }
403=-=
404local fn1 = function (a, b)
405 -- comment
406 return a + b
407end
408
409local tb1 = {
410 first = 1,
411 -- comment
412 second = 2,
413}
414
415local tb9 = { one = 1,
416 -- comment
417 two = 2 }
376=-=-= 418=-=-=
377 419
378Name: Argument Indent 420Name: Argument Indent