Fix usage of mapping.buf since it's update
This commit is contained in:
parent
d9e70aa52e
commit
d8f9ac379c
@ -32,21 +32,14 @@
|
|||||||
:on-result (output-expanded me-form)})))
|
:on-result (output-expanded me-form)})))
|
||||||
|
|
||||||
(defn add-buf-mappings []
|
(defn add-buf-mappings []
|
||||||
(mapping.buf :n nil "cm" ":ConjureCljMacroexpand<CR>")
|
(mapping.buf :CljMacroexpand "cm" #(clj-macroexpand)
|
||||||
(mapping.buf :n nil "c0" ":ConjureCljMacroexpand0<CR>")
|
{:desc "Call macroexpand-all on the symbol under the cursor"})
|
||||||
(mapping.buf :n nil "c1" ":ConjureCljMacroexpand1<CR>"))
|
(mapping.buf :CljMacroexpand0 "c0" #(clj-macroexpand "clojure.core/macroexpand")
|
||||||
|
{:desc "Call macroexpand on the symbol under the cursor"})
|
||||||
|
(mapping.buf :CljMacroexpand1 "c1" #(clj-macroexpand "clojure.core/macroexpand-1")
|
||||||
|
{:desc "Call macroexpand-1 on the symbol under the cursor"}))
|
||||||
|
|
||||||
(defn init []
|
(defn init []
|
||||||
(nvim.ex.command_
|
|
||||||
"ConjureCljMacroexpand"
|
|
||||||
(bridge.viml->lua :conjure-macroexpand.main :clj-macroexpand))
|
|
||||||
(nvim.ex.command_
|
|
||||||
"ConjureCljMacroexpand0"
|
|
||||||
(bridge.viml->lua :conjure-macroexpand.main :clj-macroexpand {:args "\"clojure.core/macroexpand\""}))
|
|
||||||
(nvim.ex.command_
|
|
||||||
"ConjureCljMacroexpand1"
|
|
||||||
(bridge.viml->lua :conjure-macroexpand.main :clj-macroexpand {:args "\"clojure.core/macroexpand-1\""}))
|
|
||||||
|
|
||||||
(when (or (not nvim.g.conjure_macroexpand_disable_mappings)
|
(when (or (not nvim.g.conjure_macroexpand_disable_mappings)
|
||||||
(= 0 nvim.g.conjure_macroexpand_disable_mappings))
|
(= 0 nvim.g.conjure_macroexpand_disable_mappings))
|
||||||
(nvim.ex.autocmd
|
(nvim.ex.autocmd
|
||||||
|
@ -1,148 +1,73 @@
|
|||||||
local _2afile_2a = "fnl/conjure-macroexpand/main.fnl"
|
local _2afile_2a = "fnl/conjure-macroexpand/main.fnl"
|
||||||
local _0_
|
|
||||||
do
|
|
||||||
local name_0_ = "conjure-macroexpand.main"
|
|
||||||
local module_0_
|
|
||||||
do
|
|
||||||
local x_0_ = package.loaded[name_0_]
|
|
||||||
if ("table" == type(x_0_)) then
|
|
||||||
module_0_ = x_0_
|
|
||||||
else
|
|
||||||
module_0_ = {}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
module_0_["aniseed/module"] = name_0_
|
|
||||||
module_0_["aniseed/locals"] = ((module_0_)["aniseed/locals"] or {})
|
|
||||||
do end (module_0_)["aniseed/local-fns"] = ((module_0_)["aniseed/local-fns"] or {})
|
|
||||||
do end (package.loaded)[name_0_] = module_0_
|
|
||||||
_0_ = module_0_
|
|
||||||
end
|
|
||||||
local autoload
|
|
||||||
local function _1_(...)
|
|
||||||
return (require("conjure-macroexpand.aniseed.autoload")).autoload(...)
|
|
||||||
end
|
|
||||||
autoload = _1_
|
|
||||||
local function _2_(...)
|
|
||||||
local ok_3f_0_, val_0_ = nil, nil
|
|
||||||
local function _2_()
|
|
||||||
return {require("conjure-macroexpand.aniseed.core"), require("conjure.bridge"), require("conjure.client"), require("conjure.eval"), require("conjure.extract"), require("conjure.log"), require("conjure.mapping"), require("conjure-macroexpand.aniseed.nvim")}
|
|
||||||
end
|
|
||||||
ok_3f_0_, val_0_ = pcall(_2_)
|
|
||||||
if ok_3f_0_ then
|
|
||||||
_0_["aniseed/local-fns"] = {require = {a = "conjure-macroexpand.aniseed.core", bridge = "conjure.bridge", client = "conjure.client", eval = "conjure.eval", extract = "conjure.extract", log = "conjure.log", mapping = "conjure.mapping", nvim = "conjure-macroexpand.aniseed.nvim"}}
|
|
||||||
return val_0_
|
|
||||||
else
|
|
||||||
return print(val_0_)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local _local_0_ = _2_(...)
|
|
||||||
local a = _local_0_[1]
|
|
||||||
local bridge = _local_0_[2]
|
|
||||||
local client = _local_0_[3]
|
|
||||||
local eval = _local_0_[4]
|
|
||||||
local extract = _local_0_[5]
|
|
||||||
local log = _local_0_[6]
|
|
||||||
local mapping = _local_0_[7]
|
|
||||||
local nvim = _local_0_[8]
|
|
||||||
local _2amodule_2a = _0_
|
|
||||||
local _2amodule_name_2a = "conjure-macroexpand.main"
|
local _2amodule_name_2a = "conjure-macroexpand.main"
|
||||||
do local _ = ({nil, _0_, nil, {{}, nil, nil, nil}})[2] end
|
local _2amodule_2a
|
||||||
local current_form
|
|
||||||
do
|
do
|
||||||
local v_0_
|
package.loaded[_2amodule_name_2a] = {}
|
||||||
local function current_form0()
|
_2amodule_2a = package.loaded[_2amodule_name_2a]
|
||||||
|
end
|
||||||
|
local _2amodule_locals_2a
|
||||||
|
do
|
||||||
|
_2amodule_2a["aniseed/locals"] = {}
|
||||||
|
_2amodule_locals_2a = (_2amodule_2a)["aniseed/locals"]
|
||||||
|
end
|
||||||
|
local a, bridge, client, eval, extract, log, mapping, nvim = require("conjure-macroexpand.aniseed.core"), require("conjure.bridge"), require("conjure.client"), require("conjure.eval"), require("conjure.extract"), require("conjure.log"), require("conjure.mapping"), require("conjure-macroexpand.aniseed.nvim")
|
||||||
|
do end (_2amodule_locals_2a)["a"] = a
|
||||||
|
_2amodule_locals_2a["bridge"] = bridge
|
||||||
|
_2amodule_locals_2a["client"] = client
|
||||||
|
_2amodule_locals_2a["eval"] = eval
|
||||||
|
_2amodule_locals_2a["extract"] = extract
|
||||||
|
_2amodule_locals_2a["log"] = log
|
||||||
|
_2amodule_locals_2a["mapping"] = mapping
|
||||||
|
_2amodule_locals_2a["nvim"] = nvim
|
||||||
|
local function current_form()
|
||||||
local form = extract.form({})
|
local form = extract.form({})
|
||||||
if form then
|
if form then
|
||||||
local _let_0_ = form
|
local _let_1_ = form
|
||||||
local content = _let_0_["content"]
|
local content = _let_1_["content"]
|
||||||
return content
|
return content
|
||||||
|
else
|
||||||
|
return nil
|
||||||
end
|
end
|
||||||
end
|
|
||||||
v_0_ = current_form0
|
|
||||||
local t_0_ = (_0_)["aniseed/locals"]
|
|
||||||
t_0_["current-form"] = v_0_
|
|
||||||
current_form = v_0_
|
|
||||||
end
|
end
|
||||||
local clj_client
|
_2amodule_locals_2a["current-form"] = current_form
|
||||||
do
|
local function clj_client(f, args)
|
||||||
local v_0_
|
|
||||||
local function clj_client0(f, args)
|
|
||||||
return client["with-filetype"]("clojure", f, args)
|
return client["with-filetype"]("clojure", f, args)
|
||||||
end
|
|
||||||
v_0_ = clj_client0
|
|
||||||
local t_0_ = (_0_)["aniseed/locals"]
|
|
||||||
t_0_["clj-client"] = v_0_
|
|
||||||
clj_client = v_0_
|
|
||||||
end
|
end
|
||||||
local output_expanded
|
_2amodule_locals_2a["clj-client"] = clj_client
|
||||||
do
|
local function output_expanded(orig)
|
||||||
local v_0_
|
|
||||||
local function output_expanded0(orig)
|
|
||||||
local function _3_(r)
|
local function _3_(r)
|
||||||
return log.append({("; " .. orig), r}, {["break?"] = true})
|
return log.append({("; " .. orig), r}, {["break?"] = true})
|
||||||
end
|
end
|
||||||
return _3_
|
return _3_
|
||||||
end
|
|
||||||
v_0_ = output_expanded0
|
|
||||||
local t_0_ = (_0_)["aniseed/locals"]
|
|
||||||
t_0_["output-expanded"] = v_0_
|
|
||||||
output_expanded = v_0_
|
|
||||||
end
|
end
|
||||||
local clojure_macroexpand
|
_2amodule_locals_2a["output-expanded"] = output_expanded
|
||||||
do
|
local function clj_macroexpand(expand_cmd)
|
||||||
local v_0_
|
|
||||||
do
|
|
||||||
local v_0_0
|
|
||||||
local function clojure_macroexpand0(expand_cmd)
|
|
||||||
local form = current_form()
|
local form = current_form()
|
||||||
local me_form = ("(" .. (expand_cmd or "clojure.walk/macroexpand-all") .. " '" .. form .. ")")
|
local me_form = ("(" .. (expand_cmd or "clojure.walk/macroexpand-all") .. " '" .. form .. ")")
|
||||||
return clj_client(eval["eval-str"], {["on-result"] = output_expanded(me_form), ["passive?"] = true, code = me_form, origin = "conjure-macroexpand"})
|
return clj_client(eval["eval-str"], {origin = "conjure-macroexpand", code = me_form, ["passive?"] = true, ["on-result"] = output_expanded(me_form)})
|
||||||
end
|
|
||||||
v_0_0 = clojure_macroexpand0
|
|
||||||
_0_["clojure-macroexpand"] = v_0_0
|
|
||||||
v_0_ = v_0_0
|
|
||||||
end
|
|
||||||
local t_0_ = (_0_)["aniseed/locals"]
|
|
||||||
t_0_["clojure-macroexpand"] = v_0_
|
|
||||||
clojure_macroexpand = v_0_
|
|
||||||
end
|
end
|
||||||
local add_buf_mappings
|
_2amodule_2a["clj-macroexpand"] = clj_macroexpand
|
||||||
do
|
local function add_buf_mappings()
|
||||||
local v_0_
|
local function _4_()
|
||||||
do
|
return clj_macroexpand()
|
||||||
local v_0_0
|
|
||||||
local function add_buf_mappings0()
|
|
||||||
mapping.buf("n", nil, "cm", ":ConjureCljMacroexpand<CR>")
|
|
||||||
mapping.buf("n", nil, "c0", ":ConjureCljMacroexpand0<CR>")
|
|
||||||
return mapping.buf("n", nil, "c1", ":ConjureCljMacroexpand1<CR>")
|
|
||||||
end
|
end
|
||||||
v_0_0 = add_buf_mappings0
|
mapping.buf("CljMacroexpand", "cm", _4_, {desc = "Call macroexpand-all on the symbol under the cursor"})
|
||||||
_0_["add-buf-mappings"] = v_0_0
|
local function _5_()
|
||||||
v_0_ = v_0_0
|
return clj_macroexpand("clojure.core/macroexpand")
|
||||||
end
|
end
|
||||||
local t_0_ = (_0_)["aniseed/locals"]
|
mapping.buf("CljMacroexpand0", "c0", _5_, {desc = "Call macroexpand on the symbol under the cursor"})
|
||||||
t_0_["add-buf-mappings"] = v_0_
|
local function _6_()
|
||||||
add_buf_mappings = v_0_
|
return clj_macroexpand("clojure.core/macroexpand-1")
|
||||||
|
end
|
||||||
|
return mapping.buf("CljMacroexpand1", "c1", _6_, {desc = "Call macroexpand-1 on the symbol under the cursor"})
|
||||||
end
|
end
|
||||||
local init
|
_2amodule_2a["add-buf-mappings"] = add_buf_mappings
|
||||||
do
|
local function init()
|
||||||
local v_0_
|
|
||||||
do
|
|
||||||
local v_0_0
|
|
||||||
local function init0()
|
|
||||||
nvim.ex.command_("ConjureCljMacroexpand", bridge["viml->lua"]("conjure-macroexpand.main", "clojure-macroexpand"))
|
|
||||||
nvim.ex.command_("ConjureCljMacroexpand0", bridge["viml->lua"]("conjure-macroexpand.main", "clojure-macroexpand", {args = "\"clojure.core/macroexpand\""}))
|
|
||||||
nvim.ex.command_("ConjureCljMacroexpand1", bridge["viml->lua"]("conjure-macroexpand.main", "clojure-macroexpand", {args = "\"clojure.core/macroexpand-1\""}))
|
|
||||||
if (not nvim.g.conjure_macroexpand_disable_mappings or (0 == nvim.g.conjure_macroexpand_disable_mappings)) then
|
if (not nvim.g.conjure_macroexpand_disable_mappings or (0 == nvim.g.conjure_macroexpand_disable_mappings)) then
|
||||||
return nvim.ex.autocmd("FileType", "clojure", bridge["viml->lua"]("conjure-macroexpand.main", "add-buf-mappings"))
|
return nvim.ex.autocmd("FileType", "clojure", bridge["viml->lua"]("conjure-macroexpand.main", "add-buf-mappings"))
|
||||||
|
else
|
||||||
|
return nil
|
||||||
end
|
end
|
||||||
end
|
|
||||||
v_0_0 = init0
|
|
||||||
_0_["init"] = v_0_0
|
|
||||||
v_0_ = v_0_0
|
|
||||||
end
|
|
||||||
local t_0_ = (_0_)["aniseed/locals"]
|
|
||||||
t_0_["init"] = v_0_
|
|
||||||
init = v_0_
|
|
||||||
end
|
end
|
||||||
return nil
|
_2amodule_2a["init"] = init
|
||||||
|
return _2amodule_2a
|
Loading…
x
Reference in New Issue
Block a user