From 1c14b13c4c372b166db78c46efb74f5dc6987a09 Mon Sep 17 00:00:00 2001 From: Dane Osborne Date: Tue, 24 Oct 2023 18:51:52 +1100 Subject: [PATCH] Remove small bug that opens the wrong library with multiple entries --- src/main/java/org/jabref/gui/JabRefGUI.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/gui/JabRefGUI.java b/src/main/java/org/jabref/gui/JabRefGUI.java index 6359f1d01e9..7045df74dae 100644 --- a/src/main/java/org/jabref/gui/JabRefGUI.java +++ b/src/main/java/org/jabref/gui/JabRefGUI.java @@ -206,10 +206,11 @@ private void openDatabases() { boolean focusDifferent = false; Optional 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; } } @@ -222,6 +223,7 @@ private void openDatabases() { } if (parserResult.getEntryToFocus().isPresent() && focusDifferent) { first = true; + focusDifferent = false; } if (parserResult.getDatabase().isShared()) { @@ -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");