parent
e02bdd3b19
commit
3cb04bfb18
|
@ -551,23 +551,23 @@ class WrapLine(Method):
|
|||
p3 = Point(0, cursor.y)
|
||||
w.buffer.insert_lines(p3, lines)
|
||||
w.goto(Point(x, y))
|
||||
|
||||
class WrapParagraph(Method):
|
||||
limit = 80
|
||||
valid_re = re.compile('^( *)([^ ].*)$')
|
||||
empty_re = regex.whitespace
|
||||
prefix_re = None
|
||||
def _execute(self, w, **vargs):
|
||||
# we will store the start of our paragaph in p1, and also the original
|
||||
# cursor position.
|
||||
p1 = oldc = w.logical_cursor()
|
||||
cur_offset = 0
|
||||
|
||||
m = self.valid_re.match(w.buffer.lines[p1.y])
|
||||
m = self.valid_re.match(w.buffer.lines[p1.y])
|
||||
if not m:
|
||||
# the line was empty, so return
|
||||
# the line was empty
|
||||
return
|
||||
elif m.group(1):
|
||||
# the line had leading whitespace, so return
|
||||
# the line had leading whitespace
|
||||
return
|
||||
|
||||
# see if we are starting in the middle of the paragraph; if so, then
|
||||
|
|
Loading…
Reference in New Issue