Fix redundant file loading and buffer insertion bugs
- Fix ChunkedBuffer.Insert to always update file length. - Fix UpdateLineIndexAfterEdit to not shift the first line offset. - Remove redundant ReadFileTask dispatch in HandleBrowserTap. - Add end-to-end test for typing at start of buffer.
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"pad/internal/io/pool"
|
||||
"pad/internal/ui"
|
||||
)
|
||||
|
||||
@@ -98,8 +97,8 @@ func HandleBrowserTap(bm *BrowserManager, s *BrowserState, index int) {
|
||||
ui.OpenFile(entry.Path)
|
||||
}
|
||||
// Dispatch ReadFileTask to the worker pool
|
||||
task := pool.NewReadFileTask(entry.Path, bm.fs)
|
||||
fmt.Printf("HandleBrowserTap: Dispatching ReadFileTask for %s\n", entry.Path)
|
||||
bm.workerPool.Dispatch(task)
|
||||
// task := pool.NewReadFileTask(entry.Path, bm.fs)
|
||||
// fmt.Printf("HandleBrowserTap: Dispatching ReadFileTask for %s\n", entry.Path)
|
||||
// bm.workerPool.Dispatch(task)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user