summaryrefslogtreecommitdiff
path: root/lua/telescope/mappings.lua
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2020-08-27 22:12:44 -0400
committerTJ DeVries <devries.timothyj@gmail.com>2020-08-27 22:12:47 -0400
commit7e9f38a87e1dfc5226665e9602e39a900519c732 (patch)
treee58f8250f1d4802bcc21733edad21d690ccd38b0 /lua/telescope/mappings.lua
parentc4dd59ff65b85360dacb03f6a97d96627b4c1cb1 (diff)
feat: Add livegrep and lsp referecnes
Diffstat (limited to 'lua/telescope/mappings.lua')
-rw-r--r--lua/telescope/mappings.lua15
1 files changed, 9 insertions, 6 deletions
diff --git a/lua/telescope/mappings.lua b/lua/telescope/mappings.lua
index a3704a6..1e79900 100644
--- a/lua/telescope/mappings.lua
+++ b/lua/telescope/mappings.lua
@@ -52,18 +52,19 @@ keymap["control-p"] = function(prompt_bufnr, _)
end
keymap["enter"] = function(prompt_bufnr, results_bufnr)
- local row = state.get_status(prompt_bufnr).picker:get_selection()
- if row == nil then
- print("Could not do anything...")
+ local entry = state.get_status(prompt_bufnr).picker:get_selection()
+
+ if not entry then
+ print("[telescope] Nothing currently selected")
return
else
- local line = a.nvim_buf_get_lines(results_bufnr, row, row + 1, false)[1]
- if line == nil then
+ local value = entry.value
+ if not value then
print("Could not do anything with blank line...")
return
end
- local sections = vim.split(line, ":")
+ local sections = vim.split(value, ":")
local filename = sections[1]
local row = tonumber(sections[2])
@@ -77,6 +78,8 @@ keymap["enter"] = function(prompt_bufnr, results_bufnr)
if row and col then
a.nvim_win_set_cursor(0, {row, col})
end
+
+ vim.cmd [[stopinsert]]
end
end