File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed
Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -450,6 +450,16 @@ table.insert(components.active[3], {
450450-- Search results key {{{
451451table.insert (components .active [3 ], {
452452 provider = " search_results" ,
453+ enabled = function ()
454+ if not vim .v .hlsearch or vim .v .hlsearch ~= 1 then
455+ return false
456+ end
457+ local lines = vim .api .nvim_buf_line_count (0 )
458+ if lines > 50000 then
459+ return false
460+ end
461+ return true
462+ end ,
453463 truncate_hide = true ,
454464 hl = right_ribbon_hl ,
455465 right_sep = {
Original file line number Diff line number Diff line change @@ -306,10 +306,6 @@ function M.filename(_, opts) --{{{
306306end -- }}}
307307
308308function M .search_results () -- {{{
309- local lines = vim .api .nvim_buf_line_count (0 )
310- if lines > 50000 then
311- return " "
312- end
313309 local search_term = vim .fn .getreg (" /" )
314310 if search_term == " " then
315311 return " "
@@ -319,11 +315,7 @@ function M.search_results() --{{{
319315 end
320316
321317 local search_count = vim .fn .searchcount ({ recompute = 1 , maxcount = - 1 })
322- local active = false
323- if vim .v .hlsearch and vim .v .hlsearch == 1 and search_count .total > 0 then
324- active = true
325- end
326- if not active then
318+ if search_count .total == 0 then
327319 return " "
328320 end
329321
You can’t perform that action at this time.
0 commit comments