Skip to content

Commit b5037c9

Browse files
author
Stephan Dilly
committed
less commands depending on context
1 parent 4a41bf9 commit b5037c9

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/components/changes.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -192,40 +192,40 @@ impl Component for ChangesComponent {
192192
if self.is_working_dir {
193193
out.push(CommandInfo::new(
194194
strings::commands::stage_all(&self.key_config),
195-
some_selection,
196-
self.focused(),
195+
true,
196+
some_selection && self.focused(),
197197
));
198198
out.push(CommandInfo::new(
199199
strings::commands::stage_item(&self.key_config),
200-
some_selection,
201-
self.focused(),
200+
true,
201+
some_selection && self.focused(),
202202
));
203203
out.push(CommandInfo::new(
204204
strings::commands::reset_item(&self.key_config),
205-
some_selection,
206-
self.focused(),
205+
true,
206+
some_selection && self.focused(),
207207
));
208208
out.push(CommandInfo::new(
209209
strings::commands::ignore_item(&self.key_config),
210-
some_selection,
211-
self.focused(),
210+
true,
211+
some_selection && self.focused(),
212212
));
213213
} else {
214214
out.push(CommandInfo::new(
215215
strings::commands::unstage_item(&self.key_config),
216-
some_selection,
217-
self.focused(),
216+
true,
217+
some_selection && self.focused(),
218218
));
219219
out.push(CommandInfo::new(
220220
strings::commands::unstage_all(&self.key_config),
221-
some_selection,
222-
self.focused(),
221+
true,
222+
some_selection && self.focused(),
223223
));
224224
out.push(
225225
CommandInfo::new(
226226
strings::commands::commit_open(&self.key_config),
227-
!self.is_empty(),
228-
self.focused() || force_all,
227+
true,
228+
(!self.is_empty() && self.focused()) || force_all,
229229
)
230230
.order(-1),
231231
);

0 commit comments

Comments
 (0)