This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 827
New composer: show format bar on selection #3386
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
so we can return a DocumentOffset from there without breakage
we need this to get both offsets of the selection boundaries getSelectionOffsetAndText offers the extra flexibility, getCaretOffsetAndText keeps the old api for focusNode/focusOffset Also did some renaming here now that it's not just for the caret anymore
we'll need this to start a range for the selection
we'll need this when replacing selection, to preserve newlines, etc ... in the selected range (e.g. we can't just use range.text).
bwindels
force-pushed
the
bwindels/cider-formatbar
branch
from
September 4, 2019 14:37
0ce75c2
to
322775e
Compare
also rename caret away as this isn't used for the caret solely anymore
this follows the documentation of {focus|anchor}{Offset|Node} better and was causing problems for creating ranges from the document selection when doing ctrl+A in firefox as the anchorNode/Offset was expressed as childNodes from the editor root.
if index is not found, it means the last position should be returned if there is any. We still return -1 for empty documents, as index should always point to a valid part if positive.
bwindels
force-pushed
the
bwindels/cider-formatbar
branch
from
September 4, 2019 14:44
322775e
to
af53598
Compare
Removed review request because detecting the selection doesn't work in Chrome for some reason. |
This was referenced Sep 5, 2019
turt2live
approved these changes
Sep 5, 2019
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.
I think this is generally sane - I'm getting a bit concerned about how much math we have just to deal with text though.
Thanks for the review!
You mean the code inside |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
First PR for element-hq/element-web#10734