From 5a7a3147a4553146342aeb5a112c72606367fea5 Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Fri, 9 Oct 2020 17:33:48 -0400 Subject: fix: Use entry maker for marks --- lua/telescope/make_entry.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'lua/telescope/make_entry.lua') diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua index 891d4af..e765904 100644 --- a/lua/telescope/make_entry.lua +++ b/lua/telescope/make_entry.lua @@ -426,4 +426,23 @@ function make_entry.gen_from_apropos(opts) end end +function make_entry.gen_from_marks(_) + return function(line) + local split_value = utils.max_split(line, "%s+", 4) + + local mark_value = split_value[1] + local cursor_position = vim.fn.getpos("'" .. mark_value) + + return { + value = line, + ordinal = line, + display = line, + lnum = cursor_position[2], + col = cursor_position[3], + start = cursor_position[2], + filename = vim.api.nvim_buf_get_name(cursor_position[1]) + } + end +end + return make_entry -- cgit v1.2.3