Permalink
Browse files

work around haml bug

  • Loading branch information...
1 parent 2505fdc commit db6a183f25870832cb0c9d5523a73c48ce82d9c7 @gurgeous committed Apr 27, 2012
Showing with 13 additions and 1 deletion.
  1. +13 −1 modes.el
  2. BIN modes.elc
View
@@ -656,7 +656,19 @@ column point starts at, `tab-to-tab-stop' is done instead."
(setq haml-backspace-backdents-nesting nil)
(modify-syntax-entry ?_ "." haml-mode-syntax-table))
(eval-after-load "haml-mode"
- '(add-hook 'haml-mode-hook 'my-haml-setup))
+ '(progn
+ (add-hook 'haml-mode-hook 'my-haml-setup)
+ ;; amd - this is the old version, which seems to work better
+ (defun haml-reindent-region-by (n)
+ "Add N spaces to the beginning of each line in the region.
+If N is negative, will remove the spaces instead. Assumes all
+lines in the region have indentation >= that of the first line."
+ (let ((ci (current-indentation)))
+ (save-excursion
+ (replace-regexp (concat "^" (make-string ci ? ))
+ (make-string (max 0 (+ ci n)) ? )
+ nil (point) (mark)))))
+ ))
(setq auto-mode-alist (cons '("\\.haml$" . haml-mode) auto-mode-alist))
(autoload 'haml-mode "haml-mode" "Haml editing mode." t)
View
BIN modes.elc
Binary file not shown.

0 comments on commit db6a183

Please sign in to comment.