diff --git a/BUGS b/BUGS index 2556fca..4cbbf03 100644 --- a/BUGS +++ b/BUGS @@ -21,6 +21,7 @@ to see anything). sometimes searching seems to save the wrong cursor position, or not overwrite the previously used one, and you end up finding matches *before* your search started. +* possibly fixed (2007/09/26) 2006/07/04: undo/redo is mostly fixed, but there are still occasionally problems, which seem diff --git a/application.py b/application.py index 0b94885..f335467 100755 --- a/application.py +++ b/application.py @@ -496,7 +496,7 @@ class Application(object): # full screen drawer def draw(self, err=""): try: - self.draw_slots() #XYZ + self.draw_slots() self.draw_input_bar() self.draw_cursor() self.win.noutrefresh() @@ -754,24 +754,32 @@ class Application(object): self.win.addch(self.y-1, self.x-1, ' ') except: pass + + def _get_mini_lines(self, s): + i = self.x - 1 + return [s[:i]] + + lines = [s[:i]] + while i < len(s): + lines.append(s[i:self.x - 1 + i]) + i += self.x - 1 + return lines + def draw_error(self): - l = self.x - 1 - s1 = self.error_string - s2 = util.cleanse(util.padtrunc(s1, l)) - #self.win.addnstr(self.y-1, 0, s2, l) - self.win.addstr(self.y-1, 0, s2) + lines = self._get_mini_lines(self.error_string) + for i in range(0, len(lines)): + line = util.pad(lines[i], self.x - 1) + self.win.addstr(self.y - len(lines) + i, 0, line) + def draw_mini_buffer(self): - l = self.x - 1 b = self.mini_buffer - s1 = self.mini_prompt + b.lines[0] - s2 = util.padtrunc(s1, l) - #self.win.addnstr(self.y-1, 0, s2, l) - self.win.addstr(self.y-1, 0, s2) + lines = self._get_mini_lines(self.mini_prompt + b.lines[0]) + for i in range(0, len(lines)): + line = util.pad(lines[i], self.x - 1) + self.win.addstr(self.y - len(lines) + i, 0, line) def draw_nothing(self): - l = self.x - 1 - #self.win.addnstr(self.y-1, 0, util.pad('', l), l) - self.win.addstr(self.y-1, 0, util.pad('', l)) + self.win.addstr(self.y-1, 0, util.pad('', self.x - 1)) def open_aes_file(path, nl, name=None): if os.path.isfile(path) or not os.path.exists(path): @@ -864,4 +872,3 @@ if __name__ == "__main__": # ok, now run our app run(buffers, opts.goto, opts.mode) - \ No newline at end of file