File tree Expand file tree Collapse file tree 2 files changed +18
-16
lines changed Expand file tree Collapse file tree 2 files changed +18
-16
lines changed Original file line number Diff line number Diff line change @@ -48,12 +48,13 @@ function M.clipboard(raw_url)
4848 utils .log (string.format (" URL %s copied to clipboard" , raw_url ))
4949end
5050
51- function M .__index (_ , k )
52- if k ~= nil then
53- return function (raw_url )
54- return shell_exec (k , raw_url )
51+ return setmetatable (M , {
52+ -- execute action as command if it is not one of the above module keys
53+ __index = function (_ , k )
54+ if k ~= nil then
55+ return function (raw_url )
56+ return shell_exec (k , raw_url )
57+ end
5558 end
56- end
57- end
58-
59- return setmetatable (M , M )
59+ end ,
60+ })
Original file line number Diff line number Diff line change @@ -53,11 +53,12 @@ function M.telescope(items, opts)
5353 :find ()
5454end
5555
56- function M .__index (_ , k )
57- if k ~= nil then
58- utils .log (k .. " is not a valid picker, defaulting to native vim.ui.select picker." )
59- return M .native
60- end
61- end
62-
63- return setmetatable (M , M )
56+ return setmetatable (M , {
57+ -- use default `vim.ui.select` when provided an invalid picker
58+ __index = function (_ , k )
59+ if k ~= nil then
60+ utils .log (k .. " is not a valid picker, defaulting to native vim.ui.select picker." )
61+ return M .native
62+ end
63+ end ,
64+ })
You can’t perform that action at this time.
0 commit comments