Permalink
Browse files

* Fixed mweb-calculate-indentation routine when open-tag is at beginn…

…ing of buffer (bobp)
  • Loading branch information...
1 parent 75c92be commit 3e209eb976ac323f00a7ac30ed8b1b6b5e2badda Fabián Ezequiel Gallina committed Feb 27, 2010
Showing with 15 additions and 13 deletions.
  1. +15 −13 multi-web-mode.el
View
@@ -180,18 +180,20 @@ previous submode."
(buffer-modified-flag (buffer-modified-p)))
(save-excursion
(mweb-goto-current-mode-open-tag)
- (forward-line -1)
- (end-of-line)
- (insert "\n")
- (insert "a")
- (mweb-change-major-mode)
- (indent-according-to-mode)
- (setq indentation (current-indentation))
- (end-of-line)
- (setq eol (point-marker))
- (beginning-of-line)
- (delete-region (point-marker) eol)
- (delete-backward-char 1))
+ (if (bobp)
+ (setq indentation 0)
+ (forward-line -1)
+ (end-of-line)
+ (insert "\n")
+ (insert "a")
+ (mweb-change-major-mode)
+ (indent-according-to-mode)
+ (setq indentation (current-indentation))
+ (end-of-line)
+ (setq eol (point-marker))
+ (beginning-of-line)
+ (delete-region (point-marker) eol)
+ (delete-backward-char 1)))
(funcall changed-major-mode)
(set-buffer-modified-p buffer-modified-flag)
indentation))
@@ -231,7 +233,7 @@ previous submode."
(progn
(beginning-of-line)
(delete-horizontal-space)
- (insert "a")
+ (insert "b")
(delete-horizontal-space)
(beginning-of-line)
(mweb-update-context)

0 comments on commit 3e209eb

Please sign in to comment.