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

Fixes StringIndexOutOfBoundsException when cutting text #5776

Merged
merged 6 commits into from
Dec 23, 2019
Merged
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
2 changes: 2 additions & 0 deletions src/main/java/org/jabref/gui/ClipBoardManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ public ClipBoardManager(Clipboard clipboard, java.awt.datatransfer.Clipboard pri
* @see <a href="https://unix.stackexchange.com/questions/139191/whats-the-difference-between-primary-selection-and-clipboard-buffer/139193#139193">Longer text over clipboards</a>
*/
public static void addX11Support(TextInputControl input) {
/*
Copy link
Member

Choose a reason for hiding this comment

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

Please add a link to the jdk bug, so we can check if it's fixed later on.

input.selectedTextProperty().addListener((observable, oldValue, newValue) -> {
if (!newValue.isEmpty() && primary != null) {
primary.setContents(new StringSelection(newValue), null);
}
});
*/
input.setOnMouseClicked(event -> {
if (event.getButton() == MouseButton.MIDDLE) {
input.insertText(input.getCaretPosition(), getContentsPrimary());
Expand Down