]> git.eshelyaron.com Git - emacs.git/commit
typescript-ts-mode: Improve function body indentation (bug#78121)
authorKonstantin Kharlamov <Hi-Angel@yandex.ru>
Tue, 29 Apr 2025 14:51:18 +0000 (21:51 +0700)
committerEshel Yaron <me@eshelyaron.com>
Sat, 7 Jun 2025 19:52:52 +0000 (21:52 +0200)
commitf47c8135db8d051951796534a6f97b38b72dcb26
tree139ab97bdcdf5275e63c62c6430f23a52378c48f
parent01fcf67957e8f5584d90d22acf15bf2896d52b9b
typescript-ts-mode: Improve function body indentation (bug#78121)

Older code was calculating body indentation depending on function
parameters alignment.  This is incorrect, because if parameters are
misaligned, so will the function body.  Instead, use offset of the
previous standalone parent.

* lisp/progmodes/typescript-ts-mode.el:
(typescript-ts-mode--indent-rules): Stop depending on function
parameters indentation for calculating body content and the closing
`}'.
* test/lisp/progmodes/typescript-ts-mode-resources/indent.erts:
(Function body with params misindented (bug#78121)): Add new test.

(cherry picked from commit 1d2ae31b8bcca5f00c3c707cc7af3a347749c332)
lisp/progmodes/typescript-ts-mode.el
test/lisp/progmodes/typescript-ts-mode-resources/indent.erts