branch: externals/crdt
commit 7c9d7eea70623984615f83b0609a7681aea2680b
Author: Qiantan Hong <[email protected]>
Commit: Qiantan Hong <[email protected]>

    avoid spitting error when POSITION-HINT out of range
---
 crdt.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crdt.el b/crdt.el
index c2d5fd5..6f35306 100644
--- a/crdt.el
+++ b/crdt.el
@@ -750,7 +750,7 @@ Start the search from POS."
   (let* ((left-pos (previous-single-property-change (min (1+ pos) (point-max))
                                                     'crdt-id nil (point-min)))
          (left-id (crdt--get-starting-id left-pos))
-         (right-pos (next-single-property-change pos 'crdt-id nil (point-max)))
+         (right-pos (next-single-property-change (min pos (point-max)) 
'crdt-id nil (point-max)))
          (right-id (crdt--get-starting-id right-pos))
          (moving-forward nil))
     (cl-macrolet ((move-forward ()

Reply via email to