diff options
author | Arun Isaac | 2022-06-12 23:48:15 +0530 |
---|---|---|
committer | Arun Isaac | 2022-06-12 23:51:50 +0530 |
commit | dc546ddc7865d910b8e90f5f79585da72bdbd7d1 (patch) | |
tree | 4474628f680915f4acbf5be94840454761b4e7cb | |
parent | 27660c79ba7df243be33121782f39e381f0dcc34 (diff) | |
download | thogai-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.el | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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) |