[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/yaml-mode 8105718 105/124: Simplify the implementation; mo
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/yaml-mode 8105718 105/124: Simplify the implementation; move a comment |
Date: |
Sun, 29 Aug 2021 11:36:22 -0400 (EDT) |
branch: elpa/yaml-mode
commit 8105718f0eb4ea3157b34a4e60ed9c3e1edafe48
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
Simplify the implementation; move a comment
---
yaml-mode.el | 39 +++++++++++++++++++--------------------
1 file changed, 19 insertions(+), 20 deletions(-)
diff --git a/yaml-mode.el b/yaml-mode.el
index 5eaa51e..01530bd 100644
--- a/yaml-mode.el
+++ b/yaml-mode.el
@@ -258,8 +258,6 @@ that key is pressed to begin a block literal."
(put-text-property (point) (1+ (point))
'syntax-table (string-to-syntax "_"))))))
- ;; If quote is detected as a syntactic string start but appeared
- ;; after a non-whitespace character, then mark it as syntactic word.
(save-excursion
(goto-char beg)
(while (and
@@ -268,24 +266,25 @@ that key is pressed to begin a block literal."
(when (get-text-property (point) 'yaml-block-literal)
(put-text-property (1- (point)) (point)
'syntax-table (string-to-syntax "w")))
- (let ((sps (syntax-ppss)))
- (when (nth 8 sps)
- (or
- (save-excursion
- (forward-char -1)
- (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")))))
- ;; We're right after a quote that opens a string literal.
- ;; Skip over it (big speedup for long JSON strings).
- (when (nth 3 sps)
- (goto-char (nth 8 sps))
- (ignore-errors (forward-sexp)))))))))
+ (let ((sps (syntax-ppss))
+ (pt (point)))
+ (when (nth 3 sps)
+ (cond
+ ((and (char-equal ?' (char-before (1- pt)))
+ (char-equal ?' (char-before pt))
+ (put-text-property (- pt 2) pt
+ 'syntax-table (string-to-syntax "w"))))
+ ;; If quote is detected as a syntactic string start but appeared
+ ;; after a non-whitespace character, then mark it as syntactic word.
+ ((and (not (eq ?\n (char-before (1- pt))))
+ (char-equal ?w (char-syntax (char-before (1- pt)))))
+ (put-text-property (1- pt) pt
+ 'syntax-table (string-to-syntax "w")))
+ (t
+ ;; We're right after a quote that opens a string literal.
+ ;; Skip over it (big speedup for long JSON strings).
+ (goto-char (nth 8 sps))
+ (ignore-errors (forward-sexp)))))))))
(defun yaml-font-lock-block-literals (bound)
"Find lines within block literals.
- [nongnu] elpa/yaml-mode 18c9135 020/124: replace `last-command-char` to `last-command-event`, (continued)
- [nongnu] elpa/yaml-mode 18c9135 020/124: replace `last-command-char` to `last-command-event`, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode ef3546b 047/124: allow spaces before '-' in yaml-scalar-context-re, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode bdc47a4 056/124: added two more test files, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 236832c 068/124: Merge branch 'liangfu-master', ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode f378589 079/124: Merge pull request #45 from dunn/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode f991710 086/124: Support for apostrophe in words, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode b83482e 089/124: Support double quote in implicit keys, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode df66d7f 091/124: Merge pull request #59 from Kaali/master, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode fc7bac0 092/124: Formatting fixes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 2522b3c 101/124: Fix typos, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 8105718 105/124: Simplify the implementation; move a comment,
ELPA Syncer <=
- [nongnu] elpa/yaml-mode add6156 113/124: yaml-mode-syntax-propertize-function: Clear ppss cache, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode bce5aa1 011/124: changed version and added Changes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 9d5a888 025/124: Merge pull request #6 from gvalkov/yaml-file-type, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode a87ab36 046/124: add RECRUITMENTS, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode dcdcd81 049/124: Add myself as maintainer, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 6ddd552 058/124: Merge pull request #34 from antalk2/again-p2, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 75c8f36 064/124: Unhighlight foo#bar tokens, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 1cff904 067/124: fix regex in adding yaml-mode to auto-mode-alist, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 3fc5a33 094/124: Mark block literals to unfontify quotes in them, ELPA Syncer, 2021/08/29
- [nongnu] elpa/yaml-mode 41adb32 112/124: Merge pull request #77 from dgutov/single-quote-fixup, ELPA Syncer, 2021/08/29