Skip to content

Commit c0ee29e

Browse files
authored
refactor(git_status): clean up prompt retrieval for on_complete (#2829)
relevant #2825
1 parent ae6708a commit c0ee29e

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lua/telescope/builtin/__git.lua

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -390,13 +390,7 @@ git.status = function(opts)
390390
on_complete = {
391391
function(self)
392392
local lines = self.manager:num_results()
393-
394-
-- HACK: unable to `self._get_prompt()` directly
395-
local cursor_line = vim.api.nvim_win_get_cursor(self.prompt_win)[1] - 1
396-
local prompt = vim.api
397-
.nvim_buf_get_lines(self.prompt_bufnr, cursor_line, cursor_line + 1, false)[1]
398-
:sub(#self.prompt_prefix + 1)
399-
393+
local prompt = action_state.get_current_line()
400394
if lines == 0 and prompt == "" then
401395
utils.notify("builtin.git_status", {
402396
msg = "No changes found",

0 commit comments

Comments
 (0)