branch : pmacs2
This commit is contained in:
moculus 2008-03-08 02:20:43 +00:00
parent 740fbb85e9
commit 170cafc10f
1 changed files with 9 additions and 0 deletions

View File

@ -787,6 +787,7 @@ class WrapParagraph(WrapLine):
w.goto(Point(x, y))
class WrapParagraph2(Method):
limit = 80
valid_re = re.compile('^( *)([^ ].*)$')
empty_re = regex.whitespace
prefix_re = None
def _execute(self, w, **vargs):
@ -795,6 +796,14 @@ class WrapParagraph2(Method):
p1 = oldc = w.logical_cursor()
cur_offset = 0
m = self.valid_re.match(w.buffer.lines[p1.y])
if not m:
# the line was empty, so return
return
elif m.group(1):
# the line had leading whitespace, so return
return
# see if we are starting in the middle of the paragraph; if so, then
# let's find the actual begining, and update p1 accordingly.
i = p1.y