Update copyright to 2017
[nikiroo-utils.git] / src / jexer / tterminal / DisplayLine.java
index 75e2dfdd1f9a52e8444dde369cdd920a7b52b386..15739486de2b6bf386d4641638d69a3e1c94c744 100644 (file)
@@ -3,7 +3,7 @@
  *
  * The MIT License (MIT)
  *
- * Copyright (C) 2016 Kevin Lamonte
+ * Copyright (C) 2017 Kevin Lamonte
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -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);
     }
 
 }