hex mode updates

--HG--
branch : pmacs2
This commit is contained in:
moculus 2008-04-10 13:25:34 +00:00
parent 18f905021f
commit 78565025d6
2 changed files with 5 additions and 1 deletions

View File

@ -523,6 +523,10 @@ class Binary32Buffer(FileBuffer):
def __init__(self, path, nl='\n', name=None): def __init__(self, path, nl='\n', name=None):
'''fb = FileBuffer(path)''' '''fb = FileBuffer(path)'''
FileBuffer.__init__(self, path, nl, name) FileBuffer.__init__(self, path, nl, name)
def overwrite_char(self, p, c, act=ACT_NORM, force=False):
Buffer.overwrite_char(self, p, c, act, force)
rawline = self.rawdata[p.y]
self.rawdata[p.y] = rawline[0:p.x] + c + rawline[p.x + 1:]
def read_filter(self, data): def read_filter(self, data):
self.rawdata = [] self.rawdata = []
lines = [] lines = []

View File

@ -541,7 +541,7 @@ class Window(object):
def overwrite_char(self, p, c): def overwrite_char(self, p, c):
line = self.buffer.lines[p.y] line = self.buffer.lines[p.y]
if p.x >= len(line): if p.x >= len(line):
self.insert_string(p, c) return
elif p.x == len(line) - 1: elif p.x == len(line) - 1:
self.buffer.overwrite_char(p, c) self.buffer.overwrite_char(p, c)
if p.y < len(self.buffer.lines): if p.y < len(self.buffer.lines):