diff options
Diffstat (limited to 'services/console/lib/purk/scripts/history.py')
-rw-r--r-- | services/console/lib/purk/scripts/history.py | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/services/console/lib/purk/scripts/history.py b/services/console/lib/purk/scripts/history.py deleted file mode 100644 index 379ad5e..0000000 --- a/services/console/lib/purk/scripts/history.py +++ /dev/null @@ -1,45 +0,0 @@ -def onKeyPress(e): - if not hasattr(e.window, 'history'): - e.window.history = [], -1 - - if e.key in ('Up', 'Down'): - h, i = e.window.history - - if i == -1 and e.window.input.text: - h.insert(0, e.window.input.text) - i = 0 - - if e.key == 'Up': - i += 1 - - if i < len(h): - e.window.history = h, i - - e.window.input.text = h[i] - e.window.input.cursor = -1 - - else: # e.key == 'Up' - i -= 1 - - if i > -1: - e.window.history = h, i - - e.window.input.text = h[i] - e.window.input.cursor = -1 - - elif i == -1: - e.window.history = h, i - - e.window.input.text = '' - e.window.input.cursor = -1 - -def onInput(e): - if not hasattr(e.window, 'history'): - e.window.history = [], -1 - - if e.text: - h, i = e.window.history - - h.insert(0, e.text) - - e.window.history = h, -1 |