Skip to content

Commit c63baef

Browse files
authored
Merge pull request #7 from peniar/main
Show value of css variables
2 parents bfd14d3 + 51dfe64 commit c63baef

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lua/css-vars/init.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ M.setup = function(cfg)
1212

1313
local args = {
1414
"-e",
15-
"[^\\w](--[^:)]*):",
15+
"[^\\w](--[^:)]*):([^;]+);",
1616
"-r",
17-
"'$1'",
17+
"'$1' '$2'",
1818
"-o",
1919
"--no-filename",
2020
}
@@ -62,7 +62,7 @@ M.setup = function(cfg)
6262
local items = {}
6363
local processed = {}
6464
for _, item in pairs(result) do
65-
local css_var = (item:gsub("'%-(.*)'", "%1"))
65+
local css_var, css_value = item:match("^'%-(.-)' '(.-)'")
6666
if processed[css_var] then
6767
goto continue
6868
end
@@ -71,6 +71,7 @@ M.setup = function(cfg)
7171
filterText = css_var,
7272
label = "-" .. css_var,
7373
kind = 6,
74+
documentation = css_value,
7475
textEdit = {
7576
newText = css_var,
7677
range = {

0 commit comments

Comments
 (0)