Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

can detect simple region sexps

  • Loading branch information...
commit 6b9d9507e2ebb571032dce7ca3fc86a663ad0c64 1 parent 555c086
@brianc brianc authored
Showing with 16 additions and 0 deletions.
  1. +16 −0 jade-mode.el
View
16 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)
Please sign in to comment.
Something went wrong with that request. Please try again.