feat: add support for column text alignment (#711)
* feat: add support for column text alignment * refactor(util): replace rpad with pad_align * refactor(columns): whitespace handling in parse_col * refactor: small changes * doc: add align option to doc generation * refactor: replace lpad with pad_align --------- Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
This commit is contained in:
parent
fbbb2a9872
commit
6b59a6cf62
7 changed files with 64 additions and 46 deletions
|
|
@ -98,13 +98,13 @@ 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 "-"
|
||||
local empty_col, rem = line:match("^(-%s+)(.*)$")
|
||||
local empty_col, rem = line:match("^%s*(-%s+)(.*)$")
|
||||
if empty_col then
|
||||
return nil, rem
|
||||
end
|
||||
local column = M.get_column(adapter, name)
|
||||
if column then
|
||||
return column.parse(line, conf)
|
||||
return column.parse(line:gsub("^%s+", ""), conf)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue