Fix lyx2lyx issue reported on ML

The issue was reported on lyx-users by Chris Menzel [1].

Patch is from José Matos [2].

[1] https://www.mail-archive.com/search?l=mid&q=BD744D7E-54B4-4E95-A4E3-6B28F4987DE1%40gmail.com
[2] https://www.mail-archive.com/search?l=mid&q=c2ac54c2322d24051f171558ad8487ea4f7078ed.camel%40gmail.com
This commit is contained in:
Scott Kostyshak 2023-09-06 13:05:07 -04:00
parent 5840806a4c
commit 77fc67d3f0

View File

@ -689,7 +689,8 @@ def count_pars_in_inset(lines, i):
pars = 0
for j in range(ins[1], ins[2]):
m = re.match(r'\\begin_layout (.*)', lines[j])
if m and get_containing_inset(lines, j)[1] == ins[1]:
found_inset = get_containing_inset(lines, j)
if m and found_inset and found_inset[1] == ins[1]:
pars += 1
return pars