Fix: cm.findPosH in one line

This commit is contained in:
eight 2017-11-09 06:58:08 +08:00
parent 0c64e6013b
commit 3844b3db73

View File

@ -325,11 +325,7 @@ function createAppliesToLineWidget(cm) {
cm.replaceRange(newText, range.from, range.to, 'appliesTo'); cm.replaceRange(newText, range.from, range.to, 'appliesTo');
input.mark = cm.markText( input.mark = cm.markText(
range.from, range.from,
cm.findPosH( cm.findPosH(range.from, newText.length, 'char'),
range.from,
newText.length,
'char'
),
{clearWhenEmpty: false} {clearWhenEmpty: false}
); );
input.text = newText; input.text = newText;