Przeglądaj źródła

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 lat temu
rodzic
commit
00e614ed29

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

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

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

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