diff options
author | Karl Fogel <kfogel@red-bean.com> | 2008-01-20 00:14:24 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-03-20 11:45:56 -0500 |
commit | 5f3ed8d407ae4280dc7bd81569c48dc75cbc64e3 (patch) | |
tree | 726011d992ff6c8684766013c87e704d2ffaca4d /ext | |
parent | d1d408c699e051c9a1b6ce1fbc5cba034b252747 (diff) | |
download | puppet-5f3ed8d407ae4280dc7bd81569c48dc75cbc64e3.tar.gz puppet-5f3ed8d407ae4280dc7bd81569c48dc75cbc64e3.tar.xz puppet-5f3ed8d407ae4280dc7bd81569c48dc75cbc64e3.zip |
* puppet/ext/emacs/puppet-mode.el (puppet-indent-line): Be more sophisticated about what we do at the beginning of the buffer, so that the first expression after an block-opening statement that happens to begin at the beginning of the buffer gets indented correctly. This may need some cleanup, but I wanted to get the correct behavior committed first.
Reported by: Micah Anderson
(Who again supplied the reproduction case.)
Diffstat (limited to 'ext')
-rw-r--r-- | ext/emacs/puppet-mode.el | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/emacs/puppet-mode.el b/ext/emacs/puppet-mode.el index 307a27a38..54f9a71a6 100644 --- a/ext/emacs/puppet-mode.el +++ b/ext/emacs/puppet-mode.el @@ -175,6 +175,9 @@ that array, else return nil." (forward-line -1) (cond ((bobp) + (if (and (not (puppet-comment-line-p)) (looking-at "^.*{")) + (setq cur-indent 2) + (setq cur-indent 0)) (setq not-indented nil)) ((puppet-comment-line-p) ;; ignore it and continue iterating backwards |