aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/data/plugins/keycmd.py
diff options
context:
space:
mode:
authorGravatar Paweł Zuzelski <pawelz@pld-linux.org>2010-07-01 08:47:18 +0200
committerGravatar Paweł Zuzelski <pawelz@pld-linux.org>2010-07-01 08:47:18 +0200
commit0ba5e2ed5678a5ff95fe3146fbbe7b8edd1b7c7b (patch)
tree784b2f33da57a8bcad0b833d02e05497addf0983 /examples/data/plugins/keycmd.py
parentba24e1b02a9fdd58fc1a455c79f9f06880fae424 (diff)
Fix the backspace issue.
There was a bug in keycmd plugin. When cursor was already at the begining of the string, ‘backspace’ key duplicated the content of prompt and set cursor position to negative value.
Diffstat (limited to 'examples/data/plugins/keycmd.py')
-rw-r--r--examples/data/plugins/keycmd.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/data/plugins/keycmd.py b/examples/data/plugins/keycmd.py
index b600afe..503b539 100644
--- a/examples/data/plugins/keycmd.py
+++ b/examples/data/plugins/keycmd.py
@@ -429,6 +429,9 @@ def keycmd_backspace(uzbl, *args):
if not k.keycmd:
return
+ if k.cursor == 0:
+ return
+
k.keycmd = k.keycmd[:k.cursor-1] + k.keycmd[k.cursor:]
k.cursor -= 1
update_event(uzbl, k, False)