From da6645e7d75065e170126785335a1de03afd7dff Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Tue, 28 Mar 2023 18:46:05 +0300 Subject: 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. --- misc/ninja-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit v1.2.1