summaryrefslogtreecommitdiff
path: root/lisp/term.el
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2021-12-27 17:55:23 +0800
committerPo Lu <luangruo@yahoo.com>2021-12-27 17:56:12 +0800
commitcaa1699264e583d9703dd47e6162c6386775915f (patch)
treefde0718c86a3e6a0d74d2043732355484e9cff0b /lisp/term.el
parentd65534d254b3965ea82a9300c12c5c07f88818b7 (diff)
downloademacs-caa1699264e583d9703dd47e6162c6386775915f.tar.gz
Fix precision scrolling inside terminal buffers
* lisp/term.el (term-goto-process-mark-maybe): Don't move point to process mark if the event is a vertical wheel event.
Diffstat (limited to 'lisp/term.el')
-rw-r--r--lisp/term.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/term.el b/lisp/term.el
index e0a2f0a9a4b..5961350ff9e 100644
--- a/lisp/term.el
+++ b/lisp/term.el
@@ -3300,13 +3300,16 @@ Called as a buffer-local `post-command-hook' function in
`term-char-mode' to prevent commands from putting the buffer into
an inconsistent state by unexpectedly moving point.
-Mouse events are ignored so that mouse selection is unimpeded.
+Mouse and wheel events are ignored so that mouse selection and
+mouse wheel scrolling is unimpeded.
Only acts when the pre-command position of point was equal to the
process mark, and the `term-char-mode-point-at-process-mark'
option is enabled. See `term-set-goto-process-mark'."
(when term-goto-process-mark
- (unless (mouse-event-p last-command-event)
+ (unless (or (mouse-event-p last-command-event)
+ (memq (event-basic-type last-command-event)
+ '(wheel-down wheel-up)))
(goto-char (term-process-mark)))))
(defun term-process-mark ()