diff options
| author | Simon Hauser <Simon-Hauser@outlook.de> | 2022-07-12 09:46:51 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-12 09:46:51 +0200 |
| commit | 4ab56d215a6b4a8d21984fdb07b95df5391def60 (patch) | |
| tree | 0768db823fef770ba8a52d78937d8c8ffae42d46 /lua/telescope | |
| parent | 361482c599e09e26cb66ba2cf590d15cb8016604 (diff) | |
perf: limit scrolling size (#2059)
Diffstat (limited to 'lua/telescope')
| -rw-r--r-- | lua/telescope/pickers.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lua/telescope/pickers.lua b/lua/telescope/pickers.lua index 251761c..6006cb9 100644 --- a/lua/telescope/pickers.lua +++ b/lua/telescope/pickers.lua @@ -137,6 +137,8 @@ function Picker:new(opts) }, cache_picker = config.resolve_table_opts(opts.cache_picker, vim.deepcopy(config.values.cache_picker)), + + __scrolling_limit = tonumber(vim.F.if_nil(opts.temp__scrolling_limit, 250)), }, self) obj.get_window_options = opts.get_window_options or p_window.get_window_options @@ -411,7 +413,7 @@ function Picker:find() -- want to scroll through more than 10,000 items. -- -- This just lets us stop doing stuff after tons of things. - self.max_results = 1000 + self.max_results = self.__scrolling_limit vim.api.nvim_buf_set_lines(results_bufnr, 0, self.max_results, false, utils.repeated_table(self.max_results, "")) |
