~sirn/poly-yaml-mode

5b12f40e47d88bbb8784611b0d04a8ba5eac8216 — Kridsada Thanabulpong 4 years ago 58aa542 master
Detect head character instead of tail character for tail matching
2 files changed, 3 insertions(+), 2 deletions(-)

M README.md
M poly-yaml-mode.el
M README.md => README.md +0 -1
@@ 6,7 6,6 @@ YAML multiple major modes for [polymode](https://polymode.github.io/)

- Pretty much WIP, here be dragons
- Only works with YAML quoted string or literal YAML block
- Can get confused by YAML block that first line ended with a quote

## Polymodes


M poly-yaml-mode.el => poly-yaml-mode.el +3 -1
@@ 65,8 65,10 @@ block. Used as a tail matcher for `poly-innermode'."
  ;; 2. assumes point is always at the code block rather than head end
  (let* ((cur-pos (point))
         (cur-indent (1- (current-indentation)))
         (head-chr (buffer-substring-no-properties (1- cur-pos) cur-pos))
         (end (point-at-eol)))
    (if (looking-at-p poly-yaml-string-tail-re)
    (if (or (string-equal head-chr "\"")
            (string-equal head-chr "'"))
        (progn
          (re-search-forward poly-yaml-string-tail-re nil t)
          (cons (match-beginning 1)