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 trivial #133

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
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
16 changes: 8 additions & 8 deletions puppet-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -773,17 +773,17 @@ of the initial include plus puppet-include-indent."

;; If this line contains only a closing paren, we should lose one
;; level of indentation.
(if (looking-at "^\\s-*\)\\s-*$")
(setq cur-indent (- cur-indent puppet-indent-level)))))
(when (looking-at "^\\s-*\)\\s-*$")
(setq cur-indent (- cur-indent puppet-indent-level)))))

;; We've figured out the indentation, so do it.
(if (and cur-indent (> cur-indent 0))
(indent-line-to cur-indent)
(indent-line-to 0))))
;; If initial point was within line's indentation,
;; position after the indentation. Else stay at same point in text.
(if (> (- (point-max) pos) (point))
(goto-char (- (point-max) pos)))))
(when (> (- (point-max) pos) (point))
(goto-char (- (point-max) pos)))))


;;; Font locking
Expand Down Expand Up @@ -893,10 +893,10 @@ with any of these symbols. The expansion will only match if it
is in any given CONTEXT. nil means no specific syntactic context."
(when (symbolp context)
(setq context (list context)))
(let* ((pos (next-single-char-property-change (point) property nil limit)))
(let ((pos (next-single-char-property-change (point) property nil limit)))
(when (and pos (> pos (point)))
(goto-char pos)
(let* ((value (get-text-property pos property)))
(let ((value (get-text-property pos property)))
(if (and value (memq (car value) context))
(progn (set-match-data (cdr value)) t)
(puppet-match-property property context limit))))))
Expand Down Expand Up @@ -1075,8 +1075,8 @@ Used as `syntax-propertize-function' in Puppet Mode."

With a prefix argument SUPPRESS it simply inserts $."
(interactive "P")
(if (and mark-active (equal (point) (region-end)))
(exchange-point-and-mark))
(when (and mark-active (equal (point) (region-end)))
(exchange-point-and-mark))
(insert "$")
(when (and
(not suppress)
Expand Down