branch: elpa/jade-mode
commit 6b9d9507e2ebb571032dce7ca3fc86a663ad0c64
Author: brianc <[email protected]>
Commit: brianc <[email protected]>
can detect simple region sexps
---
jade-mode.el | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/jade-mode.el b/jade-mode.el
index f9f3cd479a..c5be348a50 100644
--- a/jade-mode.el
+++ b/jade-mode.el
@@ -80,6 +80,22 @@
(,"\\(?:^[ {2,}]+\\(?:[a-z0-9_:\\-]*\\)\\)?\\(\\.[A-Za-z0-9\-\_]*\\)"
1 font-lock-function-name-face) ;; class name
(,"^[ {2,}]+[a-z0-9_:\\-]*" 0 font-lock-comment-face)))
+(defun jade-next-line-indent ()
+ "Gets indentation level for next line."
+ (save-excursion
+ (next-line)
+ (current-indentation)))
+
+(defun jade-region-for-sexp ()
+ "Selects the current sexp as the region"
+ (interactive)
+ (beginning-of-line)
+ (let ((ci (current-indentation)))
+ (push-mark nil nil t)
+ (while (> (jade-next-line-indent) ci)
+ (next-line)
+ (end-of-line))))
+
(defvar jade-mode-map (make-sparse-keymap))
(define-key jade-mode-map [S-tab] 'jade-unindent-line)