From accd88d55455b8c585b162242e6e4ede742afa99 Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Tue, 14 Feb 2023 20:53:55 +0100 Subject: [PATCH] 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. --- lisp/progmodes/js.el | 1 + lisp/progmodes/typescript-ts-mode.el | 1 + 2 files changed, 2 insertions(+) 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) -- 2.39.2