diff options
Diffstat (limited to 'lua/telescope/utils.lua')
| -rw-r--r-- | lua/telescope/utils.lua | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lua/telescope/utils.lua b/lua/telescope/utils.lua index 4606e19..ecd7fd4 100644 --- a/lua/telescope/utils.lua +++ b/lua/telescope/utils.lua @@ -284,4 +284,11 @@ function utils.strcharpart(str, nchar, charlen) return str:sub(nbyte + 1, nbyte + len) end +utils.align_str = function(string, width, right_justify) + local str_len = utils.strdisplaywidth(string) + return right_justify + and string.rep(" ", width - str_len)..string + or string..string.rep(" ", width - str_len) +end + return utils |
