Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

Commit

Permalink
Only indent if the parser made it that far.
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeto committed Sep 16, 2012
1 parent 055b373 commit 54befcf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions psl-mode.el
Expand Up @@ -105,11 +105,12 @@ other modes do."
(condition-case err
(psl-compile-to-elisp)
(error nil))
(let ((indent (psl-count-indent (delete 'expr (reverse mpd-point-stack)))))
(save-excursion
(back-to-indentation)
(if (looking-at "}") (setq indent (1- indent))))
(psl-indent-line-to (max 0 (* psl-indent-width indent)))))
(unless (< mpd-best (point))
(let ((indent (psl-count-indent (delete 'expr (reverse mpd-point-stack)))))
(save-excursion
(back-to-indentation)
(if (looking-at "}") (setq indent (1- indent))))
(psl-indent-line-to (max 0 (* psl-indent-width indent))))))

(psl-count-indent '(defvar expr if expr))

Expand Down

0 comments on commit 54befcf

Please sign in to comment.