]> git.lyx.org Git - lyx.git/commitdiff
Fix prefs2prefs for \\set_color
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 15 Dec 2020 08:15:23 +0000 (09:15 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Tue, 15 Dec 2020 08:15:23 +0000 (09:15 +0100)
lib/scripts/prefs2prefs_prefs.py

index 88b004154fd5daeb03112622eef9565b5f7ad463..61c93d05befe743336123b41be6550a15cd37ddf 100644 (file)
@@ -455,6 +455,16 @@ def rename_cyrillic_kmap_files(line):
        line = line.replace('"koi8-u"', '"ukrainian"')
        return (True, line)
 
+def add_dark_color(line):
+       if not line.lower().startswith("\\set_color "):
+               return no_match
+       colre = re.compile(r'^\\set_color\s+(.*)\s+(.*)"', re.IGNORECASE)
+       m = colre.match(line)
+       if not m:
+               return no_match
+       line += " " + m.group(2) + '"'
+       return (True, line)
+
 # End conversions for LyX 2.3 to 2.4
 ####################################
 
@@ -504,5 +514,5 @@ conversions = [
        [ 32, []],
        [ 33, []],
        [ 34, [rename_cyrillic_kmap_files]],
-       [ 35, []]
+       [ 35, [add_dark_color]]
 ]