emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master ab34293 1/2: Fix problem with multiline fontification in interact


From: Lars Ingebrigtsen
Subject: master ab34293 1/2: Fix problem with multiline fontification in interactive Python
Date: Wed, 13 Oct 2021 13:00:37 -0400 (EDT)

branch: master
commit ab34293d849086a67effc52800e18bab1400ce72
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix problem with multiline fontification in interactive Python
    
    * lisp/progmodes/python.el
    (python-shell-font-lock-post-command-hook): When doing multi-line
    (`C-c SPC') inputs, remove all the preceding lines when doing
    fontification (bug#47657).
---
 lisp/progmodes/python.el | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 75aae23..5819f59 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2724,16 +2724,12 @@ goes wrong and syntax highlighting in the shell gets 
messed up."
              (deactivate-mark nil)
              (start-pos prompt-end)
              (buffer-undo-list t)
-             (font-lock-buffer-pos nil)
              (replacement
               (python-shell-font-lock-with-font-lock-buffer
-                (delete-region (line-beginning-position)
-                               (point-max))
-                (setq font-lock-buffer-pos (point))
+                (delete-region (point-min) (point-max))
                 (insert input)
                 (font-lock-ensure)
-                (buffer-substring font-lock-buffer-pos
-                                  (point-max))))
+                (buffer-string)))
              (replacement-length (length replacement))
              (i 0))
         ;; Inject text properties to get input fontified.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]