mirror of
https://github.com/felixangell/phi.git
synced 2024-09-11 07:45:30 +03:00
fix buffer open file
This commit is contained in:
parent
900f5e8920
commit
c20d7a61d3
@ -250,10 +250,7 @@ func (b *Buffer) OpenFile(filePath string) {
|
||||
// add the file to the watcher.
|
||||
b.parent.registerFile(filePath, b)
|
||||
|
||||
lines := strings.Split(string(contents), "\n")
|
||||
for _, line := range lines {
|
||||
b.appendLine(line)
|
||||
}
|
||||
b.table = piecetable.MakePieceTable(string(contents))
|
||||
|
||||
// because appendLine sets modified to true
|
||||
// we should reset this to false since weve
|
||||
@ -827,7 +824,7 @@ func (b *Buffer) processActionKey(key int) bool {
|
||||
rightPart := left[initialX:]
|
||||
|
||||
for i := 0; i < len(rightPart); i++ {
|
||||
// TODO POP
|
||||
// TODO POP in piecetable?
|
||||
b.table.Delete(b.curs.y, len(left)-i)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user