[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/typescript-mode 30391a518a 079/222: Fix indentation issue
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/typescript-mode 30391a518a 079/222: Fix indentation issue with conditional operators. |
Date: |
Sun, 6 Feb 2022 16:59:19 -0500 (EST) |
branch: elpa/typescript-mode
commit 30391a518a1d41d5c534a30850a50b0974132aec
Author: Louis-Dominique Dubeau <ldd@lddubeau.com>
Commit: Louis-Dominique Dubeau <ldd@lddubeau.com>
Fix indentation issue with conditional operators.
Prior to this change if the conditional operator had an object
in the true branch, indentation would fail.
---
test-files/indentation-reference-document.ts | 4 ++++
typescript-mode.el | 6 ++++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/test-files/indentation-reference-document.ts
b/test-files/indentation-reference-document.ts
index 2fdf6ef337..16522752b0 100644
--- a/test-files/indentation-reference-document.ts
+++ b/test-files/indentation-reference-document.ts
@@ -161,6 +161,10 @@ namespace ts.server {
2 :
3;
+ const e2 = b ?
+ { a: 1 } :
+ 3;
+
const f = window
.document;
diff --git a/typescript-mode.el b/typescript-mode.el
index a7f5970d2f..9d16f697d7 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -1906,8 +1906,10 @@ See `font-lock-keywords'.")
(and (looking-at typescript--indent-operator-re)
(or (not (looking-at ":"))
(save-excursion
- (and (typescript--re-search-backward "[?:{]\\|\\_<case\\_>" nil
t)
- (looking-at "?"))))
+ (backward-sexp)
+ (and
+ (typescript--re-search-backward "[?:{]\\|\\_<case\\_>" nil t)
+ (looking-at "?"))))
;; Do not identify forward slashes appearing in a "list" as
;; an operator. The lists are: arrays, or lists of
;; arguments. In this context, they must be part of regular
- [nongnu] elpa/typescript-mode c1aa1b2e7d 149/222: add better generics highlighting, (continued)
- [nongnu] elpa/typescript-mode c1aa1b2e7d 149/222: add better generics highlighting, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 1bafd279cf 148/222: Enable more colors (#110), ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 607897d583 151/222: Update Emacs Git to Xenial-build, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 42b366e669 153/222: Merge pull request #111 from tam5/master, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 2405090403 152/222: Handle CI-failures correctly., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 895cd7f425 173/222: Fix indentation infinite looping, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 9db704ec1f 185/222: Fix duplicate test name, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 4832652496 163/222: Support electric-layout-mode., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 710f5425a4 189/222: Add tests for typescript-indent-list-items option, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 1fd835e7f8 205/222: Fix typos in README, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 30391a518a 079/222: Fix indentation issue with conditional operators.,
ELPA Syncer <=
- [nongnu] elpa/typescript-mode 2d382d8bfb 053/222: Support rule names and severity in tslint reports., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 83579fac6e 070/222: Remove the explicit invocation of the mode hook., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode e700af4703 092/222: Use syntax-propertize-function to fontify regexps., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 1d32c6b3a8 066/222: Improve readability of the code., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 46e032e932 054/222: Fix list of values compilation mode should use., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 56a1ea861f 082/222: Merge pull request #55 from bkruczyk/fix-regex-font-locking, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 0353bd72f8 133/222: Add bigint, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 18dc5a36a6 140/222: Fixes typo in the README file., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 36105abbb1 141/222: Add 26.1 to the versions we test on., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 08ceb01ff3 142/222: We no longer support 24.3, fixes #100., ELPA Syncer, 2022/02/06