[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/typescript-mode a0f2c3ebd4 164/222: Reimplement template a
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/typescript-mode a0f2c3ebd4 164/222: Reimplement template auto conversion as a post-self-insert-hook |
Date: |
Sun, 6 Feb 2022 16:59:29 -0500 (EST) |
branch: elpa/typescript-mode
commit a0f2c3ebd4c7cde7f3c25f9cef12b679118d3351
Author: Louis-Dominique Dubeau <ldd@lddubeau.com>
Commit: Louis-Dominique Dubeau <ldd@lddubeau.com>
Reimplement template auto conversion as a post-self-insert-hook
This avoids bad interaction with delete-selection-mode and smartparens-mode.
---
typescript-mode.el | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/typescript-mode.el b/typescript-mode.el
index 1a0dcb5411..3ae8e16ae0 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -743,19 +743,16 @@ 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-autoconvert-to-template))
(define-key keymap (kbd "C-c '") #'typescript-convert-to-template)
keymap)
"Keymap for `typescript-mode'.")
-(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)))
- (call-interactively (lookup-key (current-global-map) key))
- (when typescript-autoconvert-to-template-flag
+(defun typescript--post-self-insert-function ()
+ (when (and (derived-mode-p 'typescript-mode)
+ typescript-autoconvert-to-template-flag
+ (or (eq last-command-event ?\')
+ (eq last-command-event ?\")))
(typescript-autoconvert-to-template)))
-(put 'typescript-insert-and-autoconvert-to-template 'delete-selection t)
;;; Syntax table and parsing
@@ -2843,6 +2840,9 @@ Key bindings:
(make-local-variable 'adaptive-fill-regexp)
(c-setup-paragraph-variables))
+ (add-hook 'post-self-insert-hook
+ #'typescript--post-self-insert-function)
+
(setq-local syntax-begin-function #'typescript--syntax-begin-function))
;; Set our custom predicate for flyspell prog mode
- [nongnu] elpa/typescript-mode 96800ed070 208/222: Migrate build to use proper tasks and new source for Emacs, (continued)
- [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, 2022/02/06
- [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 <=
- [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
- [nongnu] elpa/typescript-mode dd832751ab 217/222: Merge pull request #156 from zkry/fix-dot-after-exclamation-indentation, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 4249a20d6d 187/222: Added file for indent test case, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode c5e7788ce9 044/222: Merge pull request #28 from ananthakumaran/testing, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 99c2b74ac3 059/222: Make current-column function internal., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 89d22c4e18 051/222: Don't interpret forward slash in list as operator., ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 393ac6db0f 081/222: add tests for regexp font locking, ELPA Syncer, 2022/02/06
- [nongnu] elpa/typescript-mode 361564c4a9 057/222: typescript-current-column: Dont cause side-effects., ELPA Syncer, 2022/02/06