]> git.lyx.org Git - lyx.git/commitdiff
Fix bug #11151
authorEnrico Forestieri <forenr@lyx.org>
Sat, 19 May 2018 19:33:29 +0000 (21:33 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Mon, 21 May 2018 20:01:56 +0000 (22:01 +0200)
(cherry picked from commit 17ea71b31c6b5708241d8a9d2ca5afd331446c1c)

src/BufferParams.cpp
status.23x

index 60c7bb0c129952e7596367e3ce2f026a3be3acab..6d519f27f8c41674c21b91f0c7cec03b53d89393 100644 (file)
@@ -2264,16 +2264,16 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
        if (!listings_params.empty()
            || features.mustProvide("listings")
            || features.mustProvide("minted")) {
-               if (features.mustProvide("listings"))
-                       os << "\\usepackage{listings}\n";
-               else
+               if (use_minted)
                        os << "\\usepackage{minted}\n";
+               else
+                       os << "\\usepackage{listings}\n";
        }
        if (!listings_params.empty()) {
-               if (features.mustProvide("listings"))
-                       os << "\\lstset{";
-               else
+               if (use_minted)
                        os << "\\setminted{";
+               else
+                       os << "\\lstset{";
                // do not test validity because listings_params is
                // supposed to be valid
                string par =
index 6bb13e67301433b1827912b33c3941178471e90b..a581df3fd1effcd37a1a918bcae4250464c34a40 100644 (file)
@@ -253,6 +253,9 @@ What's new
 - Correct list of previous versions to check for user directory contents
   (bug 11142 on Mac).
 
+- Honor the syntax highlighting package choice when adding listing params
+  without actually inserting a listing (bug 11151).
+
 * INTERNALS
 
 - Fix bug that TeX files were not detected when reconfiguring LyX