parent
f8680694b3
commit
86af2469d4
|
@ -15,7 +15,7 @@ def get_speller():
|
|||
return _speller
|
||||
def free():
|
||||
if _speller:
|
||||
_speller.close()
|
||||
_speller.stop()
|
||||
|
||||
class Speller(object):
|
||||
def __init__(self, cmd='ispell'):
|
||||
|
|
|
@ -630,6 +630,8 @@ class WrapParagraph(Method):
|
|||
# stringify our paragraph
|
||||
s = " ".join(lines)
|
||||
|
||||
#raise Exception, '%r %r' % (limit, s)
|
||||
|
||||
# ok, so now we need to find the line breaks
|
||||
newlines = []
|
||||
while s:
|
||||
|
@ -658,6 +660,8 @@ class WrapParagraph(Method):
|
|||
y += 1
|
||||
k += 1
|
||||
|
||||
#assert len(newlines), 'fooga: %r %r' % (limit, s)
|
||||
|
||||
# kill the old paragraph region, insert the new, and goto the new cursor
|
||||
w.delete(p1, Point(len(w.buffer.lines[i-1]), i-1))
|
||||
w.insert_lines(p1, newlines)
|
||||
|
|
|
@ -44,10 +44,11 @@ class RSTGrammar(Grammar):
|
|||
|
||||
]
|
||||
|
||||
class RstInsertSpace(TextInsertSpace):
|
||||
limit = 75
|
||||
class RstWrapParagraph(method.WrapParagraph):
|
||||
limit = 75
|
||||
class RstInsertSpace(TextInsertSpace):
|
||||
limit = 75
|
||||
wrapper = RstWrapParagraph
|
||||
|
||||
class RST(mode.Fundamental):
|
||||
modename = 'RST'
|
||||
|
@ -99,6 +100,9 @@ class RST(mode.Fundamental):
|
|||
|
||||
}
|
||||
actions = [RstInsertSpace, RstWrapParagraph]
|
||||
config = {
|
||||
'rst.margin': 75,
|
||||
}
|
||||
def __init__(self, w):
|
||||
mode.Fundamental.__init__(self, w)
|
||||
self.add_bindings('rst-insert-space', ('SPACE',))
|
||||
|
|
|
@ -76,6 +76,9 @@ class Text(mode.Fundamental):
|
|||
extensions=['.txt']
|
||||
grammar = TextGrammar
|
||||
actions = [LearnWord, TextInsertSpace, TextWrapParagraph]
|
||||
config = {
|
||||
'text.margin': 78,
|
||||
}
|
||||
def __init__(self, w):
|
||||
mode.Fundamental.__init__(self, w)
|
||||
self.add_bindings('learn-word', ('C-c l',))
|
||||
|
|
|
@ -21,5 +21,6 @@ class Text2(mode.text.Text):
|
|||
'text2_email': ('cyan', 'default', 'bold'),
|
||||
'text2_url': ('green', 'default', 'bold'),
|
||||
}
|
||||
config = {}
|
||||
|
||||
install = Text2.install
|
||||
|
|
Loading…
Reference in New Issue