branch: externals/cm-mode
commit 04cc2db46fe8f19790c0bbb7e1a5ecc7847fecf6
Author: Joost Kremers <[email protected]>
Commit: Joost Kremers <[email protected]>

    Correctly move into the markup when inserting a substitution or a comment.
---
 cm-mode.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cm-mode.el b/cm-mode.el
index 1ccdf37633..ec5bb51067 100644
--- a/cm-mode.el
+++ b/cm-mode.el
@@ -368,7 +368,7 @@ point will then be left before the deletion markup."
   (cm-without-following-changes
     (let ((text (delete-and-extract-region beg end)))
       (cm-insert-markup 'cm-substitution text)
-      (backward-char 3)))) ; TODO account for comment
+      (cm-move-into-markup 'cm-substitution))))
 
 (defun cm-comment (beg end)
   "Add a comment.
@@ -389,7 +389,7 @@ If point is in an existing change, the comment is added 
after it."
       (if text
           (cm-insert-markup 'cm-highlight text)
         (cm-insert-markup 'cm-comment))
-      (backward-char 3)))) ; TODO account for comment if we've inserted a 
highlight
+      (cm-move-into-markup 'cm-comment))))
 
 (defun cm-point-at-delim (delim &optional end strict)
   "Return non-NIL if point is at a delimiter.

Reply via email to