Optimization to lots of redraws on large files

This commit is contained in:
Zachary Yedidia
2018-01-29 16:47:55 -05:00
parent 015fcf5fec
commit 6d4134a178

View File

@@ -57,11 +57,17 @@ var (
// Channel of jobs running in the background
jobs chan JobFunction
// Event channel
events chan tcell.Event
autosave chan bool
events chan tcell.Event
autosave chan bool
// Channels for the terminal emulator
updateterm chan bool
closeterm chan int
// How many redraws have happened
numRedraw uint
)
// LoadInput determines which files should be loaded into buffers
@@ -232,6 +238,11 @@ func RedrawAll() {
DisplayKeyMenu()
}
screen.Show()
if numRedraw%50 == 0 {
runtime.GC()
}
numRedraw++
}
func LoadAll() {