gh-111201: Add append to screen method to avoid recalculation (#119274)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
Lysandros Nikolaou 2024-05-21 22:35:44 -04:00 committed by GitHub
parent d065edfb66
commit c886bece3b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 43 additions and 14 deletions

View file

@ -358,7 +358,10 @@ class backward_word(MotionCommand):
class self_insert(EditCommand):
def do(self) -> None:
r = self.reader
r.insert(self.event * r.get_arg())
text = self.event * r.get_arg()
r.insert(text)
if len(text) == 1 and r.pos == len(r.buffer):
r.calc_screen = r.append_to_screen
class insert_nl(EditCommand):