mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
* Fixes #3144. TextView Autocomplete does not insert capital letters * Fixes #3144. Fix unit test for fix of TextView Autocomplete does not insert capital letters
This commit is contained in:
@@ -3026,14 +3026,14 @@ public class TextView : View {
|
||||
public void InsertText (string toAdd)
|
||||
{
|
||||
foreach (char ch in toAdd) {
|
||||
KeyCode key;
|
||||
Key key;
|
||||
try {
|
||||
key = (KeyCode)ch;
|
||||
key = new Key(ch);
|
||||
} catch (Exception) {
|
||||
throw new ArgumentException ($"Cannot insert character '{ch}' because it does not map to a Key");
|
||||
}
|
||||
|
||||
InsertText (new Key (key));
|
||||
InsertText (key);
|
||||
|
||||
if (NeedsDisplay) {
|
||||
Adjust ();
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace Terminal.Gui.TextTests {
|
||||
Assert.Equal (3, g.AllSuggestions.Count);
|
||||
Assert.True (tv.NewKeyDownEvent (new (tv.Autocomplete.SelectionKey)));
|
||||
tv.PositionCursor ();
|
||||
Assert.Equal ($"fortunately Fortunately super feature.", tv.Text);
|
||||
Assert.Equal ($"Fortunately Fortunately super feature.", tv.Text);
|
||||
Assert.Equal (new Point (11, 0), tv.CursorPosition);
|
||||
Assert.Empty (tv.Autocomplete.Suggestions);
|
||||
Assert.Equal (3, g.AllSuggestions.Count);
|
||||
|
||||
Reference in New Issue
Block a user