mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
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).
This commit is contained in:
parent
e494a2d00a
commit
ab34293d84
1 changed files with 2 additions and 6 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue