File tree Expand file tree Collapse file tree 3 files changed +33
-1
lines changed
Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ M.keys = {
3434 profile_sort = " <C-s>" ,
3535 profile_filter = " <C-f>" ,
3636 abort = " <C-c>" ,
37+ next = " ]]" ,
38+ prev = " [[" ,
3739}
3840
3941--- @type table<string,LazyViewCommand>
Original file line number Diff line number Diff line change @@ -111,6 +111,28 @@ function M.create()
111111 end
112112 end )
113113
114+ self :on_key (ViewConfig .keys .next , function ()
115+ local cursor = vim .api .nvim_win_get_cursor (self .view .win )
116+ for l = 1 , # self .render .locations , 1 do
117+ local loc = self .render .locations [l ]
118+ if loc .from > cursor [1 ] then
119+ vim .api .nvim_win_set_cursor (self .view .win , { loc .from , 8 })
120+ return
121+ end
122+ end
123+ end )
124+
125+ self :on_key (ViewConfig .keys .prev , function ()
126+ local cursor = vim .api .nvim_win_get_cursor (self .view .win )
127+ for l = # self .render .locations , 1 , - 1 do
128+ local loc = self .render .locations [l ]
129+ if loc .from < cursor [1 ] then
130+ vim .api .nvim_win_set_cursor (self .view .win , { loc .from , 8 })
131+ return
132+ end
133+ end
134+ end )
135+
114136 self :on_key (ViewConfig .keys .profile_sort , function ()
115137 if self .state .mode == " profile" then
116138 self .state .profile .sort_time_taken = not self .state .profile .sort_time_taken
Original file line number Diff line number Diff line change @@ -201,7 +201,15 @@ function M:help()
201201 :nl ()
202202 self :append (" or the plugin was just updated. Otherwise the plugin webpage will open." ):nl ():nl ()
203203
204- self :append (" Use " ):append (" <d>" , " LazySpecial" ):append (" on a commit or plugin to open the diff view" ):nl ()
204+ self :append (" Use " ):append (" <d>" , " LazySpecial" ):append (" on a commit or plugin to open the diff view" ):nl ():nl ()
205+ self
206+ :append (" Use " )
207+ :append (" <]]>" , " LazySpecial" )
208+ :append (" and " )
209+ :append (" <[[>" , " LazySpecial" )
210+ :append (" to navigate between plugins" )
211+ :nl ()
212+ :nl ()
205213 self :nl ()
206214
207215 self :append (" Keyboard Shortcuts" , " LazyH2" ):nl ()
You can’t perform that action at this time.
0 commit comments