mirror of
https://github.com/zoriya/telescope.nvim.git
synced 2026-08-16 02:45:09 +00:00
fix(picker): set current_line state earlier (#3052)
Sets the `current_line` global state earlier in the event loop rather
than in `get_results_completor`. This makes it safer to access
`current_line` earlier (eg. for building an entry).
(cherry picked from commit 52f500110b)
This commit is contained in:
@@ -479,6 +479,7 @@ function Picker:find()
|
||||
local start_time = vim.loop.hrtime()
|
||||
|
||||
local prompt = self:_get_next_filtered_prompt()
|
||||
state.set_global_key("current_line", prompt)
|
||||
|
||||
-- TODO: Entry manager should have a "bulk" setter. This can prevent a lot of redraws from display
|
||||
if self.cache_picker == false or self.cache_picker.is_cached ~= true then
|
||||
@@ -1333,7 +1334,6 @@ function Picker:get_result_completor(results_bufnr, find_id, prompt, status_upda
|
||||
|
||||
self:_do_selection(prompt)
|
||||
|
||||
state.set_global_key("current_line", self:_get_prompt())
|
||||
status_updater { completed = true }
|
||||
|
||||
self:clear_extra_rows(results_bufnr)
|
||||
|
||||
Reference in New Issue
Block a user