Fix deleteRune()

This commit is contained in:
Roi Martin (@nibble_ds) 2014-01-23 00:46:15 +01:00
parent 79ed19102a
commit f9055c514a
1 changed files with 2 additions and 2 deletions

View File

@ -221,8 +221,8 @@ func (v *View) deleteRune(x, y int) error {
if x < 0 || y < 0 || y >= len(v.lines) || v.lines[y] == nil || x >= len(v.lines[y]) { if x < 0 || y < 0 || y >= len(v.lines) || v.lines[y] == nil || x >= len(v.lines[y]) {
return errors.New("invalid point") return errors.New("invalid point")
} }
v.lines[y][x] = ' ' copy(v.lines[y][x:], v.lines[y][x+1:])
v.lines[y] = append(v.lines[y][:x], v.lines[y][x+1:]...) v.lines[y][len(v.lines[y])-1] = ' '
return nil return nil
} }