Skip to content

Commit 739cd13

Browse files
committed
Add a test for marker.changed scrollbar updating
1 parent 1abab8c commit 739cd13

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,17 @@ testCM("wrappingInlineWidget", function(cm) {
841841
eq(curR.bottom, cur1.bottom);
842842
}, {value: "1 2 3 xxx 4", lineWrapping: true});
843843

844+
testCM("changedInlineWidget", function(cm) {
845+
cm.setSize("10em");
846+
var w = document.createElement("span");
847+
w.innerHTML = "x";
848+
var m = cm.markText(Pos(0, 4), Pos(0, 5), {replacedWith: w});
849+
w.innerHTML = "and now the widget is really really long all of a sudden and a scrollbar is needed";
850+
m.changed();
851+
var hScroll = byClassName(cm.getWrapperElement(), "CodeMirror-hscrollbar")[0];
852+
is(hScroll.scrollWidth > hScroll.clientWidth);
853+
}, {value: "hello there"});
854+
844855
testCM("inlineWidget", function(cm) {
845856
var w = cm.setBookmark(Pos(0, 2), {widget: document.createTextNode("uu")});
846857
cm.setCursor(0, 2);

0 commit comments

Comments
 (0)