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).
This commit is contained in:
James Trew
2024-05-15 21:09:10 -04:00
committed by GitHub
parent 6f6bb80655
commit 52f500110b

View File

@@ -636,6 +636,8 @@ function Picker:find()
local start_time = vim.loop.hrtime()
local prompt = self:_get_next_filtered_prompt()
state.set_global_key("current_line", prompt)
if self.__locations_input == true then
local filename, line_number, column_number = utils.__separate_file_path_location(prompt)
@@ -1455,7 +1457,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)