mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-02 01:03:29 +01:00
* Fixes #2196. TextView: Setting Text places cursor at beginning, unlike TextField * Change all private members to have the _prefix. * Renamed local member to prevLayoutStyle. * Helper function for SetNeedsDisplay.
This commit is contained in:
@@ -1588,5 +1588,15 @@ Les Miśerables", output);
|
||||
tf.ProcessKey (new KeyEvent (Key.CtrlMask | Key.CursorRight, new KeyModifiers () { Ctrl = true }));
|
||||
Assert.Equal (22, tf.CursorPosition);
|
||||
}
|
||||
|
||||
[Fact, TextFieldTestsAutoInitShutdown]
|
||||
public void Cursor_Position_Initialization ()
|
||||
{
|
||||
Assert.False (_textField.IsInitialized);
|
||||
Assert.Equal (32, _textField.CursorPosition);
|
||||
Assert.Equal (0, _textField.SelectedLength);
|
||||
Assert.Null (_textField.SelectedText);
|
||||
Assert.Equal ("TAB to jump between text fields.", _textField.Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6934,5 +6934,19 @@ This is the second line.
|
||||
newPos = model.WordForward (4, 0);
|
||||
Assert.Null (newPos);
|
||||
}
|
||||
|
||||
[Fact, TextViewTestsAutoInitShutdown]
|
||||
public void Cursor_Position_Multiline_False_Initialization ()
|
||||
{
|
||||
Assert.False (_textView.IsInitialized);
|
||||
Assert.True (_textView.Multiline);
|
||||
_textView.Multiline = false;
|
||||
Assert.Equal (32, _textView.CursorPosition.X);
|
||||
Assert.Equal (0, _textView.CursorPosition.Y);
|
||||
Assert.Equal (0, _textView.SelectedLength);
|
||||
Assert.Equal ("", _textView.SelectedText);
|
||||
Assert.Equal ("TAB to jump between text fields.", _textView.Text);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user