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

Add pasteDocument action and test #322

Merged
merged 10 commits into from
May 27, 2024
Merged

Conversation

jperedadnr
Copy link
Collaborator

Fixes #98
Fixes #48

@jperedadnr jperedadnr changed the title [WIP] Add pasteDocument action and test Add pasteDocument action and test May 15, 2024
Copy link
Collaborator

@abhinayagarwal abhinayagarwal left a comment

Choose a reason for hiding this comment

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

There is another strange behaviour, where additional lines are created while pasting:

Screen.Recording.2024-05-23.at.11.48.59.AM.mov

Comment on lines 745 to +748
int caret = getTextBuffer().getText(0, getCaretPosition()).length();
return new Document(getTextBuffer().getText(), getTextBuffer().getDecorationModelList(), caret);
int start = selection.isDefined() ? selection.getStart() : 0;
int end = selection.isDefined() ? selection.getEnd() : getTextLength();
return new Document(getTextBuffer().getText(start, end), getTextBuffer().getDecorationModelList(start, end), caret);
Copy link
Collaborator

Choose a reason for hiding this comment

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

There are 3 calls to getTextBuffer() in this method. Wondering if we should instead create a variable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not needed. In this class getTextBuffer() it is used 30+ times, without extracting variables. After all, it is just a getter from a property, with a null check.

@jperedadnr
Copy link
Collaborator Author

I've seen that too, before this PR (as there is no decoration involved in your test). When pasting several lines somehow the width of the cell in-between two lines is changed, and defaults to 13 points or so.
In any case, that should be part of a different issue, I guess.

@jperedadnr jperedadnr merged commit 40ca01a into gluonhq:main May 27, 2024
3 checks passed
@jperedadnr jperedadnr deleted the 98-pastedocument branch May 27, 2024 07:54
@tonydroy tonydroy mentioned this pull request Jun 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for clipboard copy/paste of faceModel Paste should respect decoration
2 participants