Skip to content

Commit

Permalink
Fix underscore character being omitted from file name in Recent Libra…
Browse files Browse the repository at this point in the history
…ries list (#6389)

* Fix issue 6383

* Comment why mnemonic parsing is disabled
  • Loading branch information
MootezSaaD committed May 1, 2020
1 parent a123eb1 commit 39ebbc4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions src/main/java/org/jabref/gui/menus/FileHistoryMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ 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);
}
Expand Down

0 comments on commit 39ebbc4

Please sign in to comment.