-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
196 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
local types = require('cmp.types') | ||
|
||
local mapping = {} | ||
|
||
---Create complete mapping | ||
mapping.complete = function() | ||
return { | ||
type = 'complete', | ||
} | ||
end | ||
|
||
---Create close mapping | ||
mapping.close = function() | ||
return { | ||
type = 'close', | ||
} | ||
end | ||
|
||
---Create scroll mapping | ||
mapping.scroll = { | ||
up = function(delta) | ||
return { | ||
type = 'scroll.up', | ||
delta = delta or 4, | ||
} | ||
end, | ||
down = function(delta) | ||
return { | ||
type = 'scroll.down', | ||
delta = delta or 4, | ||
} | ||
end, | ||
} | ||
|
||
---Create item mapping | ||
mapping.item = { | ||
prev = function() | ||
return { | ||
type = 'item.prev', | ||
} | ||
end, | ||
next = function() | ||
return { | ||
type = 'item.next', | ||
} | ||
end, | ||
} | ||
|
||
---Create confirm mapping | ||
mapping.confirm = function(option) | ||
option = option or {} | ||
return { | ||
type = 'confirm', | ||
select = option.select or false, | ||
behavior = option.behavior or types.cmp.ConfirmBehavior.Insert, | ||
} | ||
end | ||
|
||
return mapping |
Oops, something went wrong.