Skip to content

Commit

Permalink
[Fix] dynamic import generator to avoid initial module not found error (
Browse files Browse the repository at this point in the history
  • Loading branch information
mistricky authored Apr 2, 2024
1 parent fefaaa1 commit efeb8d8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lua/codesnap/init.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
local static = require("codesnap.static")
local table_utils = require("codesnap.utils.table")
local generator = require("generator")
local string_utils = require("codesnap.utils.string")
local visual_utils = require("codesnap.utils.visual")
local path_utils = require("codesnap.utils.path")
Expand Down Expand Up @@ -46,7 +45,7 @@ local function get_config(specify_extension)
end

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.notify("Save snapshot into clipboard successfully")
end
Expand All @@ -56,7 +55,7 @@ function main.save_snapshot(extension)
error("Cannot find save_path from config")
end

generator.save_snapshot(get_config(extension))
require("generator").save_snapshot(get_config(extension))
vim.cmd("delmarks <>")
vim.notify("Save snapshot in " .. static.config.save_path .. " successfully")
end
Expand Down

0 comments on commit efeb8d8

Please sign in to comment.