branch: elpa/yaml-mode
commit c7c299466895d5e2b502be52bd0b323c8f82b4f3
Author: Väinö Järvelä <[email protected]>
Commit: Väinö Järvelä <[email protected]>
Support escaped quote in a single quoted string
e.g. 'key''s'
---
yaml-mode.el | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/yaml-mode.el b/yaml-mode.el
index ce8c8ac..25848e8 100644
--- a/yaml-mode.el
+++ b/yaml-mode.el
@@ -266,10 +266,14 @@ that key is pressed to begin a block literal."
(when (nth 8 (syntax-ppss))
(save-excursion
(forward-char -1)
- (when (and (not (bolp))
- (char-equal ?w (char-syntax (char-before (point)))))
- (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.