Skip to content

Commit 71f6772

Browse files
committed
save code for color support for cmdline
1 parent 3f1631f commit 71f6772

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

lua/easycomplete/cmdline.lua

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -475,11 +475,26 @@ this.REG_CMP_HANDLER = {
475475
end
476476
end
477477
},
478+
-- {
479+
-- -- highlight colors name
480+
-- patterns = {
481+
-- "^hi%s.*gui[fb]g=$",
482+
-- "^highlight%s.*gui[fb]g=$"
483+
-- },
484+
-- get_cmp_items = function()
485+
-- if this.insearch() then
486+
-- return this.get_normal_search_cmp()
487+
-- else
488+
-- local colors = this.native_colors
489+
-- return colors
490+
-- end
491+
-- end
492+
-- },
478493
{
479-
-- highlight
494+
-- highlight color groups
480495
pattern = {
481496
"^hi%s.*$",
482-
"^highlight%s.*$"
497+
"^highlight%s.*$",
483498
},
484499
get_cmp_items = function()
485500
if this.insearch() then
@@ -720,6 +735,33 @@ this.cmd_type = {
720735
user = { 'user' }
721736
}
722737

738+
this.native_colors = {
739+
"black","dimgray","dimgrey","gray","grey","darkgray","darkgrey","silver",
740+
"lightgray","lightgrey","gainsboro","whitesmoke","white","snow","rosybrown",
741+
"lightcoral","indianred","brown","firebrick","maroon","darkred","red",
742+
"mistyrose","salmon","tomato","darksalmon","coral","orangered","lightsalmon",
743+
"sienna","seashell","chocolate","saddlebrown","sandybrown","peachpuff","peru",
744+
"linen","bisque","darkorange","burlywood","antiquewhite","tan","navajowhite",
745+
"blanchedalmond","papayawhip","moccasin","orange","wheat","oldlace","floralwhite",
746+
"darkgoldenrod","goldenrod","cornsilk","gold","lemonchiffon","khaki","palegoldenrod",
747+
"darkkhaki","ivory","beige","lightyellow","lightgoldenrodyellow","olive","yellow",
748+
"olivedrab","yellowgreen","darkolivegreen","greenyellow","chartreuse","lawngreen",
749+
"honeydew","darkseagreen","palegreen","lightgreen","forestgreen","limegreen",
750+
"darkgreen","green","lime","seagreen","mediumseagreen","springgreen","mintcream",
751+
"mediumspringgreen","mediumaquamarine","aquamarine","turquoise","lightseagreen",
752+
"mediumturquoise","azure","lightcyan","aqua","cyan","darkturquoise","cadetblue",
753+
"powderblue","lightblue","deepskyblue","skyblue","lightskyblue","steelblue",
754+
"aliceblue","dodgerblue","lightslategray","lightslategrey","slategray","slategrey",
755+
"lightsteelblue","cornflowerblue","royalblue","ghostwhite","lavender","midnightblue",
756+
"navy","darkblue","mediumblue","blue","slateblue","darkslateblue","mediumslateblue",
757+
"mediumpurple","rebeccapurple","blueviolet","indigo","darkorchid","darkviolet",
758+
"mediumorchid","thistle","plum","violet","purple","darkmagenta","fuchsia","magenta",
759+
"orchid","mediumvioletred","deeppink","hotpink","lavenderblush","palevioletred",
760+
"crimson","pink","lightpink"
761+
}
762+
763+
764+
723765
function this.init_once()
724766
if vim.g.easycomplete_cmdline ~= 1 then
725767
return

0 commit comments

Comments
 (0)