mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 00:46:39 +01:00
Prevents WordBackward or WordForward throw null exception. (#2529)
This commit is contained in:
@@ -1058,6 +1058,7 @@ namespace Terminal.Gui {
|
||||
|| (x > 0 && (char)text [x] == ' ')) {
|
||||
|
||||
var newPosBw = GetModel ().WordBackward (x, 0);
|
||||
if (newPosBw == null) return true;
|
||||
sbw = newPosBw.Value.col;
|
||||
}
|
||||
if (sbw != -1) {
|
||||
@@ -1065,6 +1066,7 @@ namespace Terminal.Gui {
|
||||
PositionCursor (x);
|
||||
}
|
||||
var newPosFw = GetModel ().WordForward (x, 0);
|
||||
if (newPosFw == null) return true;
|
||||
ClearAllSelection ();
|
||||
if (newPosFw.Value.col != -1 && sbw != -1) {
|
||||
point = newPosFw.Value.col;
|
||||
|
||||
Reference in New Issue
Block a user