diff options
Diffstat (limited to 'prompt_toolkit/key_binding/bindings/named_commands.py')
-rw-r--r-- | prompt_toolkit/key_binding/bindings/named_commands.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/prompt_toolkit/key_binding/bindings/named_commands.py b/prompt_toolkit/key_binding/bindings/named_commands.py index 668477be..5605f89b 100644 --- a/prompt_toolkit/key_binding/bindings/named_commands.py +++ b/prompt_toolkit/key_binding/bindings/named_commands.py @@ -561,7 +561,8 @@ def operate_and_get_next(event): # Set the new index at the start of the next run. def set_working_index(): - buff.working_index = new_index + if new_index < len(buff._working_lines): + buff.working_index = new_index event.cli.pre_run_callables.append(set_working_index) |