Skip to content

Commit

Permalink
tweak(ts-movement): move +ts-movement-maybe to :init
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Jan 30, 2024
1 parent 90ef5da commit 554bee5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/me-prog.el
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,14 @@
:straight (:host github :repo "haritkapadia/ts-movement")
:when (+emacs-features-p 'tree-sitter)
:hook ((prog-mode conf-mode) . +ts-movement-maybe)
:config
(+map-local! :keymaps 'ts-movement-map "v" #'+ts-movement-transient)
:init
(defun +ts-movement-maybe (&optional arg)
"Enable `ts-movement-mode' when if `major-mode' is a trees-sitter mode."
(interactive (list (if current-prefix-arg (prefix-numeric-value current-prefix-arg) 'toggle)))
(when (string-suffix-p "-ts-mode" (symbol-name major-mode))
(ts-movement-mode arg)))
:config
(+map-local! :keymaps 'ts-movement-map "v" #'+ts-movement-transient)
(transient-define-prefix +ts-movement-transient ()
"Transient for ts-movement."
[[("d" "delete-overlay-at-point" tsm/delete-overlay-at-point :transient t)
Expand Down

0 comments on commit 554bee5

Please sign in to comment.