mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 04:32:36 +01:00
plugins/Unix: Keep track of two lines in Unix.spell since aspell sometimes list suggestions after a '*' or '+' line.
This commit is contained in:
parent
1edb4e13bf
commit
0367ae5615
@ -154,6 +154,10 @@ class Unix(callbacks.Plugin):
|
|||||||
# aspell puts extra whitespace, ignore it
|
# aspell puts extra whitespace, ignore it
|
||||||
while not line.strip('\r\n'):
|
while not line.strip('\r\n'):
|
||||||
line = pipeReadline(r)
|
line = pipeReadline(r)
|
||||||
|
# cache an extra line in case aspell's first line says the word
|
||||||
|
# is spelled correctly, but subsequent lines offer spelling
|
||||||
|
# suggestions
|
||||||
|
line2 = pipeReadline(r)
|
||||||
except TimeoutError:
|
except TimeoutError:
|
||||||
irc.error('The spell command timed out.')
|
irc.error('The spell command timed out.')
|
||||||
return
|
return
|
||||||
@ -162,6 +166,10 @@ class Unix(callbacks.Plugin):
|
|||||||
w.close()
|
w.close()
|
||||||
inst.wait()
|
inst.wait()
|
||||||
# parse the output
|
# parse the output
|
||||||
|
# aspell will sometimes list spelling suggestions after a '*' or '+'
|
||||||
|
# line for complex words.
|
||||||
|
if line[0] in '*+' and line2.strip('\r\n'):
|
||||||
|
line = line2
|
||||||
if line[0] in '*+':
|
if line[0] in '*+':
|
||||||
resp = format('%q may be spelled correctly.', word)
|
resp = format('%q may be spelled correctly.', word)
|
||||||
elif line[0] == '#':
|
elif line[0] == '#':
|
||||||
|
Loading…
Reference in New Issue
Block a user