aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-06-12 23:48:15 +0530
committerArun Isaac2022-06-12 23:51:50 +0530
commitdc546ddc7865d910b8e90f5f79585da72bdbd7d1 (patch)
tree4474628f680915f4acbf5be94840454761b4e7cb
parent27660c79ba7df243be33121782f39e381f0dcc34 (diff)
downloadthogai-dc546ddc7865d910b8e90f5f79585da72bdbd7d1.tar.gz
thogai-dc546ddc7865d910b8e90f5f79585da72bdbd7d1.tar.lz
thogai-dc546ddc7865d910b8e90f5f79585da72bdbd7d1.zip
When undoing, delete space only if there is a space.
Attached and glued strokes don't emit spaces. So, we cannot mindlessly delete the last character without checking if it is a space. * thogai.el (thogai-insert-stroke): When undoing, delete space only if there actually is a space.
-rw-r--r--thogai.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/thogai.el b/thogai.el
index 8e1f5be..b863018 100644
--- a/thogai.el
+++ b/thogai.el
@@ -317,10 +317,12 @@ should typically be `thogai-stroke-ring'."
;; Reverse the previous group of strokes.
(thogai-reverse-strokes matched-strokes)
;; Delete space before strokes unless we are at the
- ;; beginning of the line.
+ ;; beginning of the line. Note that attached and glued
+ ;; strokes do not emit spaces. So, we cannot mindlessly
+ ;; delete a character without checking if it is a space.
(unless (= (line-beginning-position)
(point))
- (delete-char -1))
+ (thogai-delete " "))
;; Re-insert the previous group of strokes except for the
;; newest stroke.
(pcase (reverse matched-strokes)