diff options
Diffstat (limited to 'lisp/comint.el')
| -rw-r--r-- | lisp/comint.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index 0a33e749446..f334a4ca4d4 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -2255,14 +2255,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)))))) |
