mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
Fix some thinkos in the revert_quotes routine
This commit is contained in:
parent
84ffa4b834
commit
e8b1ec66fc
@ -502,7 +502,7 @@ def revert_quotes(document):
|
|||||||
while i < len(document.body):
|
while i < len(document.body):
|
||||||
words = document.body[i].split()
|
words = document.body[i].split()
|
||||||
if len(words) > 1 and words[0] == "\\begin_inset" and \
|
if len(words) > 1 and words[0] == "\\begin_inset" and \
|
||||||
( words[1] in ["ERT", "listings"] or words[2] in ["URL", "Chunk", "Sweave", "S/R"] ):
|
( words[1] in ["ERT", "listings"] or ( len(words) > 2 and words[2] in ["URL", "Chunk", "Sweave", "S/R"]) ):
|
||||||
j = find_end_of_inset(document.body, i)
|
j = find_end_of_inset(document.body, i)
|
||||||
if j == -1:
|
if j == -1:
|
||||||
document.warning("Malformed LyX document: Can't find end of " + words[1] + " inset at line " + str(i))
|
document.warning("Malformed LyX document: Can't find end of " + words[1] + " inset at line " + str(i))
|
||||||
@ -560,7 +560,7 @@ def revert_quotes(document):
|
|||||||
i = 0
|
i = 0
|
||||||
j = 0
|
j = 0
|
||||||
while True:
|
while True:
|
||||||
k = find_token(document.body, '\\begin_inset Quotes', i, j)
|
k = find_token(document.body, '\\begin_inset Quotes', i)
|
||||||
if k == -1:
|
if k == -1:
|
||||||
return
|
return
|
||||||
l = find_end_of_inset(document.body, k)
|
l = find_end_of_inset(document.body, k)
|
||||||
@ -580,7 +580,7 @@ def revert_quotes(document):
|
|||||||
if document.body[k].endswith("s"):
|
if document.body[k].endswith("s"):
|
||||||
replace = "'"
|
replace = "'"
|
||||||
document.body[k:l+1] = [replace]
|
document.body[k:l+1] = [replace]
|
||||||
i += 1
|
i = l
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user