Fix trapped-in-prompt cursor issue in minibuffer
This commit is contained in:
parent
022baf808c
commit
4fba57e954
1 changed files with 5 additions and 6 deletions
|
@ -374,12 +374,11 @@ from the default."
|
||||||
;;
|
;;
|
||||||
|
|
||||||
(defun doom*silence-motion-errors (orig-fn &rest args)
|
(defun doom*silence-motion-errors (orig-fn &rest args)
|
||||||
(if (and (minibufferp)
|
(if (not (minibufferp))
|
||||||
(<= (point) (minibuffer-prompt-end)))
|
(apply orig-fn args)
|
||||||
(progn
|
|
||||||
(ignore-errors (apply orig-fn args))
|
(ignore-errors (apply orig-fn args))
|
||||||
(goto-char (minibuffer-prompt-end)))
|
(when (<= (point) (minibuffer-prompt-end))
|
||||||
(apply orig-fn args)))
|
(goto-char (minibuffer-prompt-end)))))
|
||||||
|
|
||||||
(advice-add #'left-char :around #'doom*silence-motion-errors)
|
(advice-add #'left-char :around #'doom*silence-motion-errors)
|
||||||
(advice-add #'right-char :around #'doom*silence-motion-errors)
|
(advice-add #'right-char :around #'doom*silence-motion-errors)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue