-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
Is your suggestion for improvement related to a problem? Please describe.
When I was working on #12810, I noticed that it isn't possible to manually enter a keyword containing an escaped delimiter; it works only if I paste the whole keyword.
For example, when I try to create the single keyword "keyword1, keyword2", as soon as I type "keyword1\,", a new keyword "keyword1\" is created. If I continue typing "keyword2", I end up with two separate keywords: "keyword1\" and "keyword2". However, if I paste the string "keyword1\, keyword2", it behaves as expected and creates a single keyword.
This happens due to logic in org/jabref/gui/fieldeditors/KeywordsEditor;
jabref/jabgui/src/main/java/org/jabref/gui/fieldeditors/KeywordsEditor.java
Lines 124 to 130 in 97d548a
| String keywordSeparator = String.valueOf(viewModel.getKeywordSeparator()); | |
| keywordTagsField.getEditor().setOnKeyReleased(event -> { | |
| if (event.getText().equals(keywordSeparator)) { | |
| keywordTagsField.commit(); | |
| event.consume(); | |
| } | |
| }); |
I believe this is confusing for the user and defeats the purpose of the reworked keyword parsing logic.
Describe the solution you'd like
I have two ideas on how to resolve this issue:
- Remove the auto-commit logic from KeywordsEditor altogether, so the user must press Enter to create a new keyword.
- Enhance the logic in KeywordsEditor to check if the separator was escaped before committing the keyword.