From 0ba5e2ed5678a5ff95fe3146fbbe7b8edd1b7c7b Mon Sep 17 00:00:00 2001 From: Paweł Zuzelski Date: Thu, 1 Jul 2010 08:47:18 +0200 Subject: Fix the backspace issue. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- examples/data/plugins/keycmd.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'examples/data/plugins/keycmd.py') 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) -- cgit v1.2.3