2019-04-21 19:59:44 -04:00
|
|
|
;; tools/eval/autoload/evil.el -*- lexical-binding: t; -*-
|
2022-08-12 20:29:19 +02:00
|
|
|
;;;###if (modulep! :editor evil)
|
2017-02-19 18:40:52 -05:00
|
|
|
|
2019-04-21 19:59:44 -04:00
|
|
|
;;;###autoload (autoload '+eval:region "tools/eval/autoload/evil" nil t)
|
2017-03-04 18:28:51 -05:00
|
|
|
(evil-define-operator +eval:region (beg end)
|
2019-10-24 16:55:25 -04:00
|
|
|
"Evaluate selection or sends it to the open REPL, if available."
|
2017-02-20 00:44:38 -05:00
|
|
|
:move-point nil
|
2017-02-19 18:40:52 -05:00
|
|
|
(interactive "<r>")
|
2019-11-15 00:17:10 -05:00
|
|
|
(+eval/region beg end))
|
2017-02-19 18:40:52 -05:00
|
|
|
|
2019-04-21 19:59:44 -04:00
|
|
|
;;;###autoload (autoload '+eval:replace-region "tools/eval/autoload/evil" nil t)
|
2017-03-04 18:28:51 -05:00
|
|
|
(evil-define-operator +eval:replace-region (beg end)
|
2019-10-24 16:55:25 -04:00
|
|
|
"Evaluate selection and replace it with its result."
|
2017-02-20 00:44:38 -05:00
|
|
|
:move-point nil
|
2017-02-19 18:40:52 -05:00
|
|
|
(interactive "<r>")
|
2017-03-04 18:28:51 -05:00
|
|
|
(+eval/region-and-replace beg end))
|
2017-05-12 14:18:00 +02:00
|
|
|
|
2019-04-21 19:59:44 -04:00
|
|
|
;;;###autoload (autoload '+eval:repl "tools/eval/autoload/evil" nil t)
|
2019-11-23 00:52:36 -05:00
|
|
|
(evil-define-operator +eval:repl (_beg _end)
|
2019-10-24 16:55:25 -04:00
|
|
|
"Open REPL and send the current selection to it."
|
2017-05-12 14:18:00 +02:00
|
|
|
:move-point nil
|
2019-11-23 00:52:36 -05:00
|
|
|
(interactive "<r>")
|
2019-10-24 16:55:25 -04:00
|
|
|
(+eval/open-repl-other-window))
|