From 451b7a6d9d753a57bb0a660460f8f5fc0e3c491f Mon Sep 17 00:00:00 2001 From: charlie Date: Tue, 12 Mar 2024 16:51:02 +0800 Subject: [PATCH] fix(editor): incorrect cursor move for the emoji from the line head --- src/main/frontend/util/cursor.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/frontend/util/cursor.cljs b/src/main/frontend/util/cursor.cljs index e49ff3251..ef7b231c7 100644 --- a/src/main/frontend/util/cursor.cljs +++ b/src/main/frontend/util/cursor.cljs @@ -71,7 +71,7 @@ ([input n] (when input (let [{:keys [pos]} (get-caret-pos input) - pos (if (and (= n 1) (not (zero? pos))) + pos (if (= n 1) (or (util/safe-inc-current-pos-from-start (.-value input) pos) (inc pos)) (+ pos n))]