]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetCommand.cpp
Enable dissolve in undefined Flex inset context menu
[lyx.git] / src / insets / InsetCommand.cpp
index f4f169232b2a8cfb50f55547348f843543b28c57..7693d08fd7c70010f323eddd24956697932d09fd 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "Buffer.h"
 #include "BufferEncodings.h"
+#include "BufferParams.h"
 #include "BufferView.h"
 #include "Cursor.h"
 #include "DispatchResult.h"
 
 #include "support/debug.h"
 #include "support/gettext.h"
+#include "support/lstrings.h"
 
 #include "frontends/Application.h"
 
 #include <sstream>
 
 using namespace std;
+using namespace lyx::support;
 
 
 namespace lyx {
@@ -96,7 +99,8 @@ InsetCommand::~InsetCommand()
 
 void InsetCommand::metrics(MetricsInfo & mi, Dimension & dim) const
 {
-       button_.update(screenLabel(), editable() || clickable(*mi.base.bv, 0, 0));
+       button_.update(screenLabel(), editable() || clickable(*mi.base.bv, 0, 0),
+                      inheritFont());
        button_.metrics(mi, dim);
 }
 
@@ -138,7 +142,11 @@ void InsetCommand::setParams(InsetCommandParams const & p)
 void InsetCommand::latex(otexstream & os, OutputParams const & runparams_in) const
 {
        OutputParams runparams = runparams_in;
-       os << getCommand(runparams);
+       docstring command = getCommand(runparams);
+       if (buffer().params().use_minted
+           && prefixIs(command, from_ascii("\\lstlistoflistings")))
+               command.erase(1, 3);
+       os << command;
 }
 
 
@@ -341,7 +349,7 @@ bool decodeInsetParam(string const & name, string & data,
                break;
        }
        case ERT_CODE: {
-               data = InsetERT::params2string(InsetCollapsable::Open);
+               data = InsetERT::params2string(InsetCollapsible::Open);
                break;
        }
        case EXTERNAL_CODE: {