branch: elpa/yaml-mode commit df66d7f31eeec1c8446694bcbffbe008408f5cc0 Merge: 7f41037 c7c2994 Author: Vasilij Schneidermann <m...@vasilij.de> Commit: GitHub <nore...@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.