Fix parantheses bug and use string.rep (#1297)

This commit is contained in:
Zahid
2022-11-12 03:16:12 +01:00
committed by GitHub
parent 69c85860d7
commit c53dd36adc

View File

@@ -122,9 +122,9 @@ native_entries_view.select_next_item = function(self, option)
end
if self:visible() then
if (option.behavior or types.cmp.SelectBehavior.Insert) == types.cmp.SelectBehavior.Insert then
feedkeys.call(keymap.t(string.format('%s<C-n>', option.count), 'n', callback))
feedkeys.call(keymap.t(string.rep('<C-n>', option.count)), 'n', callback)
else
feedkeys.call(keymap.t(string.format('%s<Down>', option.count)), 'n', callback)
feedkeys.call(keymap.t(string.rep('<Down>', option.count)), 'n', callback)
end
end
end
@@ -135,9 +135,9 @@ native_entries_view.select_prev_item = function(self, option)
end
if self:visible() then
if (option.behavior or types.cmp.SelectBehavior.Insert) == types.cmp.SelectBehavior.Insert then
feedkeys.call(keymap.t(string.format('%s<C-p>', option.count), 'n', callback))
feedkeys.call(keymap.t(string.rep('<C-p>', option.count)), 'n', callback)
else
feedkeys.call(keymap.t(string.format('%s<Up>', option.count)), 'n', callback)
feedkeys.call(keymap.t(string.rep('<Up>', option.count)), 'n', callback)
end
end
end