[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/typescript-mode 6eaddf6c17 162/222: Drop the custom insert
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/typescript-mode 6eaddf6c17 162/222: Drop the custom insert-and-indent code in favor of electric-indent. |
Date: |
Sun, 6 Feb 2022 16:59:29 -0500 (EST) |
branch: elpa/typescript-mode
commit 6eaddf6c17bf4c4d80bcd042e5edeba7b84ad503
Author: Louis-Dominique Dubeau <ldd@lddubeau.com>
Commit: Louis-Dominique Dubeau <ldd@lddubeau.com>
Drop the custom insert-and-indent code in favor of electric-indent.
The custom code cause problems when delete-selection-mode and
smartparens-mode
were used together. That was probably one example of larger compatibility
issues
with the rest of the ecosystem. Letting electric-indent do the work that the
custom code did solves the problem.
---
typescript-mode.el | 20 +++-----------------
1 file changed, 3 insertions(+), 17 deletions(-)
diff --git a/typescript-mode.el b/typescript-mode.el
index 633aac1e20..b4632ba0dd 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -743,29 +743,12 @@ the string from a plain string to a template."
(defvar typescript-mode-map
(let ((keymap (make-sparse-keymap)))
- (dolist (key '("{" "}" "(" ")" ":" ";" ","))
- (define-key keymap key #'typescript-insert-and-indent))
(dolist (key '("\"" "\'"))
(define-key keymap key #'typescript-insert-and-autoconvert-to-template))
(define-key keymap (kbd "C-c '") #'typescript-convert-to-template)
keymap)
"Keymap for `typescript-mode'.")
-(defun typescript-insert-and-indent (key)
- "Run the command bound to KEY, and indent if necessary.
-Indentation does not take place if point is in a string or
-comment."
- (interactive (list (this-command-keys)))
- (call-interactively (lookup-key (current-global-map) key))
- (let ((syntax (save-restriction (widen) (syntax-ppss))))
- (when (or (and (not (nth 8 syntax))
- typescript-auto-indent-flag)
- (and (nth 4 syntax)
- (eq (current-column)
- (1+ (current-indentation)))))
- (indent-according-to-mode))))
-(put 'typescript-insert-and-indent 'delete-selection t)
-
(defun typescript-insert-and-autoconvert-to-template (key)
"Run the command bount to KEY, and autoconvert to template if necessary."
(interactive (list (this-command-keys)))
@@ -2845,6 +2828,9 @@ Key bindings:
c-comment-start-regexp "/[*/]\\|\\s!"
comment-start-skip "\\(//+\\|/\\*+\\)\\s *")
+ (setq-local electric-indent-chars
+ (append "{}():;," electric-indent-chars))
+
(let ((c-buffer-is-cc-mode t))
;; FIXME: These are normally set by `c-basic-common-init'. Should
;; we call it instead? (Bug#6071)
- [nongnu] elpa/typescript-mode 5931f2776d 049/222: Add keyof keyword., (continued)
- [nongnu] elpa/typescript-mode 5931f2776d 049/222: Add keyof keyword., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 782e8dd32e 071/222: Add fontification support for jsdoc/typedoc tags., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode f6d28c7a0d 073/222: Remove the fontification hack., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 4b69ca57f5 080/222: Simplify regexp literal, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 7249d76e2d 097/222: Merge pull request #64 from dakra/master, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode d1ddaad259 089/222: Fix indentation of continued expressions., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 526f307ca8 101/222: Fontify yield and yield* as keyword, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 67d67f0c20 099/222: Typo in the readme, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode b5e3f2a8a6 100/222: Merge pull request #68 from GeertVL/patch-1, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode a5f342e539 160/222: Add snake_cased function call to regression test suite, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 6eaddf6c17 162/222: Drop the custom insert-and-indent code in favor of electric-indent.,
ELPA Syncer <=
- [nongnu] elpa/typescript-mode 0fc7297870 184/222: Add compilation-mode support for ng lint too., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode b6cd68ae77 177/222: Add test-cases for type-highlights supported so far., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 102587e458 183/222: Merge pull request #132 from jkdufair/master, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode e6f68ab2dd 198/222: Fontify basic types over keywords., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode fb44319479 197/222: Merge pull request #125 from Fuco1/fix/prefer-constant-over-keyword, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode ae32e1c28f 193/222: Use ‘insert-file-contents’ instead of ‘find-file’ for tests., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode bbbe50aade 194/222: Merge pull request #140 from phst/find-file, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 996fb729ca 201/222: Update README.md, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode c9b22f5f33 215/222: Merge pull request #152 from Rogach/pr/fix-indentation-when-lexical-scoping, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 47b7fd239e 214/222: add a test for error thrown if typescript-mode is loaded with lexical scoping enabled, ELPA Syncer, 2022/02/06