branch: elpa/typescript-mode
commit f33751e98f0b7f87f8c4a9a9e3dfd6c6fa4f7b31
Author: Louis-Dominique Dubeau <[email protected]>
Commit: Louis-Dominique Dubeau <[email protected]>

    Fix a case of bad indentation.
    
    Fixes #107
---
 typescript-mode.el | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/typescript-mode.el b/typescript-mode.el
index e9632d70dd..178e4283c8 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -2070,14 +2070,20 @@ This performs fontification according to 
`typescript--class-styles'."
   
"\\(?:NaN\\|-?\\(?:0[Bb][01]+\\|0[Oo][0-7]+\\|0[Xx][0-9a-fA-F]+\\|Infinity\\|\\(?:[[:digit:]]*\\.[[:digit:]]+\\|[[:digit:]]+\\)\\(?:[Ee][+-]?[[:digit:]]+\\)?\\)\\)"
   "Regexp that matches number literals.")
 
-(defconst typescript--reserved-start-keywords-re
-  (typescript--regexp-opt-symbol '("const" "export" "function" "let" "var"))
+(defconst typescript--reserved-start-keywords
+  '("const" "export" "function" "let" "var")
   "These keywords cannot be variable or type names and start a new sentence.
 Note that the \"import\" keyword can be a type import since TS2.9, so it might
 not start a sentence!")
 
+(defconst typescript--reserved-start-keywords-re
+  (typescript--regexp-opt-symbol '("const" "export" "function" "let" "var"))
+  "A regular expression matching `typescript--reserved-start-keywords'.")
+
 (defconst typescript--type-vs-ternary-re
-  (concat "[?]\\|" (typescript--regexp-opt-symbol '("as" "class" "interface" 
"private" "public" "readonly")))
+  (concat "[?]\\|" (typescript--regexp-opt-symbol
+                    (append typescript--reserved-start-keywords
+                            '("as" "class" "interface" "private" "public" 
"readonly"))))
   "Keywords/Symbols that help tell apart colon for types vs ternary 
operators.")
 
 (defun typescript--search-backward-matching-angle-bracket-inner (depth)

Reply via email to