DEV: add useBlockMode option for toolbar button text selection

Allows buttons to switch selection to block mode if needed.
This commit is contained in:
Penar Musaraj 2019-07-02 18:02:40 -04:00
parent c422520b4a
commit 6e3e0685fb

View File

@ -601,7 +601,13 @@ export default Ember.Component.extend({
this.set("value", `${pre}${hval}${example}${tail}${post}`);
this._selectText(pre.length + hlen, example.length);
} else if (opts && !opts.multiline) {
const [hval, hlen] = getHead(head);
let [hval, hlen] = getHead(head);
if (opts.useBlockMode && sel.value.split("\n").length > 1) {
hval += "\n";
hlen += 1;
tail = `\n${tail}`;
}
if (pre.slice(-hlen) === hval && post.slice(0, tail.length) === tail) {
this.set(