fix: line parsing for empty columns
This commit is contained in:
parent
57db10d748
commit
0715f1b0aa
2 changed files with 4 additions and 3 deletions
|
|
@ -150,8 +150,9 @@ end
|
||||||
M.parse_col = function(adapter, line, col_def)
|
M.parse_col = function(adapter, line, col_def)
|
||||||
local name, conf = util.split_config(col_def)
|
local name, conf = util.split_config(col_def)
|
||||||
-- If rendering failed, there will just be a "-"
|
-- If rendering failed, there will just be a "-"
|
||||||
if vim.startswith(line, "- ") then
|
local empty_col, rem = line:match("^(-%s+)(.*)$")
|
||||||
return nil, line:sub(3)
|
if empty_col then
|
||||||
|
return nil, rem
|
||||||
end
|
end
|
||||||
local column = M.get_column(adapter, name)
|
local column = M.get_column(adapter, name)
|
||||||
if column then
|
if column then
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ M.parse_line = function(adapter, line, column_defs)
|
||||||
local range = { start }
|
local range = { start }
|
||||||
local start_len = string.len(rem)
|
local start_len = string.len(rem)
|
||||||
value, rem = columns.parse_col(adapter, rem, def)
|
value, rem = columns.parse_col(adapter, rem, def)
|
||||||
if not value or not rem then
|
if not rem then
|
||||||
return nil, string.format("Parsing %s failed", name)
|
return nil, string.format("Parsing %s failed", name)
|
||||||
end
|
end
|
||||||
ret[name] = value
|
ret[name] = value
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue