瀏覽代碼

TextView now works properly

Tig 1 年之前
父節點
當前提交
15fa1abab1
共有 2 個文件被更改,包括 77 次插入419 次删除
  1. 3 1
      Terminal.Gui/Views/TextView.cs
  2. 74 418
      UnitTests/Views/TextViewTests.cs

+ 3 - 1
Terminal.Gui/Views/TextView.cs

@@ -6069,7 +6069,9 @@ public class TextView : View
 
         if (!AllowsReturn || _isReadOnly)
         {
-            return OnAccept ();
+            // By Default pressing ENTER should be ignored (OnAccept will return false or null). Only cancel if the
+            // event was fired and set Cancel = true.
+            return OnAccept () == false;
         }
 
         SetWrapModel ();

File diff suppressed because it is too large
+ 74 - 418
UnitTests/Views/TextViewTests.cs


Some files were not shown because too many files changed in this diff