Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abbreviation toggle within the JournalEditorViewModel now ignores curly braces (issue #7773) #7807

Merged
merged 3 commits into from
Jun 17, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We reintroduced missing default keybindings for new entries. [#7346](https://github.com/JabRef/jabref/issues/7346) [#7439](https://github.com/JabRef/jabref/issues/7439)
- Lists of available fields are now sorted alphabetically. [#7716](https://github.com/JabRef/jabref/issues/7716)
- We moved the select/collapse buttons in the unlinked files dialog into a context menu. [#7383](https://github.com/JabRef/jabref/issues/7383)
- We changed the abbreviation toggle within the JournalEditorViewModel.java to ignore curly braces when matching. [#7773](https://github.com/JabRef/jabref/issues/7773)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please try to omit technical documentation in the changelog. The changelog is user-focused and should describe what changes are visible for the end user. Please reword.

Siedlerchr marked this conversation as resolved.
Show resolved Hide resolved

### Fixed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ public void toggleAbbreviation() {
return;
}

if (journalAbbreviationRepository.isKnownName(text.get())) {
Optional<String> nextAbbreviation = journalAbbreviationRepository.getNextAbbreviation(text.get());
// Ignore brackets when matching abbreviations.
final String name = text.get().replaceAll("[{}]", "");

brapana marked this conversation as resolved.
Show resolved Hide resolved
if (journalAbbreviationRepository.isKnownName(name)) {
btut marked this conversation as resolved.
Show resolved Hide resolved
Optional<String> nextAbbreviation = journalAbbreviationRepository.getNextAbbreviation(name);

if (nextAbbreviation.isPresent()) {
text.set(nextAbbreviation.get());
Expand Down