FBI-1684: [MANTIS - 22275] Scroll in trigger editor jumps several lines up when

scrolling with the mouse scroll wheel

resolve observations
This commit is contained in:
alex_santos
2017-04-24 09:37:28 -04:00
parent 3bf28da76d
commit 1bce18fbe9
508 changed files with 63003 additions and 17118 deletions

View File

@@ -163,13 +163,13 @@
testDoc("undoKeepRanges", "A='abcdefg' B<A", function(a, b) {
var m = a.markText(Pos(0, 1), Pos(0, 3), {className: "foo"});
b.replaceRange("x", Pos(0, 0));
eqPos(m.find().from, Pos(0, 2));
eqCharPos(m.find().from, Pos(0, 2));
b.replaceRange("yzzy", Pos(0, 1), Pos(0));
eq(m.find(), null);
b.undo();
eqPos(m.find().from, Pos(0, 2));
eqCharPos(m.find().from, Pos(0, 2));
b.undo();
eqPos(m.find().from, Pos(0, 1));
eqCharPos(m.find().from, Pos(0, 1));
});
testDoc("longChain", "A='uv' B<A C<B D<C", function(a, b, c, d) {
@@ -271,12 +271,12 @@
eq(b.getValue(), "2\n3");
eq(b.firstLine(), 1);
b.setCursor(Pos(4));
eqPos(b.getCursor(), Pos(2, 1));
eqCharPos(b.getCursor(), Pos(2, 1));
a.replaceRange("-1\n0\n", Pos(0, 0));
eq(b.firstLine(), 3);
eqPos(b.getCursor(), Pos(4, 1));
eqCharPos(b.getCursor(), Pos(4, 1));
a.undo();
eqPos(b.getCursor(), Pos(2, 1));
eqCharPos(b.getCursor(), Pos(2, 1));
b.replaceRange("oyoy\n", Pos(2, 0));
eq(a.getValue(), "1\n2\noyoy\n3\n4\n5");
b.undo();
@@ -305,11 +305,11 @@
eq(found.length, 1);
eq(found[0], mark);
eq(c.findMarksAt(Pos(1, 1)).length, 1);
eqPos(mark.find().from, Pos(0, 1));
eqPos(mark.find().to, Pos(3, 1));
eqCharPos(mark.find().from, Pos(0, 1));
eqCharPos(mark.find().to, Pos(3, 1));
b.replaceRange("x\ny\n", Pos(0, 0));
eqPos(mark.find().from, Pos(2, 1));
eqPos(mark.find().to, Pos(5, 1));
eqCharPos(mark.find().from, Pos(2, 1));
eqCharPos(mark.find().to, Pos(5, 1));
var cleared = 0;
CodeMirror.on(mark, "clear", function() {++cleared;});
b.operation(function(){mark.clear();});
@@ -320,6 +320,48 @@
eq(cleared, 1);
});
testDoc("sharedMarkerCopy", "A='abcde'", function(a) {
var shared = a.markText(Pos(0, 1), Pos(0, 3), {shared: true});
var b = a.linkedDoc();
var found = b.findMarksAt(Pos(0, 2));
eq(found.length, 1);
eq(found[0], shared);
shared.clear();
eq(b.findMarksAt(Pos(0, 2)), 0);
});
testDoc("sharedMarkerDetach", "A='abcde' B<A C<B", function(a, b, c) {
var shared = a.markText(Pos(0, 1), Pos(0, 3), {shared: true});
a.unlinkDoc(b);
var inB = b.findMarksAt(Pos(0, 2));
eq(inB.length, 1);
is(inB[0] != shared);
var inC = c.findMarksAt(Pos(0, 2));
eq(inC.length, 1);
is(inC[0] != shared);
inC[0].clear();
is(shared.find());
});
testDoc("sharedBookmark", "A='ab\ncd\nef\ngh' B<A C<~A/1-2", function(a, b, c) {
var mark = b.setBookmark(Pos(1, 1), {shared: true});
var found = a.findMarksAt(Pos(1, 1));
eq(found.length, 1);
eq(found[0], mark);
eq(c.findMarksAt(Pos(1, 1)).length, 1);
eqCharPos(mark.find(), Pos(1, 1));
b.replaceRange("x\ny\n", Pos(0, 0));
eqCharPos(mark.find(), Pos(3, 1));
var cleared = 0;
CodeMirror.on(mark, "clear", function() {++cleared;});
b.operation(function() {mark.clear();});
eq(a.findMarks(Pos(0, 0), Pos(5)).length, 0);
eq(b.findMarks(Pos(0, 0), Pos(5)).length, 0);
eq(c.findMarks(Pos(0, 0), Pos(5)).length, 0);
eq(mark.find(), null);
eq(cleared, 1);
});
testDoc("undoInSubview", "A='line 0\nline 1\nline 2\nline 3\nline 4' B<A/1-4", function(a, b) {
b.replaceRange("x", Pos(2, 0));
a.undo();