small changes
1 files changed, 9 insertions(+), 4 deletions(-)

M cellbuffer.go
M cellbuffer.go +9 -4
@@ 52,6 52,9 @@ func (cb *CellBuffer) SetContent(x int, 
 		// todo: error?
 		return
 	}
+	// todo: does this work?
+	// usually you have to walk downwards a slice
+	// for in-slice removal in a loop
 	for i := 0; i < len(combc); i++ {
 		r := combc[i]
 		if runewidth.RuneWidth(r) != 0 {

          
@@ 100,7 103,7 @@ func (cb *CellBuffer) Invalidate() {
 	}
 }
 
-// always guard a call ti cell with cb.isOutside
+// always guard a call to CellBuffer.cell with cb.isOutside
 func (cb *CellBuffer) cell(x, y int) *cell {
 	return &cb.cells[y*cb.w+x]
 }

          
@@ 158,6 161,9 @@ func (cb *CellBuffer) SetDirty(x, y int,
 // Resize is used to resize the cells array, with different dimensions,
 // while preserving the original contents.  The cells will be invalidated
 // so that they can be redrawn.
+//
+// todo: this method has to be called when initializing an CellBuffer
+// the empy CellBuffer is actually useless
 func (cb *CellBuffer) Resize(w, h int) {
 
 	if cb.h == h && cb.w == w {

          
@@ 167,6 173,7 @@ func (cb *CellBuffer) Resize(w, h int) {
 	for y := 0; y < h && y < cb.h; y++ {
 		for x := 0; x < w && x < cb.w; x++ {
 			oc := cb.cell(x, y)
+			// todo: DRY problem, this formular lives in CellBuffer.cell
 			nc := &newc[(y*w)+x]
 			nc.currMain = oc.currMain
 			nc.currComb = oc.currComb

          
@@ 175,9 182,7 @@ func (cb *CellBuffer) Resize(w, h int) {
 			nc.lastMain = rune(0)
 		}
 	}
-	cb.cells = newc
-	cb.h = h
-	cb.w = w
+	cb.cells, cb.h, cb.w = newc, h, w
 }
 
 // Fill fills the entire cell buffer array with the specified character