emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 accd88d554: Don't indent template_string contents (bug#61503)


From: Theodor Thornhill
Subject: emacs-29 accd88d554: Don't indent template_string contents (bug#61503)
Date: Tue, 14 Feb 2023 14:55:46 -0500 (EST)

branch: emacs-29
commit accd88d55455b8c585b162242e6e4ede742afa99
Author: Theodor Thornhill <theo@thornhill.no>
Commit: Theodor Thornhill <theo@thornhill.no>

    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 05d69c314b..1f08f09935 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 561b90deed..88a1ff3e20 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]