Improve performance when pasting large amounts of text into readline by not redrawing on every char

This commit is contained in:
Kovid Goyal
2022-10-09 09:15:17 +05:30
parent c0f17c279e
commit 834385baff
4 changed files with 31 additions and 8 deletions

View File

@@ -31,6 +31,7 @@ func new_loop() *Loop {
l.escape_code_parser.HandleSOS = l.handle_sos
l.escape_code_parser.HandlePM = l.handle_pm
l.escape_code_parser.HandleRune = l.handle_rune
l.escape_code_parser.HandleEndOfBracketedPaste = l.handle_end_of_bracketed_paste
return &l
}
@@ -128,6 +129,12 @@ func (self *Loop) handle_rune(raw rune) error {
return nil
}
func (self *Loop) handle_end_of_bracketed_paste() {
if self.OnText != nil {
self.OnText("", false, false)
}
}
func (self *Loop) on_signal(s unix.Signal) error {
switch s {
case unix.SIGINT: