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.
|
// add the file to the watcher.
|
||||||
b.parent.registerFile(filePath, b)
|
b.parent.registerFile(filePath, b)
|
||||||
|
|
||||||
lines := strings.Split(string(contents), "\n")
|
b.table = piecetable.MakePieceTable(string(contents))
|
||||||
for _, line := range lines {
|
|
||||||
b.appendLine(line)
|
|
||||||
}
|
|
||||||
|
|
||||||
// because appendLine sets modified to true
|
// because appendLine sets modified to true
|
||||||
// we should reset this to false since weve
|
// we should reset this to false since weve
|
||||||
@ -827,7 +824,7 @@ func (b *Buffer) processActionKey(key int) bool {
|
|||||||
rightPart := left[initialX:]
|
rightPart := left[initialX:]
|
||||||
|
|
||||||
for i := 0; i < len(rightPart); i++ {
|
for i := 0; i < len(rightPart); i++ {
|
||||||
// TODO POP
|
// TODO POP in piecetable?
|
||||||
b.table.Delete(b.curs.y, len(left)-i)
|
b.table.Delete(b.curs.y, len(left)-i)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user