Skip to content

Commit

Permalink
refactor(highlight-numbers): rewrite regexp with rx
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Oct 30, 2023
1 parent 87fc42e commit d46593a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/me-editor.el
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@
:straight t
:hook ((prog-mode conf-mode) . highlight-numbers-mode)
:config
;; Original "\\_<[[:digit:]].*?\\_>"
(setq highlight-numbers-generic-regexp "\\_<[[:digit:]]+\\(?:\\.[0-9]*\\)?\\_>"))
(setq highlight-numbers-generic-regexp
(rx (and symbol-start (one-or-more digit))
(optional "." (* digit))
symbol-end)))

(use-package smartparens
:straight t
Expand Down Expand Up @@ -116,6 +118,7 @@
;; Bind `+yank-region-as-paragraph' (autoloaded from "elisp/+buffer.el")
(+nvmap! "gy" #'+kill-region-as-paragraph)


(provide 'me-editor)

;;; me-editor.el ends here

0 comments on commit d46593a

Please sign in to comment.