summaryrefslogtreecommitdiff
path: root/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
parentbc470fe59f8157f22e1bbd1cea8d395a5c859d0b (diff)
feat: Use nvim_buf_set_extmark right_align to do the magic for us (#1138)
Diffstat (limited to 'lua')
-rw-r--r--lua/telescope/config.lua2
-rw-r--r--lua/telescope/pickers.lua16
2 files changed, 5 insertions, 13 deletions
diff --git a/lua/telescope/config.lua b/lua/telescope/config.lua
index 1b0ce86..a4899af 100644
--- a/lua/telescope/config.lua
+++ b/lua/telescope/config.lua
@@ -233,7 +233,7 @@ local telescope_defaults = {
-- status_icon = "*"
-- end
- return string.format("%s / %s", xx, yy)
+ return string.format("%s / %s ", xx, yy)
end,
},
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