From: Juergen Spitzmueller Date: Tue, 24 Mar 2015 20:43:25 +0000 (+0100) Subject: Fix thinko in convert_corollary_args X-Git-Tag: 2.2.0alpha1~1108 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=0e62bf9e0a5868404b69c8c5a92226087c9a073a;p=features.git Fix thinko in convert_corollary_args Fixes: #9478 --- diff --git a/lib/lyx2lyx/lyx_2_1.py b/lib/lyx2lyx/lyx_2_1.py index f4d7398f04..074433f126 100644 --- a/lib/lyx2lyx/lyx_2_1.py +++ b/lib/lyx2lyx/lyx_2_1.py @@ -2461,22 +2461,22 @@ def convert_corollary_args(document): document.body[parbeg] = "\\begin_inset Argument 1" elif document.body[ertcontlastline].endswith("]"): # divide the args - ertcontdivline = document.body[ertcontfirstline].find('>[') - if ertcontdivline != -1: + tok = document.body[ertcontfirstline].find('>[') + if tok != -1: if ertcontfirstline < ertcontlastline: # Multiline ERT. Might contain TeX code. Embrace in ERT. document.body[ertcontlastline : ertcontlastline + 1] = [ document.body[ertcontlastline], '\\end_layout', '', '\\end_inset'] - document.body[ertcontdivline : ertcontdivline + 1] = [document.body[ertcontdivline][:tok], + document.body[ertcontfirstline : ertcontfirstline + 1] = [document.body[ertcontfirstline][:tok], '\\end_layout', '', '\\end_inset', '', '', '\\begin_inset Argument 2', 'status collapsed', '', '\\begin_layout Plain Layout', '\\begin_inset ERT', '', 'status open' '', '\\begin_layout Plain Layout', - document.body[ertcontdivline][tok + 2:]] + document.body[ertcontfirstline][tok + 2:-1]] else: - document.body[ertcontdivline : ertcontdivline + 1] = [document.body[ertcontdivline][:tok], + document.body[ertcontfirstline : ertcontfirstline + 1] = [document.body[ertcontfirstline][:tok], '\\end_layout', '', '\\end_inset', '', '', '\\begin_inset Argument 2', 'status collapsed', '', '\\begin_layout Plain Layout', - document.body[ertcontdivline][tok + 2:]] + document.body[ertcontfirstline][tok + 2:-1]] # Convert to ArgInset document.body[parbeg] = "\\begin_inset Argument 1" i = j