[3.13] gh-111201: Add append to screen method to avoid recalculation (GH-119274) (#119405)

(cherry picked from commit c886bece3b)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
This commit is contained in:
Miss Islington (bot) 2024-05-22 18:03:04 +02:00 committed by GitHub
parent ac9163637b
commit aefe2e626e
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):