Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Improve IME area reporting and set IME area in
TextArea
#785Improve IME area reporting and set IME area in
TextArea
#785Changes from all commits
cf76ee5
254d1ef
d37e846
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
It's conceivable that you have enough context to call a
Widget
method with aQueryCtx
here.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.
Yes, that probably is possible. Hmm, my main concern with both using
QueryCtx
and removing the repeated calls to set the IME area that you mentioned onTextArea::ime_area
, would be that the results aren't cached. In general, calculating the area can be a somewhat expensive operation – and certainly in the case ofPlainEditor
it is somewhat expensive.I believe the question is then whether
WidgetState
stores the IME area, which is what Masonry currently does, or whether that field should be removed in favor of a query method onWidget
, which moves the responsibility of caching when necessary to the widget. This doesn't solve the issue of the repeatedTextArea::ime_area
calls.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.
Hmm, that's true, and it's probably too messy. Without having a new invalidation method, it doesn't really work.
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.
My understanding is that these rewrite passes are intended to make the state consistent, so Masonry will know the correct IME area once this has been done. Some other signals are emitted to the platform here as well. While I believe it makes sense to add this here, I can certainly be convinced otherwise.
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.
This seems valid to me.
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.
This being repeated so often to me suggests that it should be a method on
Widget
, so that there is only one source of truth needed. That would be a bit of a bigger change to wire up, and I don't have all the specifics.That is, this is a non-blocking conern