]> git.lizzy.rs Git - micro.git/commit
Fix multiline remove in lineArray
authorZachary Yedidia <zyedidia@gmail.com>
Wed, 8 Jun 2016 14:21:27 +0000 (10:21 -0400)
committerZachary Yedidia <zyedidia@gmail.com>
Wed, 8 Jun 2016 14:21:27 +0000 (10:21 -0400)
commit3080e32a8faf88af38ccf7d1b7193360cc863cd6
tree1025b8838947bda09bd6fef6d4e1ea652422d4eb
parentbd0fa7b6c21f40ab3fa96e36bcbc4a9e40933ed2
Fix multiline remove in lineArray

I forgot that when you remove lines[n] then lines[n+1] becomes lines[n]
so to remove the range lines[a:b] you need to remove lines[a] for a-b
times. In this case we should delete lines[start.Y + 1] over and over
instead of removing lines[i] because i is contantly increasing.

Fixes #166
cmd/micro/lineArray.go