summaryrefslogtreecommitdiff
path: root/misc/ninja-mode.el
diff options
context:
space:
mode:
authorKonstantin Kharlamov <Hi-Angel@yandex.ru>2023-03-28 18:46:05 +0300
committerKonstantin Kharlamov <Hi-Angel@yandex.ru>2023-03-28 18:46:05 +0300
commitda6645e7d75065e170126785335a1de03afd7dff (patch)
treea6b2367b7dd7e7e78ebce876c6021b768bd6d1e5 /misc/ninja-mode.el
parent2d9083b2608bd60c31583193d321d13a81a75beb (diff)
downloadninja-da6645e7d75065e170126785335a1de03afd7dff.tar.gz
ninja-mode.el: fix variables highlighting
The code previously did not take into account that between the name and assignment may be any number of space including no space at all. It was also incorrectly highlighting in a code like foo = bar = buzz the `bar` as a variable, even though the `bar = buzz` is just a text that gets assigned to `foo`, i.e. `bar` is not a variable. Fix that.
Diffstat (limited to 'misc/ninja-mode.el')
-rw-r--r--misc/ninja-mode.el2
1 files changed, 1 insertions, 1 deletions
diff --git a/misc/ninja-mode.el b/misc/ninja-mode.el
index 8b975d5..76abf81 100644
--- a/misc/ninja-mode.el
+++ b/misc/ninja-mode.el
@@ -28,7 +28,7 @@
"pool" "default")
'words))
. font-lock-keyword-face)
- ("\\([[:alnum:]_]+\\) =" 1 font-lock-variable-name-face)
+ ("^[[:space:]]*\\([[:alnum:]_]+\\)[[:space:]]*=" 1 font-lock-variable-name-face)
;; Variable expansion.
("$[[:alnum:]_]+" . font-lock-variable-name-face)
("${[[:alnum:]._]+}" . font-lock-variable-name-face)