From 8249368ec4ae217361367686d33b4c8bfb8865a2 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Mon, 25 May 2020 09:26:48 +0200 Subject: Update yaml-mode --- .emacs.d/lisp/yaml-mode.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.emacs.d/lisp/yaml-mode.el b/.emacs.d/lisp/yaml-mode.el index 6bd4000..4914218 100644 --- a/.emacs.d/lisp/yaml-mode.el +++ b/.emacs.d/lisp/yaml-mode.el @@ -151,7 +151,7 @@ that key is pressed to begin a block literal." "Regexp indicating the beginning of a scalar context.") (defconst yaml-nested-map-re - (concat ".*: *\\(?:&.*\\|{ *\\|" yaml-tag-re " *\\)?$") + (concat "[^#]*: *\\(?:&.*\\|{ *\\|" yaml-tag-re " *\\)?$") "Regexp matching a line beginning a YAML nested structure.") (defconst yaml-block-literal-base-re " *[>|][-+0-9]* *\\(?:\n\\|\\'\\)" @@ -273,7 +273,11 @@ that key is pressed to begin a block literal." ((and (char-equal ?' (char-before (1- pt))) (char-equal ?' (char-before pt))) (put-text-property (- pt 2) pt - 'syntax-table (string-to-syntax "w"))) + 'syntax-table (string-to-syntax "w")) + ;; Workaround for https://debbugs.gnu.org/41195. + (let ((syntax-propertize--done syntax-propertize--done)) + ;; Carefully invalidate the last cached ppss. + (syntax-ppss-flush-cache (- pt 2)))) ;; If quote is detected as a syntactic string start but appeared ;; after a non-whitespace character, then mark it as syntactic word. ((and (char-before (1- pt)) -- cgit v1.3