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