diff options
| author | Senghan Bright <senghan.bright@deltaprojects.com> | 2020-12-18 20:43:59 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-18 20:43:59 +0100 |
| commit | 28abd7fb5309ce4157893b1584c62b35ed14c9b6 (patch) | |
| tree | 1029cbb5b2c36f2ff94c613dd58550bb184f6995 /lua/telescope/pickers.lua | |
| parent | 68c587034588b114687e26a940f7d22334879363 (diff) | |
fix results count padding (#348)
Diffstat (limited to 'lua/telescope/pickers.lua')
| -rw-r--r-- | lua/telescope/pickers.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lua/telescope/pickers.lua b/lua/telescope/pickers.lua index 2681c8b..a5079f0 100644 --- a/lua/telescope/pickers.lua +++ b/lua/telescope/pickers.lua @@ -396,7 +396,10 @@ function Picker:find() return end - local padding = string.rep(" ", vim.api.nvim_win_get_width(prompt_win) - #current_prompt - #text - 3) + local expected_prompt_len = #self.prompt_prefix + 1 + local prompt_len = #current_prompt < expected_prompt_len and expected_prompt_len or #current_prompt + + local padding = string.rep(" ", vim.api.nvim_win_get_width(prompt_win) - prompt_len - #text - 3) vim.api.nvim_buf_clear_namespace(prompt_bufnr, ns_telescope_prompt, 0, 1) vim.api.nvim_buf_set_virtual_text(prompt_bufnr, ns_telescope_prompt, 0, { {padding .. text, "NonText"} }, {}) |
