mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
diff: do not hide focused viewer if there are no more changes in a tree
This commit is contained in:
+12
-8
@@ -143,21 +143,25 @@ public abstract class ChangeViewDiffRequestProcessor extends CacheDiffRequestPro
|
||||
public void refresh() {
|
||||
List<Wrapper> selectedChanges = getSelectedChanges();
|
||||
|
||||
Wrapper selectedChange = myCurrentChange != null ? ContainerUtil.find(selectedChanges, myCurrentChange) : null;
|
||||
if (selectedChange == null &&
|
||||
myCurrentChange != null &&
|
||||
getContext().isWindowFocused() &&
|
||||
getContext().isFocusedInWindow()) {
|
||||
// Do not automatically switch focused viewer
|
||||
if (selectedChanges.size() == 1 && getAllChanges().contains(myCurrentChange)) {
|
||||
selectChange(myCurrentChange); // Restore selection if necessary
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (selectedChanges.isEmpty()) {
|
||||
myCurrentChange = null;
|
||||
updateRequest();
|
||||
return;
|
||||
}
|
||||
|
||||
Wrapper selectedChange = myCurrentChange != null ? ContainerUtil.find(selectedChanges, myCurrentChange) : null;
|
||||
if (selectedChange == null) {
|
||||
if (myCurrentChange != null && getContext().isWindowFocused() && getContext().isFocusedInWindow()) { // Do not automatically switch file if focused
|
||||
if (selectedChanges.size() == 1 && getAllChanges().contains(myCurrentChange)) {
|
||||
selectChange(myCurrentChange); // Restore selection if necessary
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
myCurrentChange = selectedChanges.get(0);
|
||||
updateRequest();
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user