Skip to content

Commit

Permalink
Merge pull request #648 from russtoku/main
Browse files Browse the repository at this point in the history
Add missing keymaps for Rust client
  • Loading branch information
Olical authored Feb 14, 2025
2 parents 95b067e + fd5653d commit 73fd612
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 11 deletions.
34 changes: 26 additions & 8 deletions fnl/conjure/client/rust/evcxr.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
(local client (autoload :conjure.client))
(local config (autoload :conjure.config))
(local log (autoload :conjure.log))
(local mapping (autoload :conjure.mapping))
(local stdio (autoload :conjure.remote.stdio))
(local str (autoload :conjure.aniseed.string))

Expand Down Expand Up @@ -123,8 +124,8 @@
(fn interrupt []
(with-repl-or-warn
(fn [repl]
(let [uv vim.loop]
(uv.kill repl.pid uv.constants.SIGINT)))))
(log.append [(.. comment-prefix " Sending interrupt signal.")] {:break? true})
(repl.send-signal vim.loop.constants.SIGINT))))

; Eval

Expand All @@ -143,12 +144,29 @@
(fn eval-file [opts]
(eval-str (a.assoc opts :code (a.slurp opts.file-path))))

(fn on-filetype []
(mapping.buf
:RustStart (cfg [:mapping :start])
start
{:desc "Start the Rust REPL"})

(mapping.buf
:RustStop (cfg [:mapping :stop])
stop
{:desc "Stop the Rust REPL"})

(mapping.buf
:RustInterrupt (cfg [:mapping :interrupt])
interrupt
{:desc "Interrupt the current evaluation"}))

{: buf-suffix
: comment-prefix
: stop
: start
: on-load
: on-exit
: interrupt
: eval-file
: eval-str
: eval-file}
: interrupt
: on-exit
: on-filetype
: on-load
: start
: stop}
12 changes: 9 additions & 3 deletions lua/conjure/client/rust/evcxr.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 73fd612

Please sign in to comment.