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

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

[nongnu] elpa/yaml-mode 3fc5a33 094/124: Mark block literals to unfontif


From: ELPA Syncer
Subject: [nongnu] elpa/yaml-mode 3fc5a33 094/124: Mark block literals to unfontify quotes in them
Date: Sun, 29 Aug 2021 11:36:20 -0400 (EDT)

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

    Mark block literals to unfontify quotes in them
---
 yaml-mode.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/yaml-mode.el b/yaml-mode.el
index a9122ca..c3416dd 100644
--- a/yaml-mode.el
+++ b/yaml-mode.el
@@ -263,6 +263,9 @@ that key is pressed to begin a block literal."
   (save-excursion
     (goto-char beg)
     (while (re-search-forward "['\"]" end t)
+      (when (get-text-property (point) 'yaml-block-literal)
+        (put-text-property (1- (point)) (point)
+                           'syntax-table (string-to-syntax "w")))
       (when (nth 8 (syntax-ppss))
         (save-excursion
           (forward-char -1)
@@ -308,6 +311,7 @@ artificially limitted to the value of
          ((and (< (current-indentation) min-level)
                (looking-at yaml-block-literal-re))
           (goto-char end)
+          (put-text-property begin end 'yaml-block-literal t)
           (set-match-data (list begin end))
           t)
          ((progn
@@ -315,7 +319,10 @@ artificially limitted to the value of
             (re-search-forward (concat yaml-block-literal-re
                                        " *\\(.*\\)\n")
                                bound t))
-          (set-match-data (nthcdr 2 (match-data))) t))))))
+          (let ((range (nthcdr 2 (match-data))))
+            (put-text-property (car range) (cadr range) 'yaml-block-literal t)
+            (set-match-data range))
+          t))))))
 
 
 ;; Indentation and electric keys



reply via email to

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