From 3844b3db73fc476fe258a24efbfaddbd6b0797e5 Mon Sep 17 00:00:00 2001 From: eight Date: Thu, 9 Nov 2017 06:58:08 +0800 Subject: [PATCH] Fix: cm.findPosH in one line --- edit/applies-to-line-widget.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/edit/applies-to-line-widget.js b/edit/applies-to-line-widget.js index 80a842b7..25c8ceb8 100644 --- a/edit/applies-to-line-widget.js +++ b/edit/applies-to-line-widget.js @@ -325,11 +325,7 @@ function createAppliesToLineWidget(cm) { cm.replaceRange(newText, range.from, range.to, 'appliesTo'); input.mark = cm.markText( range.from, - cm.findPosH( - range.from, - newText.length, - 'char' - ), + cm.findPosH(range.from, newText.length, 'char'), {clearWhenEmpty: false} ); input.text = newText;