Skip to content

Commit

Permalink
fix(api)!: Simplified commands module.
Browse files Browse the repository at this point in the history
Signed-off-by: Guennadi Maximov C <[email protected]>
  • Loading branch information
DrKJeff16 committed Sep 2, 2024
1 parent e50973f commit 660a748
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ vim.g.markdown_minlines = 500
--- Call runtimepath optimizations for Arch Linux (WIP)
Distro.archlinux:setup()

Commands:setup_commands()
Commands.setup_commands()

User:setup_keys()

Expand Down
9 changes: 1 addition & 8 deletions lua/user_api/commands.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
require('user_api.types.user.commands')
local Check = require('user_api.check')

local new_cmd = vim.api.nvim_create_user_command
local set_lines = vim.api.nvim_buf_set_lines
Expand Down Expand Up @@ -29,13 +28,7 @@ function M.redir()
end, { nargs = '+', complete = 'command' })
end

function M:setup_commands() self.redir() end

function M.new()
local self = setmetatable({}, { __index = M })

return self
end
function M.setup_commands() M.redir() end

return M

Expand Down
2 changes: 1 addition & 1 deletion lua/user_api/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ M.distro = require('user_api.distro')

M.update = require('user_api.update')

M.commands = require('user_api.commands'):new()
M.commands = require('user_api.commands')

M.registered_plugins = {}

Expand Down
3 changes: 1 addition & 2 deletions lua/user_api/types/user/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

---@class User.Commands
---@field redir fun()
---@field new fun(): User.Commands
---@field setup_commands fun(self: User.Commands)
---@field setup_commands fun()

--- vim:ts=4:sts=4:sw=4:et:ai:si:sta:noci:nopi:

0 comments on commit 660a748

Please sign in to comment.