mirror of
https://github.com/flarum/framework.git
synced 2025-03-10 04:05:30 +08:00

In dd8323ee3610231f6da990823133c44d032c94b8, insertText was modified from the original to work with reply mentioning. This was done due to a misunderstanding of the API: the selection range isn't the selection to replace, but rather the final selection state after replacing the *current* selection with the text. This commit restores the original, correct implementation of insertText and instead adjusts the `insertBetween`method of BasicEditorDriver to set selection state before executing `insertText`. Fixes https://github.com/flarum/core/issues/2877