浏览代码

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 ();

文件差异内容过多而无法显示
+ 74 - 418
UnitTests/Views/TextViewTests.cs


部分文件因为文件数量过多而无法显示