Skip to content

Commit f1b68e7

Browse files
Using the focus_stack from BufferMapping. (Change in prompt_toolkit.)
1 parent 94f6c9c commit f1b68e7

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

ptpython/history_browser.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -468,10 +468,10 @@ def _(event):
468468
def _(event):
469469
" Select other window. "
470470
if event.cli.current_buffer_name == HISTORY_BUFFER:
471-
event.cli.focus_stack.replace(DEFAULT_BUFFER)
471+
event.cli.focus(DEFAULT_BUFFER)
472472

473473
elif event.cli.current_buffer_name == DEFAULT_BUFFER:
474-
event.cli.focus_stack.replace(HISTORY_BUFFER)
474+
event.cli.focus(HISTORY_BUFFER)
475475

476476
@handle(Keys.F4)
477477
def _(event):
@@ -481,18 +481,18 @@ def _(event):
481481
@handle(Keys.F1)
482482
def _(event):
483483
" Display/hide help. "
484-
if event.cli.focus_stack.current == HELP_BUFFER:
485-
event.cli.focus_stack.pop()
484+
if event.cli.current_buffer_name == HELP_BUFFER:
485+
event.cli.pop_focus()
486486
else:
487-
event.cli.focus_stack.push(HELP_BUFFER)
487+
event.cli.push_focus(HELP_BUFFER)
488488

489489
@handle(Keys.ControlJ, filter=help_focussed)
490490
@handle(Keys.ControlC, filter=help_focussed)
491491
@handle(Keys.ControlG, filter=help_focussed)
492492
@handle(Keys.Escape, filter=help_focussed)
493493
def _(event):
494494
" Leave help. "
495-
event.cli.focus_stack.pop()
495+
event.cli.pop_focus()
496496

497497
@handle('q', filter=main_buffer_focussed)
498498
@handle(Keys.F3, filter=main_buffer_focussed)

ptpython/layout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ def get_tokens(cli):
303303
len(python_buffer._working_lines))))
304304

305305
# Shortcuts.
306-
if not python_input.vi_mode and cli.focus_stack.current == 'search':
306+
if not python_input.vi_mode and cli.current_buffer_name == SEARCH_BUFFER:
307307
append((TB, '[Ctrl-G] Cancel search [Enter] Go to this position.'))
308308
elif bool(cli.current_buffer.selection_state) and not python_input.vi_mode:
309309
# Emacs cut/copy keys.

ptpython/python_input.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ def _on_input_timeout(self, cli):
548548
When there is no input activity,
549549
in another thread, get the signature of the current code.
550550
"""
551-
if cli.focus_stack.current != DEFAULT_BUFFER:
551+
if cli.current_buffer_name != DEFAULT_BUFFER:
552552
return
553553

554554
# Never run multiple get-signature threads.

0 commit comments

Comments
 (0)