mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Updated haml-mode, thanks to Dima.
git-svn-id: svn://hamptoncatlin.com/haml/trunk@445 7063305b-7217-0410-af8c-cdc13e5119b9
This commit is contained in:
parent
57de211216
commit
79f3f71b62
1 changed files with 19 additions and 10 deletions
|
@ -64,12 +64,14 @@
|
|||
;; Font lock
|
||||
(defconst haml-font-lock-keywords-1
|
||||
(list
|
||||
'("^ *%\\w+" . font-lock-function-name-face)
|
||||
'("#\\w+" . font-lock-keyword-face)
|
||||
'("^[ \t]*/.*" . font-lock-comment-face)
|
||||
'("^ *%\\w+\/?" . font-lock-function-name-face)
|
||||
'("#\\w+" . font-lock-keyword-face)
|
||||
'("\\.\\w+" . font-lock-keyword-face)
|
||||
'("^ *=.*" . font-lock-string-face)
|
||||
'("^ *-.*" . font-lock-string-face)
|
||||
'("^!!!.*" . font-lock-constant-face)))
|
||||
'(":\\w+" . font-lock-constant-face)
|
||||
'("'[^']*'" . font-lock-string-face)
|
||||
'("{[^}]*}" . font-lock-variable-name-face)
|
||||
'("^!!!.*" . font-lock-constant-face)))
|
||||
|
||||
;; Constants
|
||||
|
||||
|
@ -107,6 +109,13 @@
|
|||
|
||||
;; Mode setup
|
||||
|
||||
(defvar haml-mode-syntax-table nil
|
||||
"Syntax table in use in haml-mode buffers.")
|
||||
(unless haml-mode-syntax-table
|
||||
(setq haml-mode-syntax-table (make-syntax-table))
|
||||
(modify-syntax-entry ?: "." haml-mode-syntax-table)
|
||||
(modify-syntax-entry ?_ "w" haml-mode-syntax-table))
|
||||
|
||||
(defvar haml-mode-map ()
|
||||
"Keymap used in `haml-mode' buffers.")
|
||||
(if haml-mode-map
|
||||
|
@ -120,12 +129,12 @@
|
|||
"Simple mode to edit Haml.
|
||||
|
||||
\\{haml-mode-map}"
|
||||
(set-syntax-table haml-mode-syntax-table)
|
||||
(set (make-local-variable 'indent-line-function) 'haml-indent-line)
|
||||
(make-local-variable 'font-lock-defaults)
|
||||
(setq font-lock-defaults
|
||||
'((haml-font-lock-keywords-1)
|
||||
nil
|
||||
t)))
|
||||
(set (make-local-variable 'font-lock-defaults)
|
||||
'((haml-font-lock-keywords-1)
|
||||
nil
|
||||
t)))
|
||||
|
||||
;; Indentation and electric keys
|
||||
|
||||
|
|
Loading…
Reference in a new issue