diff --git a/autoload/tui/core/plug.vim b/autoload/tui/core/plug.vim index 381716d..8ca5660 100644 --- a/autoload/tui/core/plug.vim +++ b/autoload/tui/core/plug.vim @@ -89,6 +89,10 @@ def Parse(plug_id: string, plug_options: dict = {}): dict # path: string const plug_path = tui#util#path#Join(tui#core#cached#Get('tui.plug.home'), split(plug_id, '/')[-1]) plug_info['path'] = plug_path + # branch + if has_key(plug_options, 'branch') && !empty(plug_options['branch']) + plug_info['branch'] = plug_options['branch'] + endif # enabled: bool / func var plug_enabled = v:true if has_key(plug_options, 'enabled') @@ -174,6 +178,9 @@ export def Install() var plug_info = tui_plug_registed[plug_id] if !isdirectory(plug_info['path']) var cmds = 'git clone https://github.com/' .. plug_id .. ' ' .. plug_info['path'] + if has_key(plug_info, 'branch') && !empty(plug_info['branch']) + cmds = 'git clone -b ' .. plug_info['branch'] .. ' https://github.com/' .. plug_id .. ' ' .. plug_info['path'] + endif echo "executing " .. cmds system(cmds) echo "install success"