Try to fix thing for rocker

This commit is contained in:
TJ DeVries
2020-08-29 22:22:51 -04:00
parent ae9b769299
commit 1c2b1e0d0d
2 changed files with 7 additions and 3 deletions

View File

@@ -49,8 +49,8 @@ keymap["control-p"] = function(prompt_bufnr, _)
end
keymap["enter"] = function(prompt_bufnr, results_bufnr)
local picker = state.get_status(prompt_bufnr).picker
local entry = picker:get_selection()
local picker = actions.get_current_picker(prompt_bufnr)
local entry = actions.get_selected_entry(prompt_bufnr)
if not entry then
print("[telescope] Nothing currently selected")

View File

@@ -395,7 +395,11 @@ function Picker:set_selection(row)
-- Handle adding '> ' to beginning of selections
if self._selection_row then
a.nvim_buf_set_lines(results_bufnr, self._selection_row, self._selection_row + 1, false, {' ' .. a.nvim_buf_get_lines(results_bufnr, self._selection_row, self._selection_row + 1, false)[1]:sub(3)})
local old_selection = a.nvim_buf_get_lines(results_bufnr, self._selection_row, self._selection_row + 1, false)[1]
if old_selection then
a.nvim_buf_set_lines(results_bufnr, self._selection_row, self._selection_row + 1, false, {' ' .. old_selection:sub(3)})
end
end
a.nvim_buf_set_lines(results_bufnr, row, row + 1, false, {'> ' .. a.nvim_buf_get_lines(results_bufnr, row, row + 1, false)[1]:sub(3)})