diff --git a/core/core-ui.el b/core/core-ui.el index 9ab5ad7c8..604916c45 100644 --- a/core/core-ui.el +++ b/core/core-ui.el @@ -374,12 +374,11 @@ from the default." ;; (defun doom*silence-motion-errors (orig-fn &rest args) - (if (and (minibufferp) - (<= (point) (minibuffer-prompt-end))) - (progn - (ignore-errors (apply orig-fn args)) - (goto-char (minibuffer-prompt-end))) - (apply orig-fn args))) + (if (not (minibufferp)) + (apply orig-fn args) + (ignore-errors (apply orig-fn args)) + (when (<= (point) (minibuffer-prompt-end)) + (goto-char (minibuffer-prompt-end))))) (advice-add #'left-char :around #'doom*silence-motion-errors) (advice-add #'right-char :around #'doom*silence-motion-errors)