@@ -85,7 +85,7 @@ function M.create()
85
85
require (" lazy.manage.process" ).abort ()
86
86
require (" lazy.async" ).abort ()
87
87
return ViewConfig .keys .abort
88
- end , { silent = true , buffer = self .buf , expr = true })
88
+ end , { silent = true , buffer = self .buf , expr = true , desc = " Abort " })
89
89
90
90
vim .keymap .set (" n" , " gx" , " K" , { buffer = self .buf , remap = true })
91
91
@@ -110,7 +110,7 @@ function M.create()
110
110
self .state .plugin = open and selected or nil
111
111
self :update ()
112
112
end
113
- end )
113
+ end , " Details " )
114
114
115
115
self :on_key (ViewConfig .keys .next , function ()
116
116
local cursor = vim .api .nvim_win_get_cursor (self .view .win )
@@ -121,7 +121,7 @@ function M.create()
121
121
return
122
122
end
123
123
end
124
- end )
124
+ end , " Next Plugin " )
125
125
126
126
self :on_key (ViewConfig .keys .prev , function ()
127
127
local cursor = vim .api .nvim_win_get_cursor (self .view .win )
@@ -132,14 +132,14 @@ function M.create()
132
132
return
133
133
end
134
134
end
135
- end )
135
+ end , " Prev Plugin " )
136
136
137
137
self :on_key (ViewConfig .keys .profile_sort , function ()
138
138
if self .state .mode == " profile" then
139
139
self .state .profile .sort_time_taken = not self .state .profile .sort_time_taken
140
140
self :update ()
141
141
end
142
- end )
142
+ end , " Sort Profile " )
143
143
144
144
self :on_key (ViewConfig .keys .profile_filter , function ()
145
145
if self .state .mode == " profile" then
@@ -159,17 +159,18 @@ function M.create()
159
159
end
160
160
end )
161
161
end
162
- end )
162
+ end , " Filter Profile " )
163
163
164
164
for lhs , rhs in pairs (Config .options .ui .custom_keys ) do
165
165
if rhs then
166
166
local handler = type (rhs ) == " table" and rhs [1 ] or rhs
167
+ local desc = type (rhs ) == " table" and rhs .desc or nil
167
168
self :on_key (lhs , function ()
168
169
local plugin = self .render :get_plugin ()
169
170
if plugin then
170
171
handler (plugin )
171
172
end
172
- end )
173
+ end , desc )
173
174
end
174
175
end
175
176
@@ -219,17 +220,17 @@ function M:setup_patterns()
219
220
[" (https?://%S+)" ] = function (url )
220
221
Util .open (url )
221
222
end ,
222
- }, self .hover )
223
+ }, self .hover , " Hover " )
223
224
self :on_pattern (ViewConfig .keys .diff , {
224
225
[commit_pattern ] = function (hash )
225
226
self :diff ({ commit = hash })
226
227
end ,
227
- }, self .diff )
228
+ }, self .diff , " Diff " )
228
229
self :on_pattern (ViewConfig .commands .restore .key_plugin , {
229
230
[commit_pattern ] = function (hash )
230
231
self :restore ({ commit = hash })
231
232
end ,
232
- }, self .restore )
233
+ }, self .restore , " Restore " )
233
234
end
234
235
235
236
--- @param opts ? { commit : string }
294
295
--- @param key string
295
296
--- @param patterns table<string , fun ( str : string ) >
296
297
--- @param fallback ? fun ( self )
297
- function M :on_pattern (key , patterns , fallback )
298
+ --- @param desc ? string
299
+ function M :on_pattern (key , patterns , fallback , desc )
298
300
self :on_key (key , function ()
299
301
local line = vim .api .nvim_get_current_line ()
300
302
local pos = vim .api .nvim_win_get_cursor (0 )
@@ -316,7 +318,7 @@ function M:on_pattern(key, patterns, fallback)
316
318
if fallback then
317
319
fallback (self )
318
320
end
319
- end )
321
+ end , desc )
320
322
end
321
323
322
324
function M :setup_modes ()
0 commit comments