Skip to content

Commit 3d589dc

Browse files
committed
Fix vi command invalidation
1 parent 551c03c commit 3d589dc

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Lib/_pyrepl/vi_commands.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,9 @@ def do(self) -> None:
416416
pending_char = self.event[-1]
417417
if not pending_char or r.pos >= len(r.buffer):
418418
return
419+
pos = r.pos
419420
r.buffer[r.pos] = pending_char
420-
r.dirty = True
421+
r.invalidate_buffer(pos)
421422

422423
class vi_replace_cancel(Command):
423424
"""Cancel pending replace operation."""
@@ -440,4 +441,4 @@ def do(self) -> None:
440441
state = r.undo_stack.pop()
441442
r.buffer[:] = state.buffer_snapshot
442443
r.pos = state.pos_snapshot
443-
r.dirty = True
444+
r.invalidate_buffer(0)

0 commit comments

Comments
 (0)