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

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

[nongnu] elpa/yaml-mode df66d7f 091/124: Merge pull request #59 from Kaa


From: ELPA Syncer
Subject: [nongnu] elpa/yaml-mode df66d7f 091/124: Merge pull request #59 from Kaali/master
Date: Sun, 29 Aug 2021 11:36:19 -0400 (EDT)

branch: elpa/yaml-mode
commit df66d7f31eeec1c8446694bcbffbe008408f5cc0
Merge: 7f41037 c7c2994
Author: Vasilij Schneidermann <mail@vasilij.de>
Commit: GitHub <noreply@github.com>

    Merge pull request #59 from Kaali/master
    
    Support non-whitespace preceded apostrophe
---
 yaml-mode.el | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/yaml-mode.el b/yaml-mode.el
index 00f0c2d..25848e8 100644
--- a/yaml-mode.el
+++ b/yaml-mode.el
@@ -262,14 +262,18 @@ that key is pressed to begin a block literal."
   ;; after a non-whitespace character, then mark it as syntactic word.
   (save-excursion
     (goto-char beg)
-    (while (search-forward "'" end t)
+    (while (re-search-forward "['\"]" end t)
       (when (nth 8 (syntax-ppss))
         (save-excursion
           (forward-char -1)
-          (when (and (not (bolp))
-                     (not (memq (preceding-char) '(?\s ?\t))))
-            (put-text-property (point) (1+ (point))
-                               'syntax-table (string-to-syntax "w"))))))))
+          (cond ((and (char-equal ?' (char-before (point)))
+                      (char-equal ?' (char-after (point)))
+                      (put-text-property (1- (point)) (1+ (point))
+                                         'syntax-table (string-to-syntax 
"w"))))
+                ((and (not (bolp))
+                      (char-equal ?w (char-syntax (char-before (point)))))
+                 (put-text-property (point) (1+ (point))
+                                    'syntax-table (string-to-syntax 
"w")))))))))
 
 (defun yaml-font-lock-block-literals (bound)
   "Find lines within block literals.



reply via email to

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