Copy all font-lock properties in org-src, not just face
* lisp/org-src (org-src-font-lock-fontify-block): Loop over `font-lock-extra-managed-props', thus copying other properties that might be applied using font-lock. An example is composition, applied by `prettify-symbols-mode'.
This commit is contained in:
parent
b7dd0e8511
commit
4b9a634774
|
@ -503,11 +503,14 @@ as `org-src-fontify-natively' is non-nil."
|
|||
(unless (eq major-mode lang-mode) (funcall lang-mode))
|
||||
(org-font-lock-ensure)
|
||||
(let ((pos (point-min)) next)
|
||||
(while (setq next (next-single-property-change pos 'face))
|
||||
(let ((new-face (get-text-property pos 'face)))
|
||||
(put-text-property
|
||||
(+ start (1- pos)) (1- (+ start next)) 'face new-face
|
||||
org-buffer))
|
||||
(while (setq next (next-property-change pos))
|
||||
;; Handle additional properties from font-lock, so as to
|
||||
;; preserve, e.g., composition.
|
||||
(dolist (prop (cons 'face font-lock-extra-managed-props))
|
||||
(let ((new-prop (get-text-property pos prop)))
|
||||
(put-text-property
|
||||
(+ start (1- pos)) (1- (+ start next)) prop new-prop
|
||||
org-buffer)))
|
||||
(setq pos next))))
|
||||
;; Add Org faces.
|
||||
(let ((face-name (intern (format "org-block-%s" lang))))
|
||||
|
|
Loading…
Reference in New Issue