summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Slenders <jonathan@slenders.be>2018-07-13 15:15:14 +0200
committerJonathan Slenders <jonathan@slenders.be>2018-07-13 15:15:14 +0200
commite525121cc48314746ad3739e4dd41972194b954c (patch)
tree0c7970a89f37869c4577a6da403d87b4002a59fc
parentdc7b91be3ca8f106b2225db9ef986ef937f85405 (diff)
Small fix in renderer. Use total height for min_available_height for Windows full screen apps.
-rw-r--r--prompt_toolkit/renderer.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/prompt_toolkit/renderer.py b/prompt_toolkit/renderer.py
index cc891f1d..829bb3de 100644
--- a/prompt_toolkit/renderer.py
+++ b/prompt_toolkit/renderer.py
@@ -364,6 +364,11 @@ class Renderer(object):
def request_absolute_cursor_position(self):
"""
Get current cursor position.
+
+ We do this to calculate the minimum available height that we can
+ consume for rendering the prompt. This is the available space below te
+ cursor.
+
For vt100: Do CPR request. (answer will arrive later.)
For win32: Do API call. (Answer comes immediately.)
"""
@@ -371,14 +376,15 @@ class Renderer(object):
# clear or reset). We will rely on that in `report_absolute_cursor_row`.
assert self._cursor_pos.y == 0
+ # In full-screen mode, always use the total height as min-available-height.
+ if self.full_screen:
+ self._min_available_height = self.output.get_size().rows
# For Win32, we have an API call to get the number of rows below the
# cursor.
- if is_windows():
+ elif is_windows():
self._min_available_height = self.output.get_rows_below_cursor_position()
else:
- if self.full_screen:
- self._min_available_height = self.output.get_size().rows
- elif self.cpr_support == CPR_Support.NOT_SUPPORTED:
+ if self.cpr_support == CPR_Support.NOT_SUPPORTED:
return
else:
# Asks for a cursor position report (CPR).