Skip to content

Commit edeb458

Browse files
committed
feat(plugin): only load modules when calling the command
1 parent 582fa5d commit edeb458

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

plugin/devto-nvim.lua

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
local M = {}
2-
local devto = require("devto-nvim")
3-
local notify = require("devto-nvim.notify")
4-
51
local commands = {
62
feed = "feed",
73
my_articles = "my_articles",
@@ -12,6 +8,9 @@ local commands = {
128
vim.api.nvim_create_user_command(
139
"Devto",
1410
function(data)
11+
local devto = require("devto-nvim")
12+
local notify = require("devto-nvim.notify")
13+
1514
local args = data.args
1615

1716
if args == commands.feed then
@@ -31,4 +30,3 @@ vim.api.nvim_create_user_command(
3130
complete = function() return vim.tbl_values(commands) end
3231
}
3332
)
34-
return M

0 commit comments

Comments
 (0)