11local has_telescope , telescope = pcall (require , ' telescope' )
22if not has_telescope then
3- error ( ' This plugins requires nvim-telescope/telescope.nvim' )
3+ error ' This plugins requires nvim-telescope/telescope.nvim'
44end
55
66-- stylua: ignore start
7- local actions = require (" telescope.actions" )
87local action_state = require (" telescope.actions.state" )
8+ local actions = require (" telescope.actions" )
9+ local entry_display = require (" telescope.pickers.entry_display" )
910local finders = require (" telescope.finders" )
1011local pickers = require (" telescope.pickers" )
1112local previewers = require (" telescope.previewers" )
12- local entry_display = require (" telescope.pickers.entry_display" )
1313local conf = require (" telescope.config" ).values
1414local ext_conf = require (" telescope._extensions" )
1515-- stylua: ignore end
@@ -73,7 +73,7 @@ local _opts = {
7373M .opts = _opts
7474
7575M .luasnip_fn = function (opts )
76- local opts = vim .tbl_extend (' keep' , opts or {}, M .opts or _opts )
76+ opts = vim .tbl_extend (' keep' , opts or {}, M .opts or _opts )
7777
7878 -- print(("debug: %s: opts.test"):format(debug.getinfo(1).source))
7979 -- print(vim.inspect(opts.test))
@@ -89,7 +89,7 @@ M.luasnip_fn = function(opts)
8989 end
9090 end
9191 else
92- print ( ' LuaSnips is not available' )
92+ print ' LuaSnip is not available'
9393 end
9494
9595 table.sort (objs , function (a , b )
@@ -102,18 +102,18 @@ M.luasnip_fn = function(opts)
102102 end
103103 end )
104104
105- local displayer = entry_display .create ( {
105+ local displayer = entry_display .create {
106106 separator = ' ' ,
107107 items = { { width = 12 }, { width = 24 }, { width = 16 }, { remaining = true } },
108- })
108+ }
109109
110110 local make_display = function (entry )
111- return displayer ( {
111+ return displayer {
112112 entry .value .ft ,
113113 entry .value .context .name ,
114114 { entry .value .context .trigger , ' TelescopeResultsNumber' },
115115 filter_description (entry .value .context .name , entry .value .context .description ),
116- })
116+ }
117117 end
118118
119119 -- stylua: ignore
@@ -122,14 +122,15 @@ M.luasnip_fn = function(opts)
122122 finder = finders .new_table ({
123123 results = objs ,
124124 entry_maker = function (entry )
125- search_fn = ext_conf ._config .luasnip
125+ local search_fn = ext_conf ._config .luasnip
126126 and ext_conf ._config .luasnip .search
127127 or default_search_text
128128 return {
129129 value = entry ,
130130 filename = entry .context .trigger ,
131131 display = make_display ,
132- text = string.format (" %s | %s | %s" , entry .ft , entry .context .name , entry .context .description [1 ] or ' ' ),
132+ text = string.format (" %s | %s | %s" , entry .ft , entry .context .name ,
133+ entry .context .description [1 ] or ' ' ),
133134 ordinal = search_fn (entry ),
134135 preview_command = function (_ , bufnr )
135136 local snippet = get_docstring (luasnip , entry .ft , entry .context )
0 commit comments