]> git.lyx.org Git - features.git/commitdiff
needsCProtection: consider LaTeXType "none"
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 15 Apr 2018 10:31:27 +0000 (12:31 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 15 Apr 2018 10:31:27 +0000 (12:31 +0200)
src/insets/InsetText.cpp

index 4c560f492c7314d9297075e6005ea541fcedd3bf..e65f7e9d03e24bebae9a5983a929d2bbc7ab98d2 100644 (file)
@@ -1091,8 +1091,9 @@ bool InsetText::needsCProtection() const
        if (!getLayout().needsCProtect())
                return false;
 
-       // Environments need cprotection regardless the content
-       if (getLayout().latextype() == InsetLayout::ENVIRONMENT)
+       // Environments and "no latex" types (e.g., knitr chunks)
+       // need cprotection regardless the content
+       if (getLayout().latextype() != InsetLayout::COMMAND)
                return true;
 
        // Commands need cprotection if they contain specific chars