branch: elpa/jade-mode
commit e8e2964ef45d7940db43cf4920bb0ee9e3c44379
Author: brianc <[email protected]>
Commit: brianc <[email protected]>

    made tab cycle after hitting end
---
 jade-mode.el | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/jade-mode.el b/jade-mode.el
index 2593f5358a..fea702aa60 100644
--- a/jade-mode.el
+++ b/jade-mode.el
@@ -42,13 +42,16 @@
   (if (jade-empty-line-p)
       (indent-to (jade-previous-indentation))
     ;; otherwise indent if nesting is correct
-    (if (jade-should-indent-p)
+    (save-excursion
+      (if (jade-should-indent-p)
+          (let ((ci (current-indentation)))
+            (beginning-of-line)
+            (delete-horizontal-space)
+            (indent-to (+ jade-tab-width ci)))
+        ;; if cannot indent, reset indentation
         (progn
-          (save-excursion
-            (let ((ci (current-indentation)))
-              (beginning-of-line)
-              (delete-horizontal-space)
-              (indent-to (+ jade-tab-width ci)))))))
+          (beginning-of-line)
+          (delete-horizontal-space)))))
   ;; move point to end of line on empty lines to make tabbing
   ;; more obvious
   (if (jade-blank-line-p)

Reply via email to