summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael <glepnir@gopherhub.org>2021-03-02 16:34:29 +0800
committerGitHub <noreply@github.com>2021-03-02 16:34:29 +0800
commit677b44d3a08d69c7fd7d9a7dcfe897b7839fd976 (patch)
tree04a5c4803c52a780c60d27725d444650789ae2e5
parent678494e503d3c717df8295f55a6f3c7d3309b7fa (diff)
Enhance Telescope command (#588)
* Enhance Telescope command close #581 * bug fix
-rw-r--r--lua/telescope/command.lua5
-rw-r--r--plugin/telescope.vim2
2 files changed, 6 insertions, 1 deletions
diff --git a/lua/telescope/command.lua b/lua/telescope/command.lua
index d28f540..3034164 100644
--- a/lua/telescope/command.lua
+++ b/lua/telescope/command.lua
@@ -131,6 +131,11 @@ end
function command.load_command(cmd,...)
local args = {...}
+ if cmd == nil then
+ run_command({cmd = 'builtin'})
+ return
+ end
+
local user_opts = {}
user_opts['cmd'] = cmd
user_opts.opts = {}
diff --git a/plugin/telescope.vim b/plugin/telescope.vim
index 0fd0b60..2ced08b 100644
--- a/plugin/telescope.vim
+++ b/plugin/telescope.vim
@@ -100,4 +100,4 @@ function! s:telescope_complete(arg,line,pos)
endfunction
" Telescope Commands with complete
-command! -nargs=+ -complete=custom,s:telescope_complete Telescope lua require('telescope.command').load_command(<f-args>)
+command! -nargs=* -complete=custom,s:telescope_complete Telescope lua require('telescope.command').load_command(<f-args>)