Skip to content

Commit

Permalink
feat: :Genghis sub-commands with smarter filtering #50
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Dec 8, 2024
1 parent b79f144 commit 88415be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/genghis/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ function M.setup(userConfig) require("genghis.config").setup(userConfig) end

vim.api.nvim_create_user_command("Genghis", function(ctx) M[ctx.args]() end, {
nargs = 1,
complete = function()
complete = function(query)
local allOps = {}
vim.list_extend(allOps, vim.tbl_keys(require("genghis.operations.file")))
vim.list_extend(allOps, vim.tbl_keys(require("genghis.operations.copy")))
vim.list_extend(allOps, vim.tbl_keys(require("genghis.operations.other")))
return allOps
return vim.tbl_filter(function(op) return op:lower():find(query, nil, true) end, allOps)
end,
})

Expand Down

0 comments on commit 88415be

Please sign in to comment.