emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/yaml-mode 700dfda 093/124: Use block literal font-lock fir


From: ELPA Syncer
Subject: [nongnu] elpa/yaml-mode 700dfda 093/124: Use block literal font-lock first
Date: Sun, 29 Aug 2021 11:36:20 -0400 (EDT)

branch: elpa/yaml-mode
commit 700dfda9932476352e1c0461efae83d7aea329eb
Author: Vasilij Schneidermann <mail@vasilij.de>
Commit: Vasilij Schneidermann <mail@vasilij.de>

    Use block literal font-lock first
    
    Later font-lock rules cannot override earlier ones unless explicitly
    permitted, so if a key-value pair inside a block literal is
    highlighted first, the block literal highlighting will apply to
    everything outside it only.  The easy way out here is to apply the
    block literal highlighting first because nothing else should be
    highlighted inside block literals.
---
 yaml-mode.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/yaml-mode.el b/yaml-mode.el
index fd6b087..a9122ca 100644
--- a/yaml-mode.el
+++ b/yaml-mode.el
@@ -234,13 +234,13 @@ that key is pressed to begin a block literal."
 ;; Font-lock support
 
 (defvar yaml-font-lock-keywords
-  `((,yaml-constant-scalars-re . (1 font-lock-constant-face))
+  `((yaml-font-lock-block-literals 0 font-lock-string-face)
+    (,yaml-constant-scalars-re . (1 font-lock-constant-face))
     (,yaml-tag-re . (0 font-lock-type-face))
     (,yaml-node-anchor-alias-re . (0 font-lock-function-name-face))
     (,yaml-hash-key-re . (1 font-lock-variable-name-face))
     (,yaml-document-delimiter-re . (0 font-lock-comment-face))
     (,yaml-directive-re . (1 font-lock-builtin-face))
-    (yaml-font-lock-block-literals 0 font-lock-string-face)
     ("^[\t]+" 0 'yaml-tab-face t))
    "Additional expressions to highlight in YAML mode.")
 



reply via email to

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