branch: elpa/scala-mode commit e23875ebd9059eafd65b19c1e323ec13e83d216f Author: Heikki Vesalainen <heikkivesalai...@yahoo.com> Commit: Heikki Vesalainen <heikkivesalai...@yahoo.com>
Fixed number literals not highlighting after foo_123 --- scala-mode-fontlock.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scala-mode-fontlock.el b/scala-mode-fontlock.el index a67c607..e4b9628 100644 --- a/scala-mode-fontlock.el +++ b/scala-mode-fontlock.el @@ -301,9 +301,11 @@ Does not continue past limit. (defun scala-font-lock:mark-numberLiteral (re limit) (when (re-search-forward re limit t) - (goto-char (match-beginning 0)) - (when (or (bolp) (string-match-p scala-syntax:number-safe-start-re (string (char-before)))) - (goto-char (match-end 0))))) + (if (string-match-p scala-syntax:number-safe-start-re + ;; get char-before match or a magic ',', which is safe + (string (or (char-before (match-beginning 0)) ?,))) + t + (scala-font-lock:mark-numberLiteral re limit)))) (defun scala-font-lock:mark-floatingPointLiteral (limit) (scala-font-lock:mark-numberLiteral