commit b8d86c65cb083fce2cd3aed79511e6e7c1385bf2
parent e4ed51e137e7849c4ef9e4f434ac797f09ea0a2d
Author: Daniel Barlow <dan@telent.net>
Date: Sat, 31 Dec 2022 13:35:34 +0000
invoke command.function with completion value not string
this means a function that wants a buffer (for example) gets called
with the actual buffer not the buffer name
Diffstat:
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/command.fnl b/command.fnl
@@ -29,7 +29,7 @@
[:url #(doto {} (tset $1 $1)) #(do "http://www.example.com")]
]
(fn [{:url url :buffer buffer}]
- (let [b (Buffer.find buffer)] (: b :visit url))))
+ (buffer:visit url)))
(fn find-command [name]
(. commands name))
@@ -77,8 +77,10 @@
})
{:command c :this-param k :collected-params p}
- (do
- (tset p k input-string)
+ (let [{ : completer} (. c.params k)
+ vals (completer input-string)
+ value (. vals input-string)]
+ (tset p k value)
(state-for-next-param c p))
{:command c :this-param nil :collected-params p}
diff --git a/dunlin.fnl b/dunlin.fnl
@@ -9,7 +9,7 @@
;;; when we decide how to do an init file/rc file, this will go in it
(local my-keymap {
- "g" ["visit-location" {:buffer #(. (. $1 :buffer) :name)}]
+ "g" ["visit-location" {:buffer #$1.buffer }]
"M-q" ["quit-browser" {}]
"C-x" {
"C-c" ["quit-browser" {}]