-
Notifications
You must be signed in to change notification settings - Fork 15
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
Conversation
There was a problem hiding this 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
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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. |
Fixes #98
Fixes #48