File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 11return {
22 " abecodes/tabout.nvim" ,
33 event = " InsertEnter" ,
4- dependencies = {
5- " nvim-treesitter/nvim-treesitter " ,
4+ dependencies = { " nvim-treesitter/nvim-treesitter " },
5+ specs = {
66 {
77 " hrsh7th/nvim-cmp" ,
8+ optional = true ,
89 opts = function (_ , opts )
910 local cmp = require " cmp"
11+ local snippet_jumpable = function () return vim .snippet and vim .snippet .active { direction = 1 } end
12+ local snippet_jump = vim .schedule_wrap (function () vim .snippet .jump (1 ) end )
1013 local luasnip_avail , luasnip = pcall (require , " luasnip" )
14+ if luasnip_avail then
15+ snippet_jumpable = luasnip .expand_or_jumpable
16+ snippet_jump = luasnip .expand_or_jump
17+ end
1118 opts .mapping [" <Tab>" ] = cmp .mapping (function (fallback )
1219 if cmp .visible () then
1320 cmp .select_next_item ()
14- elseif luasnip_avail and luasnip . expand_or_jumpable () then
15- luasnip . expand_or_jump ()
21+ elseif vim . api . nvim_get_mode () ~= " c " and snippet_jumpable () then
22+ snippet_jump ()
1623 elseif not luasnip_avail and pcall (vim .snippet .active , { direction = 1 }) then
1724 vim .snippet .jump (1 )
1825 else
You can’t perform that action at this time.
0 commit comments