Skip to content

Commit

Permalink
fix: prompt_prefix leading whitespace normal mode cc (nvim-telescop…
Browse files Browse the repository at this point in the history
…e#2699)

* fix: `prompt_prefix` leading whitespace normal mode cc

* [docgen] Update doc/telescope.txt
skip-checks: true

---------

Co-authored-by: Github Actions <actions@github>
  • Loading branch information
2 people authored and rameshsanth committed Nov 17, 2023
1 parent 13781f9 commit fc76852
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lua/telescope/pickers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,10 @@ end

--- Get the prompt text without the prompt prefix.
function Picker:_get_prompt()
return vim.api.nvim_buf_get_lines(self.prompt_bufnr, 0, 1, false)[1]:sub(#self.prompt_prefix + 1)
local cursor_line = vim.api.nvim_win_get_cursor(self.prompt_win)[1] - 1
return vim.api
.nvim_buf_get_lines(self.prompt_bufnr, cursor_line, cursor_line + 1, false)[1]
:sub(#self.prompt_prefix + 1)
end

function Picker:_reset_highlights()
Expand Down

0 comments on commit fc76852

Please sign in to comment.