From a3d29af7cc624c18540c1fc0185fb3546381eb37 Mon Sep 17 00:00:00 2001 From: Lin Sun Date: Thu, 11 Apr 2024 06:58:09 +0000 Subject: [PATCH] Fix backtrack on doubleclick in vterm --- vterm.el | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/vterm.el b/vterm.el index 04c9058..48bf622 100644 --- a/vterm.el +++ b/vterm.el @@ -1166,12 +1166,9 @@ Argument ARG is passed to `yank'" But when clicking to the unused area below the last prompt, move the cursor to the prompt area." (interactive "e\np") - (let ((pt (mouse-set-point event promote-to-region))) - (if (= (count-words pt (point-max)) 0) - (vterm-reset-cursor-point) - pt)) - ;; Otherwise it selects text for every other click - (keyboard-quit)) + (if (> (count-words (posn-point (event-end event)) (point-max)) 0) + (mouse-set-point event promote-to-region) + (vterm-reset-cursor-point))) (defun vterm-send-string (string &optional paste-p) "Send the string STRING to vterm.