From 5c0beaf55bcb489443a48e14c85621069fe720cf Mon Sep 17 00:00:00 2001 From: moculus Date: Thu, 10 Apr 2008 15:44:26 +0000 Subject: [PATCH] bug fix? --HG-- branch : pmacs2 --- mode/hex.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mode/hex.py b/mode/hex.py index d5bfc67..bdd1e1e 100644 --- a/mode/hex.py +++ b/mode/hex.py @@ -53,10 +53,13 @@ class Hex(mode.Fundamental): i = self.window.buffer.cursorx_to_datax(cx) if i is None: return ((0, s, color.build('green', 'default', 'bold')),) - else: + elif i < len(s) - 1: return ((0, s[0:i], color.build('green', 'default', 'bold')), (i, s[i], color.build('default', 'default', 'bold', 'reverse')), (i + 1, s[i+1:], color.build('green', 'default', 'bold'))) + else: + return ((0, s[0:i], color.build('green', 'default', 'bold')), + (i, s[i], color.build('default', 'default', 'bold', 'reverse'))) else: return ((0, s, color.build('green', 'default', 'bold')),)