浏览代码

When changing the font, reset the selection, fixes a crash during pinching, as we change the font size, hence changing the buffers

Miguel de Icaza 2 年之前
父节点
当前提交
00e614ed29
共有 2 个文件被更改,包括 3 次插入1 次删除
  1. 1 0
      Sources/SwiftTerm/Mac/MacTerminalView.swift
  2. 2 1
      Sources/SwiftTerm/iOS/iOSTerminalView.swift

+ 1 - 0
Sources/SwiftTerm/Mac/MacTerminalView.swift

@@ -120,6 +120,7 @@ open class TerminalView: NSView, NSTextInputClient, NSUserInterfaceValidations {
         set {
             fontSet = FontSet (font: newValue)
             resetFont()
+            selectNone()
         }
     }
     

+ 2 - 1
Sources/SwiftTerm/iOS/iOSTerminalView.swift

@@ -136,7 +136,8 @@ open class TerminalView: UIScrollView, UITextInputTraits, UIKeyInput, UIScrollVi
         }
         set {
             fontSet = FontSet (font: newValue)
-            resetFont();
+            resetFont()
+            selectNone()
             fullBufferUpdate(terminal: terminal)
         }
     }