From 18cb7fe6ca54f6f3604e047608931a9b2205a3c5 Mon Sep 17 00:00:00 2001 From: Jorgen Stenarson Date: Thu, 14 Apr 2011 19:01:12 +0200 Subject: [PATCH] Fixing get_history_item indexing to be 1 based, fixes bug #760901 --- pyreadline/lineeditor/history.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyreadline/lineeditor/history.py b/pyreadline/lineeditor/history.py index 640e358..2368566 100644 --- a/pyreadline/lineeditor/history.py +++ b/pyreadline/lineeditor/history.py @@ -49,8 +49,8 @@ class LineHistory(object): return value def get_history_item(self, index): - u'''Return the current contents of history item at index.''' - item = self.history[index] + u'''Return the current contents of history item at index (starts with index 1).''' + item = self.history[index - 1] log(u"get_history_item: index:%d item:%r"%(index, item)) return item.get_line_text()