[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/jade-mode 351f756569 083/128: [#37] Highlight string lit.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/jade-mode 351f756569 083/128: [#37] Highlight string lit. manually - Closes #37 |
Date: |
Sat, 29 Jan 2022 08:24:49 -0500 (EST) |
branch: elpa/jade-mode
commit 351f756569abd559a0e0937bec378f5a5eb409c8
Author: Travis Jefferson <tjefferson@signpost.com>
Commit: Travis Jefferson <tjefferson@signpost.com>
[#37] Highlight string lit. manually - Closes #37
- Turn off syntactic font-lock and simply highlight string literals
with their own font-lock-keywords rule
- We lose the highlighting of the in-progress string literals, but
the benefits outweigh that issue for now, IMO
---
example.jade | 3 ++-
jade-mode.el | 16 +++++-----------
2 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/example.jade b/example.jade
index f7e0482632..ca47edd415 100644
--- a/example.jade
+++ b/example.jade
@@ -19,10 +19,11 @@ html(lang="en")
- else
p Get on it!
form
- input(type: "text", name='user[name]', readonly: true, disabled)
+ input(type = "text", name='user[name]', readonly = true, disabled)
div#single-quote.example
= 'this single quote should highlight as a string'
= 'this one' + "and this should too"
+ span= 'another' + "quote example"
span this one shouldn't higlight strings or... .other #things if else
| this one shouldn't highlight strings, and the same goes for
.keywords #ok ?
div#paren.content.example(style = 'float-left') Content .here #should
be plain if for
diff --git a/jade-mode.el b/jade-mode.el
index 42b9f5957e..1639fc74ff 100644
--- a/jade-mode.el
+++ b/jade-mode.el
@@ -77,15 +77,9 @@
(defvar jade-font-lock-keywords
`(
- ;; higlight string literals on lines beginning with an equals sign
- ;; TODO improve this to play nice with attribute assignments in
- ;; parentheses following tags
- (,(concat "^\\s-*"
- "=")
- (,(concat jade-single-quote-string-re "\\|"
jade-double-quote-string-re)
- nil
- nil
- (0 font-lock-string-face)))
+ ;; highlight string literals everywhere (except where we later
+ ;; remove all font lock faces)
+ (,(concat jade-single-quote-string-re "\\|" jade-double-quote-string-re) .
font-lock-string-face)
(,"!!!\\|doctype\\( ?[A-Za-z0-9\-\_]*\\)?" 0 font-lock-comment-face) ;;
doctype
(,jade-keywords . font-lock-keyword-face) ;; keywords
@@ -298,8 +292,8 @@ Follows indentation behavior of `indent-rigidly'."
(define-key jade-mode-map [backtab] 'jade-unindent)
(define-key jade-mode-map (kbd "RET") 'jade-newline-and-indent)
- ;; highlight syntax
- (setq font-lock-defaults '(jade-font-lock-keywords)))
+ ;; highlight keywords, ignore syntactic font-lock
+ (setq font-lock-defaults '(jade-font-lock-keywords t)))
;;;###autoload
- [nongnu] elpa/jade-mode a1cbadd84d 026/128: add .el file headers to enable automatic packaging - closes gh#6, (continued)
- [nongnu] elpa/jade-mode a1cbadd84d 026/128: add .el file headers to enable automatic packaging - closes gh#6, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 4d2f58abd7 044/128: Merge https://github.com/brianc/jade-mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 62c012c8d6 039/128: Improved Stylus comments syntax highlighting., ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 00c789673f 068/128: Closes #26. Fix inline '//' highlight as comment, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 8f61e0dc6a 040/128: Decimal point can be part of a constant., ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 109b9850d2 041/128: Created a syntax table for Stylus mode., ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode f540df5ee6 056/128: Merge pull request #16 from tardyp/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 275ab149ed 051/128: Merge pull request #11 from jkpl/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode d90ad2cc02 036/128: Add syntax table entry for single line comment., ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 05d671fcdb 057/128: Add comment syntax to allow for M-x (un)comment-region., ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 351f756569 083/128: [#37] Highlight string lit. manually - Closes #37,
ELPA Syncer <=
- [nongnu] elpa/jade-mode a90b512c6e 086/128: [#39] add two functions to hl JS blocks, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 57ab4d6555 085/128: [#39] add JS examples to highlight, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode bbaf2bb3a1 092/128: add a THIRD comment type and use THAT ad default, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 4336ae9cc4 097/128: [#46] ignore .elc files, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 42bb8501b4 099/128: fix some compile warnings and sexp-region, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 0de371694a 053/128: Match zero or more whitespace in BOL instead of one or more., ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode c4014d8a9c 098/128: Merge pull request #50 from tjefferson08/46_unit_tests, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode e9288f66dc 106/128: use named regexes in font-lock-keywords list, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode f9522fc00a 105/128: reorder highlight tests to match regex order in jade-mode.el and display, ELPA Syncer, 2022/01/29
- [nongnu] elpa/jade-mode 97c460453b 116/128: Merge pull request #62 from robbyoconnor/remove-flymake-from-README, ELPA Syncer, 2022/01/29