[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/typescript-mode 2cd997a8d5 102/222: Fix typescript--backwa
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/typescript-mode 2cd997a8d5 102/222: Fix typescript--backward-to-parameter-list |
Date: |
Sun, 6 Feb 2022 16:59:22 -0500 (EST) |
branch: elpa/typescript-mode
commit 2cd997a8d52c3a3e3fb1442227794bad27f1802f
Author: Louis-Dominique Dubeau <ldd@lddubeau.com>
Commit: Louis-Dominique Dubeau <ldd@lddubeau.com>
Fix typescript--backward-to-parameter-list
Fix typescript--backward-to-parameter-list to avoid walking over
constructs like `switch (...)`, `for (...)`, etc.
---
test-files/switch-case-indent-default.ts | 8 ++++++++
typescript-mode.el | 6 +++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/test-files/switch-case-indent-default.ts
b/test-files/switch-case-indent-default.ts
index b1af8804b5..788b78f4c0 100644
--- a/test-files/switch-case-indent-default.ts
+++ b/test-files/switch-case-indent-default.ts
@@ -3,7 +3,15 @@ function indentTest(): any {
case: 1,
default: 2
};
+
+ // This function was specifically added to test for a reversion in
+ // the code that indents switch statements.
+ function turnip(): void {
+ }
+
switch (process.platform) {
+ case "moo":
+ break;
case "win32": {
const basePath = process.env.LOCALAPPDATA ||
process.env.APPDATA;
diff --git a/typescript-mode.el b/typescript-mode.el
index 1d5536f0bc..12bd16e79c 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -2180,7 +2180,11 @@ moved on success."
;; The earlier test for dotted names comes into play if
the
;; logic moves over one part of a dotted name at a time
(which
;; is what `backward-sexp` normally does).
- (looking-back typescript--dotted-name-re nil))
+ (and (looking-back typescript--dotted-name-re nil)
+ ;; We don't want the loop to walk over constructs
like switch (...) or for (...), etc.
+ (not (save-excursion
+ (backward-word)
+ (looking-at
"\\_<\\(switch\\|if\\|while\\|until\\|for\\)\\_>\\(?:\\s-\\|\n\\)*(")))))
(condition-case nil
(backward-sexp)
(scan-error nil)))
- [nongnu] elpa/typescript-mode 6ae2c7ab9e 135/222: Highlight multiple implements types (#96), (continued)
- [nongnu] elpa/typescript-mode 6ae2c7ab9e 135/222: Highlight multiple implements types (#96), ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 761f3aec6e 161/222: Fix issues reported by package-lint, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode e82a4d2527 170/222: Add a new indentation test case that triggers an infinite loop., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 54f14c4827 202/222: Update README.md, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode b369d7d251 206/222: Merge pull request #147 from ltrel/typo-fixes, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode bc37bc4b15 176/222: Fix another member expression infinite loop., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 1e9fc35cb9 210/222: Make cask and emacs locations overridable., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 96800ed070 208/222: Migrate build to use proper tasks and new source for Emacs, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode e824162051 222/222: Merge pull request #159 from tancnle/fix-cl-deprecation-warnings, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 5b0487aae8 085/222: Fix the Emacs regex used for highlighting TS regexes., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 2cd997a8d5 102/222: Fix typescript--backward-to-parameter-list,
ELPA Syncer <=
- [nongnu] elpa/typescript-mode 2815dd1b4b 098/222: Add option to support indented case-statements. Fixes #23 (#66), ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 861d5983b6 090/222: Make the comment-start and comment-end variables local., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 4e3850dd2a 105/222: Remove logic handling preprocessor macros, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 32f5034e9d 127/222: Extract tests as general tests, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode e15e2bfa1a 131/222: Add jsdoc tests, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode c0f11efdfd 143/222: Fixing typescript--forward-expression for multiline indented string, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode a0f2c3ebd4 164/222: Reimplement template auto conversion as a post-self-insert-hook, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode b44b75dbe1 172/222: Add test case for infinite loop, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 5bf30fe8d6 175/222: Add member expressions tests involving type parameters., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 1c27fb09ed 220/222: Fix cl deprecation warning, ELPA Syncer, 2022/02/06