File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -367,7 +367,9 @@ is used to limit the scan."
367367 1 font-lock-type-face )
368368
369369 ; ; Atoms and singleton-like words like true/false/nil.
370- (,(elixir-rx (group (or atoms " true" " false" " nil" ))
370+ (,(elixir-rx symbol-start
371+ (group (or atoms " true" " false" " nil" ))
372+ symbol-end
371373 (zero-or-more space)
372374 (optional " =" ))
373375 1 elixir-atom-face)
Original file line number Diff line number Diff line change 173173true
174174false
175175nil
176+ true_false_nil
176177"
177178 (should (eq (elixir-test-face-at 3 ) 'elixir-atom-face ))
178179 (should (eq (elixir-test-face-at 5 ) 'elixir-atom-face ))
183184 (should (eq (elixir-test-face-at 26 ) 'elixir-atom-face ))
184185 (should (eq (elixir-test-face-at 43 ) 'elixir-atom-face ))
185186 (should (eq (elixir-test-face-at 48 ) 'elixir-atom-face ))
186- (should (eq (elixir-test-face-at 54 ) 'elixir-atom-face ))))
187+ (should (eq (elixir-test-face-at 54 ) 'elixir-atom-face ))
188+ (should-not (eq (elixir-test-face-at 57 ) 'elixir-atom-face ))))
187189
188190(ert-deftest elixir-mode-syntax-table/fontify-map-keys ()
189191 :tags '(fontification map syntax-table)
@@ -246,6 +248,15 @@ some_expr"
246248 (should (eq (elixir-test-face-at 2 ) 'font-lock-variable-name-face ))
247249 (should (eq (elixir-test-face-at 4 ) 'font-lock-variable-name-face ))))
248250
251+ (ert-deftest elixir-mode-syntax-table/fontify-assignment-with-singleton ()
252+ " https://github.com/elixir-lang/emacs-elixir/issues/245"
253+ :tags '(fontification syntax-table)
254+ (elixir-test-with-temp-buffer
255+ " true_false_nil = 1"
256+ (should (eq (elixir-test-face-at 1 ) 'font-lock-variable-name-face ))
257+ (should (eq (elixir-test-face-at 6 ) 'font-lock-variable-name-face ))
258+ (should (eq (elixir-test-face-at 12 ) 'font-lock-variable-name-face ))))
259+
249260(provide 'elixir-mode-font-test )
250261
251262; ;; elixir-mode-font-test.el ends here
You can’t perform that action at this time.
0 commit comments