+from configHandler import idleConf
+
class History:
def __init__(self, text, output_sep = "\n"):
self.history_prefix = None
self.history_pointer = None
self.output_sep = output_sep
+ self.cyclic = idleConf.GetOption("main", "History", "cyclic", 1, "bool")
text.bind("<<history-previous>>", self.history_prev)
text.bind("<<history-next>>", self.history_next)
if reverse:
pointer = nhist
else:
- pointer = -1
+ if self.cyclic:
+ pointer = -1
+ else:
+ self.text.bell()
+ return
nprefix = len(prefix)
while 1:
if reverse:
pointer = pointer + 1
if pointer < 0 or pointer >= nhist:
self.text.bell()
- if self._get_source("iomark", "end-1c") != prefix:
- self.text.delete("iomark", "end-1c")
- self._put_source("iomark", prefix)
- pointer = prefix = None
+ if not self.cyclic and pointer < 0:
+ return
+ else:
+ if self._get_source("iomark", "end-1c") != prefix:
+ self.text.delete("iomark", "end-1c")
+ self._put_source("iomark", prefix)
+ pointer = prefix = None
break
item = self.history[pointer]
if item[:nprefix] == prefix and len(item) > nprefix:
*Release date: XX-XXX-2005*
+- Add config-main option to make the 'history' feature non-cyclic.
+ Default remains cyclic. Python Patch 914546 Noam Raphael.
+
- Removed ability to configure tabs indent from Options dialog. This 'feature'
has never worked and no one has complained. It is still possible to set a
default tabs (v. spaces) indent 'manually' via config-main.def (or to turn on
# ~/.idlerc/config-highlight.cfg the user highlighting config file
# ~/.idlerc/config-keys.cfg the user keybinding config file
#
-# On Windows2000 and Windows XP the .idlerc directory is at
-# Documents and Settings\<username>\.idlerc
+# On Windows2000 and Windows XP the .idlerc directory is at
+# Documents and Settings\<username>\.idlerc
#
# On Windows98 it is at c:\.idlerc
#
default= 1
name= IDLE Classic Windows
+[History]
+cyclic=1
+
[HelpFiles]