parent
108ebbfef1
commit
0c22be7e82
|
@ -455,6 +455,7 @@ class Application(object):
|
|||
# the mighty run-loop!
|
||||
def run(self):
|
||||
self.done = False
|
||||
self.draw()
|
||||
while not self.done:
|
||||
i = self.win.getch()
|
||||
if i == curses.KEY_RESIZE:
|
||||
|
@ -469,15 +470,7 @@ class Application(object):
|
|||
while len(self.input.tokens):
|
||||
t = self.input.tokens.pop(0)
|
||||
self.active_window().mode.handle_token(t)
|
||||
self.draw()
|
||||
if err:
|
||||
self.set_error(err)
|
||||
if self.error_timestamp is not None and ERROR_TIMEOUT > 0 and \
|
||||
time.time() - self.error_timestamp > ERROR_TIMEOUT:
|
||||
self.clear_error()
|
||||
(y, x) = self.stdscr.getmaxyx()
|
||||
if y != self.y or x != self.x:
|
||||
self.resize_event()
|
||||
self.draw(err)
|
||||
|
||||
# clear the error line; it might look confusing to the user
|
||||
try:
|
||||
|
@ -495,7 +488,7 @@ class Application(object):
|
|||
self.highlighted_ranges = []
|
||||
|
||||
# full screen drawer
|
||||
def draw(self):
|
||||
def draw(self, err=""):
|
||||
try:
|
||||
self.draw_slots() #XYZ
|
||||
self.draw_input_bar()
|
||||
|
@ -506,6 +499,14 @@ class Application(object):
|
|||
# ok, so there was a problem...
|
||||
# let's see if the screen changed sizes and if so, resize our slots
|
||||
self.resize_event()
|
||||
if err:
|
||||
self.set_error(err)
|
||||
if self.error_timestamp is not None and ERROR_TIMEOUT > 0 and \
|
||||
time.time() - self.error_timestamp > ERROR_TIMEOUT:
|
||||
self.clear_error()
|
||||
(y, x) = self.stdscr.getmaxyx()
|
||||
if y != self.y or x != self.x:
|
||||
self.resize_event()
|
||||
|
||||
def draw_cursor(self):
|
||||
if self.mini_active:
|
||||
|
|
Loading…
Reference in New Issue