Skip to content

Commit

Permalink
Fix pasting on mac and linux (#6419)
Browse files Browse the repository at this point in the history
* Revert "Fixed missing paste command (#6313)"

This PR caused the double pasting issue on OSX (see #4699)

This reverts commit 5ed32e1.

* fix OSX	Keybindings copy paste using command key

* Fix pasting on new library duplicates entry

Co-authored-by: Tobias Diez <[email protected]>
Co-authored-by: Siedlerchr <[email protected]>
  • Loading branch information
3 people authored Aug 2, 2020
1 parent 125a0c1 commit 78aed32
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 24 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We fixed an issue where the INSPIRE fetcher was no longer working [#6229](https://github.com/JabRef/jabref/issues/6229)
- We fixed an issue where custom exports with an uppercase file extension could not be selected for "Copy...-> Export to Clipboard" [#6285](https://github.com/JabRef/jabref/issues/6285)
- We fixed the display of icon both in the main table and linked file editor. [#6169](https://github.com/JabRef/jabref/issues/6169)
- We fixed the paste entry command in the menu and toolbar, that did not do anything. [#6293](https://github.com/JabRef/jabref/issues/6293)
- We fixed an issue where the windows installer did not create an entry in the start menu [bug report in the forum](https://discourse.jabref.org/t/error-while-fetching-from-doi/2018/3)
- We fixed an issue where only the field `abstract` and `comment` were declared as multiline fields. Other fields can now be configured in the preferences using "Do not wrap the following fields when saving" [4373](https://github.com/JabRef/jabref/issues/4373)
- We fixed an issue where JabRef switched to discrete graphics under macOS [#5935](https://github.com/JabRef/jabref/issues/5935)
Expand Down
22 changes: 1 addition & 21 deletions src/main/java/org/jabref/gui/edit/EditAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void execute() {
textInput.cut();
break;
case PASTE:
// handled by FX in TextInputControl#paste
textInput.paste();
break;
case DELETE_ENTRY:
// DELETE_ENTRY in text field should do forward delete
Expand All @@ -54,26 +54,6 @@ public void execute() {
default:
throw new IllegalStateException("Only cut/copy/paste supported in TextInputControl but got " + action);
}
} else {
// Not sure what is selected -> copy/paste/cut selected entries

// ToDo: Should be handled by BibDatabaseContext instead of BasePanel
switch (action) {
case COPY:
frame.getCurrentBasePanel().copy();
break;
case CUT:
frame.getCurrentBasePanel().cut();
break;
case PASTE:
frame.getCurrentBasePanel().paste();
break;
case DELETE_ENTRY:
frame.getCurrentBasePanel().delete(false);
break;
default:
throw new IllegalStateException("Only cut/copy/paste supported but got " + action);
}
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/jabref/gui/maintable/MainTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ public MainTable(MainTableDataModel model, JabRefFrame frame,
*/

private void jumpToSearchKey(TableColumn<BibEntryTableViewModel, ?> sortedColumn, KeyEvent keyEvent) {
if (keyEvent.getCharacter() == null || sortedColumn == null) {
if ((keyEvent.getCharacter() == null) || (sortedColumn == null)) {
return;
}

if (System.currentTimeMillis() - lastKeyPressTime < 700) {
if ((System.currentTimeMillis() - lastKeyPressTime) < 700) {
columnSearchTerm += keyEvent.getCharacter().toLowerCase();
} else {
columnSearchTerm = keyEvent.getCharacter().toLowerCase();
Expand Down

0 comments on commit 78aed32

Please sign in to comment.