no selection, do nothing and return successfully
This commit is contained in:
parent
d03794600b
commit
5b693caf22
|
@ -53,7 +53,7 @@ public class CmdlineOperationsTextUI extends CmdlineOperations {
|
||||||
ui.setTheme(LanternaThemes.getRegisteredTheme(DEFAULT_THEME));
|
ui.setTheme(LanternaThemes.getRegisteredTheme(DEFAULT_THEME));
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> T onScreen(Supplier<T> dialog) throws Exception {
|
public synchronized <T> T onScreen(Supplier<T> dialog) throws Exception {
|
||||||
try {
|
try {
|
||||||
screen.startScreen();
|
screen.startScreen();
|
||||||
return dialog.get();
|
return dialog.get();
|
||||||
|
@ -72,6 +72,11 @@ public class CmdlineOperationsTextUI extends CmdlineOperations {
|
||||||
// manually confirm each file mapping
|
// manually confirm each file mapping
|
||||||
Map<File, File> selection = onScreen(() -> confirmRenameMap(renameMap, renameAction, conflictAction));
|
Map<File, File> selection = onScreen(() -> confirmRenameMap(renameMap, renameAction, conflictAction));
|
||||||
|
|
||||||
|
// no selection, do nothing and return successfully
|
||||||
|
if (selection.isEmpty()) {
|
||||||
|
return emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
return super.renameAll(selection, renameAction, conflictAction, matches);
|
return super.renameAll(selection, renameAction, conflictAction, matches);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue