|
60 | 60 | eq(cm.getValue(), "one\ntwothree\nfour\n") |
61 | 61 | }, {inputStyle: "contenteditable", value: "one\ntwo\nfoo\nbar\nthree\nfour\n"}) |
62 | 62 |
|
| 63 | + testCM("ambiguous_diff_middle", function(cm) { |
| 64 | + cm.setSelection(Pos(0, 2)) |
| 65 | + findTextNode(cm, "baah").nodeValue = "baaah" |
| 66 | + cm.display.input.updateFromDOM() |
| 67 | + eqCharPos(cm.getCursor(), Pos(0, 3)) |
| 68 | + }, {inputStyle: "contenteditable", value: "baah"}) |
| 69 | + |
| 70 | + testCM("ambiguous_diff_start", function(cm) { |
| 71 | + cm.setSelection(Pos(0, 1)) |
| 72 | + findTextNode(cm, "baah").nodeValue = "baaah" |
| 73 | + cm.display.input.updateFromDOM() |
| 74 | + eqCharPos(cm.getCursor(), Pos(0, 2)) |
| 75 | + }, {inputStyle: "contenteditable", value: "baah"}) |
| 76 | + |
| 77 | + testCM("ambiguous_diff_end", function(cm) { |
| 78 | + cm.setSelection(Pos(0, 3)) |
| 79 | + findTextNode(cm, "baah").nodeValue = "baaah" |
| 80 | + cm.display.input.updateFromDOM() |
| 81 | + eqCharPos(cm.getCursor(), Pos(0, 4)) |
| 82 | + }, {inputStyle: "contenteditable", value: "baah"}) |
| 83 | + |
63 | 84 | testCM("force_redraw", function(cm) { |
64 | 85 | findTextNode(cm, "foo").parentNode.appendChild(document.createElement("hr")).className = "inserted" |
65 | 86 | cm.display.input.updateFromDOM() |
|
0 commit comments