Skip to content

Content Model Fix 144958#1980

Merged
JiuqingSong merged 4 commits intomasterfrom
u/jisong/144958
Jul 28, 2023
Merged

Content Model Fix 144958#1980
JiuqingSong merged 4 commits intomasterfrom
u/jisong/144958

Conversation

@JiuqingSong
Copy link
Collaborator

@JiuqingSong JiuqingSong commented Jul 26, 2023

Bug 144958: Highlighting text should remove selection

Add a callback to function formatSegmentWithContentModel to allow do some additional work after format, so that we can change the selection to be after the last selected segment.

In order to be able to restore selection before applying format, I added a new cachedRangeEx in ContentModelEditorCore to store selection range after model is restored, and if this cached range exists, getSelectionRangeEx will return this range directly. This solves the issue that after restore a content model we got incorrect range issue.

Before:
bgcolor1

After:
bgcolor2

@JiuqingSong JiuqingSong marked this pull request as ready for review July 27, 2023 04:35
@JiuqingSong JiuqingSong merged commit 9e94b66 into master Jul 28, 2023
@JiuqingSong JiuqingSong deleted the u/jisong/144958 branch July 28, 2023 19:27
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.

2 participants