From: Stefan Huber Date: Tue, 10 Jun 2008 11:47:22 +0000 (+0200) Subject: fixing bug, when getting text from terminal: started at line -1 X-Git-Tag: v0.99.0~18 X-Git-Url: https://git.sthu.org/?a=commitdiff_plain;h=66662457f7e6cfc95de535503aa1f4b088822d2f;p=pygdb.git fixing bug, when getting text from terminal: started at line -1 --- diff --git a/DbgTerminal.py b/DbgTerminal.py index 11eaf5c..e9a706f 100644 --- a/DbgTerminal.py +++ b/DbgTerminal.py @@ -59,7 +59,7 @@ class DbgTerminal (vte.Terminal): def contents_changed(self, term): c,r = term.get_cursor_position() - text = self.get_text_range(self.getHistoryLen()-1,0,r,-1,lambda *w:True) + text = self.get_text_range(max(self.getHistoryLen()-1,0),0,r,-1,lambda *w:True) #Remove annoying \n at the end assert(text[-1] == "\n") @@ -76,6 +76,8 @@ class DbgTerminal (vte.Terminal): self.history += [l+"\n" for l in lines[:-1]] self.history += [lines[-1]] + assert(r == self.getHistoryLen()-1) + def waitForNewline(self): l = self.getHistoryLen()