From 3f4dc159cfcda2188b239638e5c1978651e41a39 Mon Sep 17 00:00:00 2001 From: Mootez Date: Fri, 1 May 2020 18:00:49 +0100 Subject: [PATCH 1/2] Fix issue 6383 --- CHANGELOG.md | 2 +- src/main/java/org/jabref/gui/menus/FileHistoryMenu.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b5a4c44696..93e8425e794 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -99,7 +99,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed an issue when an "Abstract field" was duplicating text, when importing from RIS file (Neurons) [#6065](https://github.com/JabRef/jabref/issues/6065) - We fixed an issue where adding the addition of a new entry was not completely validated [#6370](https://github.com/JabRef/jabref/issues/6370) - We fixed an issue where the blue and red text colors in the Merge entries dialog were not quite visible [#6334](https://github.com/JabRef/jabref/issues/6334) - +- We fixed an issue where underscore character was removed from the file name in the Recent Libraries list in File menu [#6383](https://github.com/JabRef/jabref/issues/6383) ### Removed diff --git a/src/main/java/org/jabref/gui/menus/FileHistoryMenu.java b/src/main/java/org/jabref/gui/menus/FileHistoryMenu.java index 9456c3d53c3..bb126aae345 100644 --- a/src/main/java/org/jabref/gui/menus/FileHistoryMenu.java +++ b/src/main/java/org/jabref/gui/menus/FileHistoryMenu.java @@ -53,6 +53,7 @@ private void setItems() { private void addItem(Path file, int num) { String number = Integer.toString(num); MenuItem item = new MenuItem(number + ". " + file); + item.setMnemonicParsing(false); item.setOnAction(event -> openFile(file)); getItems().add(item); } From 5cdf408dfc38c2c56f6237dccd975bf019366098 Mon Sep 17 00:00:00 2001 From: Mootez Date: Fri, 1 May 2020 18:49:28 +0100 Subject: [PATCH 2/2] Comment why mnemonic parsing is disabled --- src/main/java/org/jabref/gui/menus/FileHistoryMenu.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/jabref/gui/menus/FileHistoryMenu.java b/src/main/java/org/jabref/gui/menus/FileHistoryMenu.java index bb126aae345..f2a6b534407 100644 --- a/src/main/java/org/jabref/gui/menus/FileHistoryMenu.java +++ b/src/main/java/org/jabref/gui/menus/FileHistoryMenu.java @@ -53,6 +53,11 @@ private void setItems() { private void addItem(Path file, int num) { String number = Integer.toString(num); MenuItem item = new MenuItem(number + ". " + file); + // By default mnemonic parsing is set to true for anything that is Labeled, if an underscore character + // is present, it would create a key combination ALT+the succeeding character (at least for Windows OS) + // and the underscore character will be parsed (deleted). + // i.e if the file name was called "bib_test.bib", a key combination "ALT+t" will be created + // so to avoid this, mnemonic parsing should be set to false to print normally the underscore character. item.setMnemonicParsing(false); item.setOnAction(event -> openFile(file)); getItems().add(item);