add temporary fix for diverging prompt_toolkit layout

This commit is contained in:
Gil Forsyth 2016-01-24 12:23:18 -05:00
parent 4e4cfda9f0
commit be6bc4522c

View file

@ -41,7 +41,11 @@ class PromptToolkitCompleter(Completer):
def reserve_space(self):
cli = builtins.__xonsh_shell__.shell.prompter.cli
#TODO remove after next prompt_toolkit release
try:
window = cli.application.layout.children[1].children[1].content
except AttributeError:
window = cli.application.layout.children[1].content
h = window.render_info.content_height
r = builtins.__xonsh_env__.get('COMPLETIONS_MENU_ROWS')
size = h + r