summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/telescope/actions/init.lua4
-rw-r--r--lua/telescope/pickers.lua3
2 files changed, 7 insertions, 0 deletions
diff --git a/lua/telescope/actions/init.lua b/lua/telescope/actions/init.lua
index fdd400c..6ffb3ef 100644
--- a/lua/telescope/actions/init.lua
+++ b/lua/telescope/actions/init.lua
@@ -43,6 +43,10 @@ function actions.get_selected_entry()
return state.get_global_key('selected_entry')
end
+function actions.get_current_line()
+ return state.get_global_key('current_line')
+end
+
function actions.preview_scrolling_up(prompt_bufnr)
actions.get_current_picker(prompt_bufnr).previewer:scroll_fn(-30)
end
diff --git a/lua/telescope/pickers.lua b/lua/telescope/pickers.lua
index 96af5b6..67553c2 100644
--- a/lua/telescope/pickers.lua
+++ b/lua/telescope/pickers.lua
@@ -524,6 +524,9 @@ function Picker:find()
error('Unknown selection strategy: ' .. selection_strategy)
end
+ local current_line = vim.api.nvim_get_current_line():sub(self.prompt_prefix:len() + 1)
+ state.set_global_key('current_line', current_line)
+
self:clear_extra_rows(results_bufnr)
self:highlight_displayed_rows(results_bufnr, prompt)