From 4a43d13c953596503ff37fbc0cc80e68099c5c5c Mon Sep 17 00:00:00 2001 From: Marcus Caisey Date: Sat, 17 Sep 2022 09:14:53 +0100 Subject: [PATCH] fix: don't include current line in lsp references if current_line=false (#2165) --- lua/telescope/builtin/__lsp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/telescope/builtin/__lsp.lua b/lua/telescope/builtin/__lsp.lua index cf3478e..21aa8ed 100644 --- a/lua/telescope/builtin/__lsp.lua +++ b/lua/telescope/builtin/__lsp.lua @@ -25,7 +25,7 @@ lsp.references = function(opts) local locations = {} if result then local results = vim.lsp.util.locations_to_items(result, vim.lsp.get_client_by_id(ctx.client_id).offset_encoding) - if include_current_line then + if not include_current_line then locations = vim.tbl_filter(function(v) -- Remove current line from result return not (v.filename == filepath and v.lnum == lnum)