perf: limit scrolling size (#2059)

This commit is contained in:
Simon Hauser
2022-07-12 09:46:51 +02:00
committed by GitHub
parent 361482c599
commit 4ab56d215a

View File

@@ -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, ""))