Skip to content

Commit

Permalink
fix: load env variable without value
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioRibera committed Jan 6, 2024
1 parent ab722ec commit fd78929
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/cmp-dotenv/load.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ function M.load_data_from_text(content)
local line = lines_arr[v]
if not (line == nil or line == '') and string.sub(line, 1, 1) ~= '#' then
local raw_values = split_str(line, '=')
data_loaded[raw_values[1]] = { value = vim.trim(raw_values[2]), docs = docs and vim.trim(docs) or nil }
local value = raw_values[2] and vim.trim(raw_values[2]) or ''
data_loaded[raw_values[1]] = { value = value, docs = docs and vim.trim(docs) or nil }
docs = nil
else
docs = (docs or '') .. vim.trim(string.sub(line, 2)) .. '\n'
Expand Down

0 comments on commit fd78929

Please sign in to comment.