From 486ab5677618ffc6b05b4f071f79349fa4081022 Mon Sep 17 00:00:00 2001 From: Simon Hauser Date: Thu, 3 Dec 2020 08:41:10 +0100 Subject: Feat: Displayer now supports highlights for separator and elements (#304) Separator Example: When creating the displayer ```lua local displayer = entry_display.create { separator = " ", separator_hl = 'Visual', -- New items = { { width = opts.bufnr_width }, { width = 4 }, { remaining = true }, }, } ``` Elements Example: When submitting data ```lua local hl_group = x == y then 'Normal' or 'Visual' return displayer { entry.bufnr, { entry.indicator, hl_group }, display_bufname .. ":" .. entry.lnum, } ``` --- lua/telescope/make_entry.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua/telescope/make_entry.lua') diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua index e1389d4..66cbcd1 100644 --- a/lua/telescope/make_entry.lua +++ b/lua/telescope/make_entry.lua @@ -329,7 +329,7 @@ function make_entry.gen_from_buffer(opts) bufnr = entry.bufnr, filename = bufname, - lnum = entry.info.lnum and entry.info.lnum or 1, + lnum = entry.info.lnum ~= 0 and entry.info.lnum or 1, indicator = indicator, } end -- cgit v1.2.3