]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix comint-get-old-input-default for output field case (Bug#25028)
authorNoam Postavsky <npostavs@gmail.com>
Fri, 11 May 2018 11:05:53 +0000 (07:05 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Mon, 4 Jun 2018 23:42:22 +0000 (19:42 -0400)
* lisp/comint.el (comint-get-old-input-default): Don't return whole
field when point was on an output field.

lisp/comint.el

index 1e4c0d33ee9309bfc4277bbc9005b2586c36c88e..122291bcf9c4f92ded53f762f9a4d7a2e36f010e 100644 (file)
@@ -2248,14 +2248,16 @@ current line, if point is on an output field.
 If `comint-use-prompt-regexp' is non-nil, then return
 the current line with any initial string matching the regexp
 `comint-prompt-regexp' removed."
-  (let (bof)
+  (let (field-prop bof)
     (if (and (not comint-use-prompt-regexp)
              ;; Make sure we're in an input rather than output field.
-             (null (get-char-property (setq bof (field-beginning)) 'field)))
+             (not (setq field-prop (get-char-property
+                                    (setq bof (field-beginning)) 'field))))
        (field-string-no-properties bof)
       (comint-bol)
       (buffer-substring-no-properties (point)
-                                     (if comint-use-prompt-regexp
+                                      (if (or comint-use-prompt-regexp
+                                              (eq field-prop 'output))
                                          (line-end-position)
                                        (field-end))))))