diff --git a/lua/oil/columns.lua b/lua/oil/columns.lua index c3f9284..7140f2a 100644 --- a/lua/oil/columns.lua +++ b/lua/oil/columns.lua @@ -150,8 +150,9 @@ end M.parse_col = function(adapter, line, col_def) local name, conf = util.split_config(col_def) -- If rendering failed, there will just be a "-" - if vim.startswith(line, "- ") then - return nil, line:sub(3) + local empty_col, rem = line:match("^(-%s+)(.*)$") + if empty_col then + return nil, rem end local column = M.get_column(adapter, name) if column then diff --git a/lua/oil/mutator/parser.lua b/lua/oil/mutator/parser.lua index 1228c62..099efc1 100644 --- a/lua/oil/mutator/parser.lua +++ b/lua/oil/mutator/parser.lua @@ -96,7 +96,7 @@ M.parse_line = function(adapter, line, column_defs) local range = { start } local start_len = string.len(rem) 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) end ret[name] = value