emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/typescript-mode a6e0eac105 029/222: Fix wrong cursor posit


From: ELPA Syncer
Subject: [nongnu] elpa/typescript-mode a6e0eac105 029/222: Fix wrong cursor position in `typescript-indent-line`
Date: Sun, 6 Feb 2022 16:59:02 -0500 (EST)

branch: elpa/typescript-mode
commit a6e0eac105759d57f41626ef0590ec724ee673f3
Author: hekt <hektorg@gmail.com>
Commit: hekt <hektorg@gmail.com>

    Fix wrong cursor position in `typescript-indent-line`
    
    Cursor jumps to wrong position when editing line includes tab or
    fullwidth character. Because `(current-column)` counts there
    as 2 or more characters.
---
 typescript-mode.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/typescript-mode.el b/typescript-mode.el
index 52ec3dc2ca..3cb12e06c1 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -1769,7 +1769,7 @@ nil."
     (widen)
     (let* ((parse-status
             (save-excursion (syntax-ppss (point-at-bol))))
-           (offset (- (current-column) (current-indentation))))
+           (offset (- (point) (line-beginning-position) 
(current-indentation))))
       (indent-line-to (typescript--proper-indentation parse-status))
       (when (> offset 0) (forward-char offset)))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]