Fix for ich() corrupting display
[fanfix.git] / src / jexer / tterminal / DisplayLine.java
index 75e2dfdd1f9a52e8444dde369cdd920a7b52b386..5b3faf2587d094ee8080b9888571c916c4eb7254 100644 (file)
@@ -161,7 +161,8 @@ public final class DisplayLine {
      */
     public void insert(final int idx, final Cell newCell) {
         System.arraycopy(chars, idx, chars, idx + 1, chars.length - idx - 1);
-        chars[idx] = newCell;
+        chars[idx] = new Cell();
+        chars[idx].setTo(newCell);
     }
 
     /**
@@ -214,7 +215,8 @@ public final class DisplayLine {
      */
     public void delete(final int idx, final Cell newCell) {
         System.arraycopy(chars, idx + 1, chars, idx, chars.length - idx - 1);
-        chars[chars.length - 1] = newCell;
+        chars[chars.length - 1] = new Cell();
+        chars[chars.length - 1].setTo(newCell);
     }
 
 }