From: Theodor Thornhill Date: Tue, 14 Feb 2023 19:53:55 +0000 (+0100) Subject: Don't indent template_string contents (bug#61503) X-Git-Tag: emacs-29.0.90~426^2~19 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=accd88d55455b8c585b162242e6e4ede742afa99;p=emacs.git Don't indent template_string contents (bug#61503) * lisp/progmodes/js.el (js--treesit-indent-rules): Add new rule. * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--indent-rules): Add new rule. --- diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 05d69c314bb..1f08f09935b 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3442,6 +3442,7 @@ This function is intended for use in `after-change-functions'." ((parent-is "arguments") parent-bol js-indent-level) ((parent-is "array") parent-bol js-indent-level) ((parent-is "formal_parameters") parent-bol js-indent-level) + ((parent-is "template_string") no-indent) ; Don't indent the string contents. ((parent-is "template_substitution") parent-bol js-indent-level) ((parent-is "object_pattern") parent-bol js-indent-level) ((parent-is "object") parent-bol js-indent-level) diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index 561b90deedd..88a1ff3e202 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -86,6 +86,7 @@ Argument LANGUAGE is either `typescript' or `tsx'." ((parent-is "arguments") parent-bol typescript-ts-mode-indent-offset) ((parent-is "array") parent-bol typescript-ts-mode-indent-offset) ((parent-is "formal_parameters") parent-bol typescript-ts-mode-indent-offset) + ((parent-is "template_string") no-indent) ; Don't indent the string contents. ((parent-is "template_substitution") parent-bol typescript-ts-mode-indent-offset) ((parent-is "object_pattern") parent-bol typescript-ts-mode-indent-offset) ((parent-is "object") parent-bol typescript-ts-mode-indent-offset)