branch: elpa/typescript-mode
commit e02a73415108e5d368aa491982a01c1c6ba9b3f1
Author: Jostein Kjønigsen <[email protected]>
Commit: Jostein Kjønigsen <[email protected]>
Improve test-coverage.
---
typescript-mode-tests.el | 9 +++++++++
typescript-mode.el | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/typescript-mode-tests.el b/typescript-mode-tests.el
index 6e135f8090..c7fa26fceb 100644
--- a/typescript-mode-tests.el
+++ b/typescript-mode-tests.el
@@ -106,6 +106,15 @@ a severity set to WARNING, no rule name."
(insert "大塚愛")
(should (equal 3 (typescript-current-column)))))
+(ert-deftest correctly-accounts-wide-chars-as-1-char-without-sideeffects ()
+ "Otsuka Ai and other multi-char users should be a happy to write typescript."
+
+ (with-temp-buffer
+ (insert "大塚愛")
+ (let ((pos1 (typescript-current-column))
+ (pos2 (typescript-current-column)))
+ (should (equal pos1 pos2)))))
+
(provide 'typescript-mode-tests)
;;; typescript-mode-tests.el ends here
diff --git a/typescript-mode.el b/typescript-mode.el
index d6988ff87a..07466125db 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -1799,7 +1799,7 @@ nil."
"Unicode aware version of `CURRENT-COLUMN' which correctly accounts for wide
characters."
(save-excursion
- (let* ((end (point)))
+ (let ((end (point)))
(move-beginning-of-line nil)
(- end (point)))))