Skip to content

Instantly share code, notes, and snippets.

@snj14
Created January 29, 2012 15:38
Show Gist options
  • Save snj14/1699333 to your computer and use it in GitHub Desktop.
Save snj14/1699333 to your computer and use it in GitHub Desktop.
--- highlight-indentation.el 2012-01-30 00:21:47.921213987 +0900
+++ highlight-indentation.el.mod 2012-01-30 00:21:40.649213762 +0900
@@ -46,8 +46,14 @@
on spaces"
:lighter " ||"
(when highlight-indentation-current-regex ;; OFF
- (font-lock-remove-keywords nil `((,highlight-indentation-current-regex
- (1 'highlight-indentation-face)))))
+ (font-lock-remove-keywords nil `(("^ +"
+ (,highlight-indentation-current-regex
+ (progn
+ (goto-char (match-beginning 0))
+ (match-end 0))
+ nil
+ (1 'highlight-indentation-face t))
+ ))))
(set (make-local-variable 'highlight-indentation-current-regex) nil)
@@ -70,8 +76,15 @@
(default-value 'highlight-indentation-offset)))))
(set (make-local-variable 'highlight-indentation-current-regex)
(format "\\( \\) \\{%s\\}" (- highlight-indentation-offset 1)))
- (font-lock-add-keywords nil `((,highlight-indentation-current-regex
- (1 'highlight-indentation-face)))))
+ (font-lock-add-keywords nil `(("^ +"
+ (,highlight-indentation-current-regex
+ (progn
+ (goto-char (match-beginning 0))
+ (match-end 0))
+ nil
+ (1 'highlight-indentation-face t))
+ )))
+ )
(font-lock-fontify-buffer))
;;;###autoload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment