diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-05-22 16:03:04 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-22 16:03:04 (GMT) |
| commit | aefe2e626eeb2f05cda10a17926f8ba9b7a504ca (patch) | |
| tree | d49408a37d65ab1ee30e2ba7887adc1a6b697a6d /Lib/_pyrepl/commands.py | |
| parent | ac9163637b028fc4b457f83b1a49b2f7ffbff6e6 (diff) | |
| download | cpython-aefe2e626eeb2f05cda10a17926f8ba9b7a504ca.zip cpython-aefe2e626eeb2f05cda10a17926f8ba9b7a504ca.tar.gz cpython-aefe2e626eeb2f05cda10a17926f8ba9b7a504ca.tar.bz2 | |
[3.13] gh-111201: Add append to screen method to avoid recalculation (GH-119274) (#119405)
(cherry picked from commit c886bece3b3a49f8a0f188aecfc1d6ff89d281e6)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Ćukasz Langa <lukasz@langa.pl>
Diffstat (limited to 'Lib/_pyrepl/commands.py')
| -rw-r--r-- | Lib/_pyrepl/commands.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/_pyrepl/commands.py b/Lib/_pyrepl/commands.py index 51c7afe..3d9722d 100644 --- a/Lib/_pyrepl/commands.py +++ b/Lib/_pyrepl/commands.py @@ -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): |
