Skip to content

Commit

Permalink
Remove small bug that opens the wrong library with multiple entries
Browse files Browse the repository at this point in the history
  • Loading branch information
u7282852 committed Oct 24, 2023
1 parent ec85052 commit 1c14b13
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/org/jabref/gui/JabRefGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,11 @@ private void openDatabases() {
boolean focusDifferent = false;
Optional<BibEntry> focusedEntry = Optional.empty();
for (ParserResult parserResult : parserResults) {
// Make sure this parser result is its own library instead of imported entries
// Make sure this parser result is its own library instead of imported BibTex entries
if (parserResult.getEntryToFocus().isPresent() && !parserResult.toOpenTab()) {
focusDifferent = true;
focusedEntry = parserResult.getEntryToFocus();
break;
}
}

Expand All @@ -222,6 +223,7 @@ private void openDatabases() {
}
if (parserResult.getEntryToFocus().isPresent() && focusDifferent) {
first = true;
focusDifferent = false;
}

if (parserResult.getDatabase().isShared()) {
Expand Down Expand Up @@ -296,6 +298,7 @@ private void openDatabases() {
// focus a particular entry if CLI has received a jump to entry key command
if (focusedEntry.isPresent()) {
mainFrame.getCurrentLibraryTab().clearAndSelect(focusedEntry.get());
mainFrame.showLibraryTab(mainFrame.getCurrentLibraryTab());
}

LOGGER.debug("Finished adding panels");
Expand Down

0 comments on commit 1c14b13

Please sign in to comment.