From: Neil Brown Date: Thu, 28 Aug 2008 11:32:36 +0000 (+1000) Subject: Allowing inserting a line break in the middle of a text X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=d44a11aee90e89aeb8ce13be1e6812404381f921;p=scribble.git Allowing inserting a line break in the middle of a text this makes two texts. They cannot (yet) be joined again. --- diff --git a/scribble.py b/scribble.py index 8d13a91..b0dbbfb 100755 --- a/scribble.py +++ b/scribble.py @@ -917,9 +917,11 @@ class ScribblePad: if self.textcurs < len(self.textstr): self.textcurs += 1 elif sym == "": + tail = self.textstr[self.textcurs:] + self.textstr = self.textstr[:self.textcurs] self.flush_text() - self.textcurs = 0 - self.textstr = "" + self.textcurs = len(tail) + self.textstr = tail self.textpos = [ self.textpos[0], self.textpos[1] + self.lineheight ] else: