@@ -113,30 +113,35 @@ end
113
113
114
114
function M :title ()
115
115
self :nl ():nl ()
116
- for _ , mode in ipairs (ViewConfig .get_commands ()) do
117
- if mode .button then
118
- local title = " " .. mode .name :sub (1 , 1 ):upper () .. mode .name :sub (2 ) .. " (" .. mode .key .. " ) "
119
- if mode .name == " home" then
120
- if self .view .state .mode == " home" then
121
- title = " lazy.nvim " .. Config .options .ui .icons .lazy
122
- else
123
- title = " lazy.nvim (H) "
124
- end
116
+ local modes = vim .tbl_filter (function (c )
117
+ return c .button
118
+ end , ViewConfig .get_commands ())
119
+
120
+ for c , mode in ipairs (modes ) do
121
+ local title = " " .. mode .name :sub (1 , 1 ):upper () .. mode .name :sub (2 ) .. " (" .. mode .key .. " ) "
122
+ if mode .name == " home" then
123
+ if self .view .state .mode == " home" then
124
+ title = " lazy.nvim " .. Config .options .ui .icons .lazy
125
+ else
126
+ title = " lazy.nvim (H) "
125
127
end
128
+ end
126
129
127
- if self .view .state .mode == mode .name then
128
- if mode .name == " home" then
129
- self :append (title , " LazyH1" , { wrap = true })
130
- else
131
- self :append (title , " LazyButtonActive" , { wrap = true })
132
- self :highlight ({ [" %(.%)" ] = " LazySpecial" })
133
- end
130
+ if self .view .state .mode == mode .name then
131
+ if mode .name == " home" then
132
+ self :append (title , " LazyH1" , { wrap = true })
134
133
else
135
- self :append (title , " LazyButton " , { wrap = true })
134
+ self :append (title , " LazyButtonActive " , { wrap = true })
136
135
self :highlight ({ [" %(.%)" ] = " LazySpecial" })
137
136
end
138
- self :append (" " )
137
+ else
138
+ self :append (title , " LazyButton" , { wrap = true })
139
+ self :highlight ({ [" %(.%)" ] = " LazySpecial" })
139
140
end
141
+ if c == # modes then
142
+ break
143
+ end
144
+ self :append (" " )
140
145
end
141
146
self :nl ()
142
147
if self .progress .done < self .progress .total then
0 commit comments