File tree 2 files changed +20
-1
lines changed
2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,17 @@ function M.create()
96
96
name = plugin .name ,
97
97
kind = plugin ._ .kind ,
98
98
}
99
- self .state .plugin = not vim .deep_equal (self .state .plugin , selected ) and selected or nil
99
+
100
+ local open = not vim .deep_equal (self .state .plugin , selected )
101
+
102
+ if not open then
103
+ local row = self .render :get_row (selected )
104
+ if row then
105
+ vim .api .nvim_win_set_cursor (self .view .win , { row , 8 })
106
+ end
107
+ end
108
+
109
+ self .state .plugin = open and selected or nil
100
110
self :update ()
101
111
end
102
112
end )
Original file line number Diff line number Diff line change @@ -122,6 +122,15 @@ function M:get_plugin(row)
122
122
end
123
123
end
124
124
125
+ --- @param selected { name : string , kind ?: LazyPluginKind }
126
+ function M :get_row (selected )
127
+ for _ , loc in ipairs (self .locations ) do
128
+ if loc .kind == selected .kind and loc .name == selected .name then
129
+ return loc .from
130
+ end
131
+ end
132
+ end
133
+
125
134
function M :title ()
126
135
self :nl ()
127
136
local modes = vim .tbl_filter (function (c )
You can’t perform that action at this time.
0 commit comments