changeset 106362:d19d1b12196e

(comint-insert-input): Ignore clicks to the right of the field. Reported by Bob Nnamtrop <bobnnamtrop@gmail.com>.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 01 Dec 2009 20:31:57 +0000
parents 2e9a20121a4f
children cb52c961cfa5
files lisp/ChangeLog lisp/comint.el
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Dec 01 20:08:20 2009 +0000
+++ b/lisp/ChangeLog	Tue Dec 01 20:31:57 2009 +0000
@@ -1,5 +1,8 @@
 2009-12-01  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* comint.el (comint-insert-input): Ignore clicks to the right of
+	the field.  Reported by Bob Nnamtrop <bobnnamtrop@gmail.com>.
+
 	* vc.el (vc-print-log-internal): Don't wait for the prcess to
 	terminate before setting up the major mode.
 
--- a/lisp/comint.el	Tue Dec 01 20:08:20 2009 +0000
+++ b/lisp/comint.el	Tue Dec 01 20:31:57 2009 +0000
@@ -828,7 +828,10 @@
   (let ((pos (posn-point (event-end event)))
 	field input)
     (with-selected-window (posn-window (event-end event))
-      (and (setq field (field-at-pos pos))
+      ;; If pos is at the very end of a field, the mouse-click was
+      ;; probably outside (to the right) of the field.
+      (and (< pos (field-end pos))
+           (setq field (field-at-pos pos))
 	   (setq input (field-string-no-properties pos))))
     (if (or (null comint-accum-marker)
 	    (not (eq field 'input)))