Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix multi-line array indentation. #59

Merged
merged 2 commits into from
Jul 30, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Address style comments, remove unnecessary progns.
Kyle Smith committed Jul 30, 2015
commit ec05400a5fd5976acde54bf2609405561162a604
46 changes: 21 additions & 25 deletions puppet-mode.el
Original file line number Diff line number Diff line change
@@ -560,31 +560,27 @@ of the initial include plus puppet-include-indent."
;; opening bracket.
(progn
(goto-char array-start)
(setq cur-indent (current-indentation))
)
(progn
(goto-char array-start)
(forward-char 1)

;; If the point is at the end of the line, use normal indentation.
;;
;; For example:
;; exec { 'foo':
;; creates => [
;; 'foo',
;; 'bar',
;; ]
;; }
;;
(if (eolp)
(progn
(setq cur-indent (+ (current-indentation) puppet-indent-level)))
;; Otherwise, attempt to align as described above.
(progn
(re-search-forward "\\S-")
(forward-char -1)
(setq cur-indent (current-column))
))))))
(setq cur-indent (current-indentation)))

(goto-char array-start)
(forward-char 1)

;; If the point is at the end of the line, use normal indentation.
;;
;; For example:
;; exec { 'foo':
;; creates => [
;; 'foo',
;; 'bar',
;; ]
;; }
;;
(if (eolp)
(setq cur-indent (+ (current-indentation) puppet-indent-level))
;; Otherwise, attempt to align as described above.
(re-search-forward "\\S-")
(forward-char -1)
(setq cur-indent (current-column))))))
(include-start
(setq cur-indent include-start))
((and (looking-at "^\\s-*},?\\s-*$") block-indent)