diff options
| author | Miha Rihtaršič | 2022-11-26 23:01:24 +0100 |
|---|---|---|
| committer | Eli Zaretskii | 2022-12-07 17:33:56 +0200 |
| commit | 949bc1c72d77aed1cea8d52422825cd8baf6d9ba (patch) | |
| tree | 093007581aebe7d524efc65982548ce57f4a4ef7 | |
| parent | a6ada6bd26195a7b5359b3b13323dee35f12a40e (diff) | |
| download | emacs-949bc1c72d77aed1cea8d52422825cd8baf6d9ba.tar.gz emacs-949bc1c72d77aed1cea8d52422825cd8baf6d9ba.zip | |
comint-fontify-input: Fix field boundary issue (bug#59626)
* lisp/comint.el (comint--intersect-regions): Don't call
'field-end' if we are on a field boundary already.
Copyright-paperwork-exempt: yes
| -rw-r--r-- | lisp/comint.el | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index 4d9fc501874..6742360d16b 100644 --- a/lisp/comint.el +++ b/lisp/comint.el | |||
| @@ -4121,9 +4121,15 @@ function called, or nil, if no function was called (if BEG = END)." | |||
| 4121 | (save-restriction | 4121 | (save-restriction |
| 4122 | (let ((beg2 beg1) | 4122 | (let ((beg2 beg1) |
| 4123 | (end2 end1)) | 4123 | (end2 end1)) |
| 4124 | (when (= beg2 beg) | 4124 | (when (and (= beg2 beg) |
| 4125 | (> beg2 (point-min)) | ||
| 4126 | (eq is-output | ||
| 4127 | (eq (get-text-property (1- beg2) 'field) 'output))) | ||
| 4125 | (setq beg2 (field-beginning beg2))) | 4128 | (setq beg2 (field-beginning beg2))) |
| 4126 | (when (= end2 end) | 4129 | (when (and (= end2 end) |
| 4130 | (< end2 (point-max)) | ||
| 4131 | (eq is-output | ||
| 4132 | (eq (get-text-property (1+ end2) 'field) 'output))) | ||
| 4127 | (setq end2 (field-end end2))) | 4133 | (setq end2 (field-end end2))) |
| 4128 | ;; Narrow to the whole field surrounding the region | 4134 | ;; Narrow to the whole field surrounding the region |
| 4129 | (narrow-to-region beg2 end2)) | 4135 | (narrow-to-region beg2 end2)) |