forked from mirror/codesnap.nvim
[Fix] dynamic import generator to avoid initial module not found error (#60)
parent
fefaaa12be
commit
efeb8d89e2
|
@ -1,6 +1,5 @@
|
||||||
local static = require("codesnap.static")
|
local static = require("codesnap.static")
|
||||||
local table_utils = require("codesnap.utils.table")
|
local table_utils = require("codesnap.utils.table")
|
||||||
local generator = require("generator")
|
|
||||||
local string_utils = require("codesnap.utils.string")
|
local string_utils = require("codesnap.utils.string")
|
||||||
local visual_utils = require("codesnap.utils.visual")
|
local visual_utils = require("codesnap.utils.visual")
|
||||||
local path_utils = require("codesnap.utils.path")
|
local path_utils = require("codesnap.utils.path")
|
||||||
|
@ -46,7 +45,7 @@ local function get_config(specify_extension)
|
||||||
end
|
end
|
||||||
|
|
||||||
function main.copy_into_clipboard(extension)
|
function main.copy_into_clipboard(extension)
|
||||||
generator.copy_into_clipboard(get_config(extension))
|
require("generator").copy_into_clipboard(get_config(extension))
|
||||||
vim.cmd("delmarks <>")
|
vim.cmd("delmarks <>")
|
||||||
vim.notify("Save snapshot into clipboard successfully")
|
vim.notify("Save snapshot into clipboard successfully")
|
||||||
end
|
end
|
||||||
|
@ -56,7 +55,7 @@ function main.save_snapshot(extension)
|
||||||
error("Cannot find save_path from config")
|
error("Cannot find save_path from config")
|
||||||
end
|
end
|
||||||
|
|
||||||
generator.save_snapshot(get_config(extension))
|
require("generator").save_snapshot(get_config(extension))
|
||||||
vim.cmd("delmarks <>")
|
vim.cmd("delmarks <>")
|
||||||
vim.notify("Save snapshot in " .. static.config.save_path .. " successfully")
|
vim.notify("Save snapshot in " .. static.config.save_path .. " successfully")
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue