Fixes #1866. Bug when scrolling text and type in a TextView. (#1868)

This commit is contained in:
BDisp
2022-07-21 13:55:51 +01:00
committed by GitHub
parent 40b661d531
commit 57fc939e22
2 changed files with 21 additions and 1 deletions

View File

@@ -5707,5 +5707,25 @@ line.
});
Assert.Null (exception);
}
[Fact]
[AutoInitShutdown]
public void ScrollDownTillCaretOffscreen_ThenType ()
{
var tv = new TextView {
Width = 10,
Height = 5
};
// add 100 lines of wide text to view
for (int i = 0; i < 100; i++)
tv.Text += new string ('x', 100) + Environment.NewLine;
Assert.Equal (0, tv.CursorPosition.Y);
tv.ScrollTo (50);
Assert.Equal (0, tv.CursorPosition.Y);
tv.ProcessKey (new KeyEvent (Key.p, new KeyModifiers ()));
}
}
}