Compare commits
No commits in common. "a14f999ab9c839516de431ca2b8e82413a7c4dd4" and "e87d0c7ec30f4c87e6e8acc010fbb020cefe5531" have entirely different histories.
a14f999ab9
...
e87d0c7ec3
2 changed files with 10 additions and 57 deletions
|
@ -10,9 +10,6 @@ cmp.setup({
|
||||||
ellipsis_char = "...", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead
|
ellipsis_char = "...", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
enabled = function()
|
|
||||||
return not luasnip.jumpable(1)
|
|
||||||
end,
|
|
||||||
snippet = {
|
snippet = {
|
||||||
-- REQUIRED - you must specify a snippet engine
|
-- REQUIRED - you must specify a snippet engine
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
|
@ -26,19 +23,19 @@ cmp.setup({
|
||||||
["<S-CR>"] = cmp.mapping.abort(),
|
["<S-CR>"] = cmp.mapping.abort(),
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if luasnip.jumpable(1) then
|
||||||
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
|
|
||||||
elseif luasnip.jumpable(1) then
|
|
||||||
luasnip.jump(1)
|
luasnip.jump(1)
|
||||||
|
elseif cmp.visible() then
|
||||||
|
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, { "i", "s" }),
|
||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if luasnip.jumpable(-1) then
|
||||||
cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select })
|
|
||||||
elseif luasnip.jumpable(-1) then
|
|
||||||
luasnip.jump(-1)
|
luasnip.jump(-1)
|
||||||
|
elseif cmp.visible() then
|
||||||
|
cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select })
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
|
@ -46,6 +43,8 @@ cmp.setup({
|
||||||
["<C-n>"] = cmp.mapping(function(fallback)
|
["<C-n>"] = cmp.mapping(function(fallback)
|
||||||
if luasnip.choice_active() then
|
if luasnip.choice_active() then
|
||||||
luasnip.change_choice(1)
|
luasnip.change_choice(1)
|
||||||
|
elseif cmp.visible() then
|
||||||
|
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
|
@ -53,6 +52,8 @@ cmp.setup({
|
||||||
["<C-p>"] = cmp.mapping(function(fallback)
|
["<C-p>"] = cmp.mapping(function(fallback)
|
||||||
if luasnip.choice_active() then
|
if luasnip.choice_active() then
|
||||||
luasnip.change_choice(-1)
|
luasnip.change_choice(-1)
|
||||||
|
elseif cmp.visible() then
|
||||||
|
cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select })
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
|
|
|
@ -183,51 +183,6 @@ local dot_try = postfix(".try", {
|
||||||
end),
|
end),
|
||||||
})
|
})
|
||||||
|
|
||||||
local parr = s(
|
|
||||||
"parr",
|
|
||||||
fmt(
|
|
||||||
[[
|
|
||||||
:param {name}: {description}
|
|
||||||
:type {name}: {type}
|
|
||||||
]],
|
|
||||||
{
|
|
||||||
name = i(1, "name"),
|
|
||||||
description = i(2, "description"),
|
|
||||||
type = i(3, "type"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
repeat_duplicates = true,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
local retr = s(
|
|
||||||
"retr",
|
|
||||||
fmt(
|
|
||||||
[[
|
|
||||||
:return: {description}
|
|
||||||
:rtype: {rtype}
|
|
||||||
]],
|
|
||||||
{
|
|
||||||
description = i(1, "description"),
|
|
||||||
rtype = i(2, "rtype"),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
local raisr = s(
|
|
||||||
"raisr",
|
|
||||||
fmt(
|
|
||||||
[[
|
|
||||||
:raises {exception}: {description}
|
|
||||||
]],
|
|
||||||
{
|
|
||||||
exception = i(1, "Exception"),
|
|
||||||
description = i(2, "description"),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
def,
|
def,
|
||||||
defs,
|
defs,
|
||||||
|
@ -236,7 +191,4 @@ return {
|
||||||
dot_items,
|
dot_items,
|
||||||
dot_try,
|
dot_try,
|
||||||
enum,
|
enum,
|
||||||
parr,
|
|
||||||
retr,
|
|
||||||
raisr,
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue