Improve mouse selection performance

This commit is contained in:
Zachary Yedidia 2019-12-28 12:04:43 -05:00
parent 629f20720a
commit bd0c172667
2 changed files with 3 additions and 6 deletions

View File

@ -88,7 +88,6 @@ func (h *BufPane) MousePress(e *tcell.EventMouse) bool {
h.Cursor.AddWordToSelection()
} else {
h.Cursor.SetSelectionEnd(h.Cursor.Loc)
h.Cursor.CopySelection("primary")
}
}

View File

@ -16,14 +16,12 @@ func GetMemStats() string {
return fmt.Sprintf("Alloc: %s, Sys: %s, GC: %d, PauseTotalNs: %dns", humanize.Bytes(memstats.Alloc), humanize.Bytes(memstats.Sys), memstats.NumGC, memstats.PauseTotalNs)
}
var start time.Time
func Tic(s string) {
func Tic(s string) time.Time {
log.Println("START:", s)
start = time.Now()
return time.Now()
}
func Toc() {
func Toc(start time.Time) {
end := time.Now()
log.Println("END: ElapsedTime in seconds:", end.Sub(start))
}