You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- If entry is further away than limit, the entry will not be selected. This is to prevent recentering of cursor caused by setpos. There is no way to select an entry without jumping, so the cursor position is saved and restored instead.
97
97
require('qf').follow(list, strategy)
98
98
99
-
-- Wrapping version of [lc]next
100
-
require('qf').next(list)
99
+
-- Wrapping version of [lc]next. Also takes into account valid entries.
100
+
-- If wrap is nil or true, it will wrap around the list
101
+
require('qf').next(list, wrap=true)
101
102
102
-
-- Wrapping version of [lc]prev
103
-
require('qf').prev(list)
103
+
-- Wrapping version of [lc]prev. Also takes into account valid entries.
104
+
-- If wrap is nil or true, it will wrap around the list
105
+
require('qf').prev(list, wrap=true)
104
106
105
107
-- Wrapping version of [lc]above
106
108
-- Will switch buffer
107
-
require('qf').above(list)
109
+
-- If wrap is nil or true, it will wrap around the list
110
+
require('qf').above(list, wrap=true)
108
111
109
112
-- Wrapping version of [lc]below
110
113
-- Will switch buffer
111
-
require('qf').below(list)
114
+
-- If wrap is nil or true, it will wrap around the list
@@ -268,7 +278,7 @@ function M.resize(list, stay, num_items)
268
278
cmd(list.."open " ..height )
269
279
270
280
ifstaythen
271
-
cmd"wincmd p"
281
+
cmd"noau wincmd p"
272
282
end
273
283
end
274
284
@@ -297,7 +307,7 @@ function M.open(list, stay, verbose)
297
307
cmd(list..'open ' ..get_height(list, num_items))
298
308
299
309
ifstaythen
300
-
cmd"wincmd p"
310
+
cmd"noau wincmd p"
301
311
end
302
312
303
313
ifopts.close_otherthen
@@ -423,6 +433,10 @@ local strategy_lookup = {
423
433
-- (optional) limit, don't select entry further away than limit.
424
434
-- If entry is further away than limit, the entry will not be selected. This is to prevent recentering of cursor caused by setpos. There is no way to select an entry without jumping, so the cursor position is saved and restored instead.
425
435
functionM.follow(list, strategy, limit)
436
+
ifapi.nvim_get_mode().mode~='n' then
437
+
return
438
+
end
439
+
426
440
list=fix_list(list)
427
441
localopts=M.config[list]
428
442
@@ -476,33 +490,41 @@ function M.follow(list, strategy, limit)
476
490
fn.setpos('.', pos)
477
491
end
478
492
479
-
-- Wrapping version of [lc]next
480
-
functionM.next(list, verbose)
493
+
-- Wrapping version of [lc]next. Also takes into account valid entries.
494
+
-- If wrap is nil or true, it will wrap around the list
495
+
functionM.next(list, verbose, wrap)
496
+
ifwrap==nilthen
497
+
wrap=true
498
+
end
481
499
list=fix_list(list)
482
500
483
501
ifnotcheck_empty(list, #list_items(list), verbose) then
0 commit comments