mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Fixing bug in TextView, clicking line below text causes IndexOutOfRangeException
This commit is contained in:
@@ -1091,8 +1091,10 @@ namespace Terminal.Gui {
|
||||
if (!HasFocus)
|
||||
SuperView.SetFocus (this);
|
||||
|
||||
if (ev.Y + topRow >= model.Count) {
|
||||
currentRow = model.Count - topRow;
|
||||
|
||||
var maxCursorPositionableLine = (model.Count - 1) - topRow;
|
||||
if (ev.Y > maxCursorPositionableLine) {
|
||||
currentRow = maxCursorPositionableLine;
|
||||
} else {
|
||||
currentRow = ev.Y + topRow;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user