From 78565025d6167417c281ab190597345540aec6a6 Mon Sep 17 00:00:00 2001 From: moculus Date: Thu, 10 Apr 2008 13:25:34 +0000 Subject: [PATCH] hex mode updates --HG-- branch : pmacs2 --- buffer.py | 4 ++++ window.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/buffer.py b/buffer.py index e6e242e..06418ef 100644 --- a/buffer.py +++ b/buffer.py @@ -523,6 +523,10 @@ class Binary32Buffer(FileBuffer): def __init__(self, path, nl='\n', name=None): '''fb = FileBuffer(path)''' 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): self.rawdata = [] lines = [] diff --git a/window.py b/window.py index 269260f..904f4d0 100644 --- a/window.py +++ b/window.py @@ -541,7 +541,7 @@ class Window(object): def overwrite_char(self, p, c): line = self.buffer.lines[p.y] if p.x >= len(line): - self.insert_string(p, c) + return elif p.x == len(line) - 1: self.buffer.overwrite_char(p, c) if p.y < len(self.buffer.lines):