Skip to content

Commit

Permalink
Prevent "Unbalanced parenthesis" error when aligning parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
smoeding committed Mar 2, 2021
1 parent 9f4fef6 commit fd20504
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions puppet-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,11 @@ Used as `syntax-propertize-function' in Puppet Mode."
"Align the current block."
(interactive)
(save-excursion
;; Move point to beginning of string if inside a string to
;; prevent "Unbalanced parentheses" error by `backward-up-list'.
(let ((region (puppet-string-region)))
(if region
(goto-char (car region))))
(backward-up-list)
(let ((beg (point)))
(forward-list)
Expand Down

0 comments on commit fd20504

Please sign in to comment.