Allow clearing the history, and saving the history on demand
Let the session tab show all of the history Fix case-sensitive searches to actually allow case-insensitive Make wx.WXK_NUMPAD_ENTER equivalent to wx.WXK_RETURN git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37696 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -147,10 +147,9 @@ Ctrl+[ Decrease font size.
|
||||
Ctrl+= Default font size.
|
||||
Ctrl-Space Show Auto Completion.
|
||||
Ctrl-Alt-Space Show Call Tip.
|
||||
Alt+Shift+C Clear Screen.
|
||||
Shift+Enter Complete Text from History.
|
||||
Ctrl+F Search (backwards) TODO: regexp-wholeWords-...
|
||||
Ctrl+G Search next
|
||||
Ctrl+F Search
|
||||
F3 Search next
|
||||
Ctrl+H "hide" lines containing selection / "unhide"
|
||||
F12 on/off "free-edit" mode
|
||||
"""
|
||||
@@ -321,6 +320,11 @@ class Shell(editwindow.EditWindow):
|
||||
wx.CallAfter(self.ScrollToLine, 0)
|
||||
|
||||
|
||||
def clearHistory(self):
|
||||
self.history = []
|
||||
self.historyIndex = -1
|
||||
dispatcher.send(signal="Shell.clearHistory")
|
||||
|
||||
|
||||
def destroy(self):
|
||||
del self.interp
|
||||
@@ -416,7 +420,7 @@ Platform: %s""" % \
|
||||
currpos = self.GetCurrentPos()
|
||||
stoppos = self.promptPosEnd
|
||||
# Return (Enter) needs to be ignored in this handler.
|
||||
if key == wx.WXK_RETURN:
|
||||
if key in [wx.WXK_RETURN, wx.WXK_NUMPAD_ENTER]:
|
||||
pass
|
||||
elif key in self.autoCompleteKeys:
|
||||
# Usually the dot (period) key activates auto completion.
|
||||
@@ -512,17 +516,17 @@ Platform: %s""" % \
|
||||
|
||||
# Return (Enter) is used to submit a command to the
|
||||
# interpreter.
|
||||
if (not controlDown and not shiftDown and not altDown) and key == wx.WXK_RETURN:
|
||||
if (not controlDown and not shiftDown and not altDown) and key in [wx.WXK_RETURN, wx.WXK_NUMPAD_ENTER]:
|
||||
if self.CallTipActive():
|
||||
self.CallTipCancel()
|
||||
self.processLine()
|
||||
|
||||
# Complete Text (from already typed words)
|
||||
elif shiftDown and key == wx.WXK_RETURN:
|
||||
elif shiftDown and key in [wx.WXK_RETURN, wx.WXK_NUMPAD_ENTER]:
|
||||
self.OnShowCompHistory()
|
||||
|
||||
# Ctrl+Return (Ctrl+Enter) is used to insert a line break.
|
||||
elif controlDown and key == wx.WXK_RETURN:
|
||||
elif controlDown and key in [wx.WXK_RETURN, wx.WXK_NUMPAD_ENTER]:
|
||||
if self.CallTipActive():
|
||||
self.CallTipCancel()
|
||||
if currpos == endpos:
|
||||
@@ -918,6 +922,7 @@ Platform: %s""" % \
|
||||
if command != '' \
|
||||
and (len(self.history) == 0 or command != self.history[0]):
|
||||
self.history.insert(0, command)
|
||||
dispatcher.send(signal="Shell.addHistory", command=command)
|
||||
|
||||
def write(self, text):
|
||||
"""Display text in the shell.
|
||||
|
Reference in New Issue
Block a user