Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lua/cmp_cmdline/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,13 @@ local definitions = {
end
end

local source = require('cmp_cmdline')
-- Ignore prefix only cmdline. (e.g.: 4, '<,'>)
if not force and cmdline == '' then
if not force and #cmdline < source.cmdline_length then
return {}
end

if #arglead < source.cmdargs_length then
return {}
end

Expand All @@ -81,6 +86,9 @@ local definitions = {

local source = {}

source.cmdline_length = 1
source.cmdargs_length = 0

source.new = function()
return setmetatable({
before_line = '',
Expand Down