Skip to content

Commit

Permalink
Merge pull request #87 from tarsiiformes/indentation
Browse files Browse the repository at this point in the history
Fix indentation
  • Loading branch information
wasamasa authored Dec 30, 2021
2 parents b706947 + 913f672 commit 0ca35e8
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions yaml-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ that key is pressed to begin a block literal."
:group 'yaml)

(defface yaml-tab-face
'((((class color)) (:background "red" :foreground "red" :bold t))
(t (:reverse-video t)))
'((((class color)) (:background "red" :foreground "red" :bold t))
(t (:reverse-video t)))
"Face to use for highlighting tabs in YAML files."
:group 'faces
:group 'yaml)
Expand Down Expand Up @@ -243,7 +243,7 @@ that key is pressed to begin a block literal."
(,yaml-document-delimiter-re . (0 font-lock-comment-face))
(,yaml-directive-re . (1 font-lock-builtin-face))
("^[\t]+" 0 'yaml-tab-face t))
"Additional expressions to highlight in YAML mode.")
"Additional expressions to highlight in YAML mode.")

(defun yaml-mode-syntax-propertize-function (beg end)
"Override buffer's syntax table for special syntactic constructs."
Expand Down Expand Up @@ -431,27 +431,27 @@ otherwise do nothing."
(while (and (looking-at-p yaml-blank-line-re) (not (bobp)))
(forward-line -1))
(let ((nlines yaml-block-literal-search-lines)
(min-level (current-indentation))
beg)
(min-level (current-indentation))
beg)
(forward-line -1)
(while (and (/= nlines 0)
(/= min-level 0)
(not (looking-at-p yaml-block-literal-re))
(not (bobp)))
(setq nlines (1- nlines))
(unless (looking-at-p yaml-blank-line-re)
(setq min-level (min min-level (current-indentation))))
(forward-line -1))
(/= min-level 0)
(not (looking-at-p yaml-block-literal-re))
(not (bobp)))
(setq nlines (1- nlines))
(unless (looking-at-p yaml-blank-line-re)
(setq min-level (min min-level (current-indentation))))
(forward-line -1))
(when (and (< (current-indentation) min-level)
(looking-at-p yaml-block-literal-re))
(setq min-level (current-indentation))
(forward-line)
(setq beg (point))
(while (and (not (eobp))
(or (looking-at-p yaml-blank-line-re)
(> (current-indentation) min-level)))
(forward-line))
(narrow-to-region beg (point))))))
(setq min-level (current-indentation))
(forward-line)
(setq beg (point))
(while (and (not (eobp))
(or (looking-at-p yaml-blank-line-re)
(> (current-indentation) min-level)))
(forward-line))
(narrow-to-region beg (point))))))

(defun yaml-fill-paragraph (&optional justify region)
"Fill paragraph.
Expand Down

0 comments on commit 0ca35e8

Please sign in to comment.