From 4fba57e954f7d863e530553d3195298439309eab Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 17 May 2018 12:11:19 +0200 Subject: [PATCH] Fix trapped-in-prompt cursor issue in minibuffer --- core/core-ui.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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)