summaryrefslogtreecommitdiff
path: root/lua/telescope/make_entry.lua
diff options
context:
space:
mode:
authorrowario <r0wario@ya.ru>2022-04-18 10:23:07 +0300
committerGitHub <noreply@github.com>2022-04-18 09:23:07 +0200
commit32505ece725755a564f3f4c7366929c630d75e24 (patch)
tree13a9eac47cfc33c34cc3378f57aadd675707b7ea /lua/telescope/make_entry.lua
parent831f76a809d9f09724d9f3825a3660ed714470d9 (diff)
feat: added trim option to make_entry.gen_from_quickfix (#1838)
Diffstat (limited to 'lua/telescope/make_entry.lua')
-rw-r--r--lua/telescope/make_entry.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua
index df2d608..e5a3dc3 100644
--- a/lua/telescope/make_entry.lua
+++ b/lua/telescope/make_entry.lua
@@ -324,6 +324,10 @@ function make_entry.gen_from_quickfix(opts)
local line_info = { table.concat({ entry.lnum, entry.col }, ":"), "TelescopeResultsLineNr" }
+ if opts.trim_text then
+ entry.text = entry.text:gsub("^%s*(.-)%s*$", "%1")
+ end
+
return displayer {
line_info,
entry.text:gsub(".* | ", ""),