Skip to content

Commit

Permalink
Ensure reloading module names use . instead of OS path sep #513
Browse files Browse the repository at this point in the history
  • Loading branch information
Olical committed Jul 9, 2023
1 parent 0e957e9 commit 45730ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion fnl/conjure/client/fennel/stdio.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
str conjure.aniseed.string
nvim conjure.aniseed.nvim
stdio conjure.remote.stdio
afs conjure.aniseed.fs
config conjure.config
text conjure.text
mapping conjure.mapping
Expand Down Expand Up @@ -65,7 +66,8 @@

(defn eval-reload []
(let [file-path (nvim.fn.expand "%")
module-path (nvim.fn.fnamemodify file-path ":.:r")]
relative-no-suf (nvim.fn.fnamemodify file-path ":.:r")
module-path (string.gsub relative-no-suf afs.path-sep ".")]
(log.append [(.. comment-prefix ",reload " module-path)] {:break? true})
(eval-str
{:action :eval
Expand Down
6 changes: 4 additions & 2 deletions lua/conjure/client/fennel/stdio.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ do
_2amodule_locals_2a = (_2amodule_2a)["aniseed/locals"]
end
local autoload = (require("conjure.aniseed.autoload")).autoload
local a, client, config, log, mapping, nvim, stdio, str, text, ts, _ = autoload("conjure.aniseed.core"), autoload("conjure.client"), autoload("conjure.config"), autoload("conjure.log"), autoload("conjure.mapping"), autoload("conjure.aniseed.nvim"), autoload("conjure.remote.stdio"), autoload("conjure.aniseed.string"), autoload("conjure.text"), autoload("conjure.tree-sitter"), nil
local a, afs, client, config, log, mapping, nvim, stdio, str, text, ts, _ = autoload("conjure.aniseed.core"), autoload("conjure.aniseed.fs"), autoload("conjure.client"), autoload("conjure.config"), autoload("conjure.log"), autoload("conjure.mapping"), autoload("conjure.aniseed.nvim"), autoload("conjure.remote.stdio"), autoload("conjure.aniseed.string"), autoload("conjure.text"), autoload("conjure.tree-sitter"), nil
_2amodule_locals_2a["a"] = a
_2amodule_locals_2a["afs"] = afs
_2amodule_locals_2a["client"] = client
_2amodule_locals_2a["config"] = config
_2amodule_locals_2a["log"] = log
Expand Down Expand Up @@ -89,7 +90,8 @@ end
_2amodule_2a["eval-file"] = eval_file
local function eval_reload()
local file_path = nvim.fn.expand("%")
local module_path = nvim.fn.fnamemodify(file_path, ":.:r")
local relative_no_suf = nvim.fn.fnamemodify(file_path, ":.:r")
local module_path = string.gsub(relative_no_suf, afs["path-sep"], ".")
log.append({(comment_prefix .. ",reload " .. module_path)}, {["break?"] = true})
return eval_str({action = "eval", origin = "reload", ["file-path"] = file_path, code = (",reload " .. module_path)})
end
Expand Down

0 comments on commit 45730ad

Please sign in to comment.