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
|
|
@ -108,7 +108,7 @@ M.show_help = function(keymaps)
|
|||
local highlights = {}
|
||||
local max_line = 1
|
||||
for _, entry in ipairs(keymap_entries) do
|
||||
local line = string.format(" %s %s", util.rpad(entry.str, max_lhs), entry.desc)
|
||||
local line = string.format(" %s %s", util.pad_align(entry.str, max_lhs, "left"), entry.desc)
|
||||
max_line = math.max(max_line, vim.api.nvim_strwidth(line))
|
||||
table.insert(lines, line)
|
||||
local start = 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue