···11+local target_width = vim.bo.textwidth > 0 and vim.bo.textwidth or 80
22+33+local justify_right_second_col = function(parts, _)
44+ -- For the line 'aaa *aaa*' the row is `{ 'aaa', ' ', '*aaa*'}`
55+ for _, row in ipairs(parts) do
66+ -- Make sure that separator column doesn't affect
77+ row[2] = ""
88+ -- Justify second column so that its right part is at `target_width`
99+ row[3] = string.rep(" ", target_width - vim.fn.strchars(row[1]) - vim.fn.strchars(row[3])) .. row[3]
1010+ end
1111+end
1212+1313+local align_helptag = function(steps, opts)
1414+ -- Split based on whitespace
1515+ opts.split_pattern = "%s+"
1616+ steps.justify = MiniAlign.new_step("justify_helptag", justify_right_second_col)
1717+end
1818+1919+vim.b.minialign_config = { modifiers = { ["*"] = align_helptag } }