summaryrefslogtreecommitdiff
path: root/lua/telescope/pickers.lua
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2021-08-20 13:35:21 -0400
committerGitHub <noreply@github.com>2021-08-20 13:35:21 -0400
commitea5ab8f7c42cf681f9174b2c4de0b82044417801 (patch)
treebd721744dd22c45415b4885e85c8815832c9155b /lua/telescope/pickers.lua
parentbc470fe59f8157f22e1bbd1cea8d395a5c859d0b (diff)
feat: Use nvim_buf_set_extmark right_align to do the magic for us (#1138)
Diffstat (limited to 'lua/telescope/pickers.lua')
-rw-r--r--lua/telescope/pickers.lua16
1 files changed, 4 insertions, 12 deletions
diff --git a/lua/telescope/pickers.lua b/lua/telescope/pickers.lua
index f8e48f1..11fa2fa 100644
--- a/lua/telescope/pickers.lua
+++ b/lua/telescope/pickers.lua
@@ -976,19 +976,11 @@ function Picker:get_status_updater(prompt_win, prompt_bufnr)
end
local text = self:get_status_text(opts)
- local prompt_len = #self.prompt_prefix + #current_prompt
-
- local padding = string.rep(" ", vim.api.nvim_win_get_width(prompt_win) - prompt_len - #text)
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" } }, {})
-
- -- TODO: Wait for bfredl
- -- vim.api.nvim_buf_set_extmark(prompt_bufnr, ns_telescope_prompt, 0, 0, {
- -- end_line = 0,
- -- -- end_col = start_column + #text,
- -- virt_text = { { text, "NonText", } },
- -- virt_text_pos = "eol",
- -- })
+ vim.api.nvim_buf_set_extmark(prompt_bufnr, ns_telescope_prompt, 0, 0, {
+ virt_text = { { text, "NonText" } },
+ virt_text_pos = "right_align",
+ })
self:_increment "status"
end