Don't allow captions in non-floating listings

It was possible to insert a caption in a listing not marked as
floating. This didn't cause errors but the caption simply was
disappearing in the output.
This commit is contained in:
Enrico Forestieri 2017-06-07 18:15:59 +02:00
parent 48144c474b
commit fd0756141c

View File

@ -418,7 +418,8 @@ bool InsetListings::getStatus(Cursor & cur, FuncRequest const & cmd,
return true;
case LFUN_CAPTION_INSERT: {
// the inset outputs at most one caption
if (params().isInline() || getCaptionInset()) {
if (params().isInline() || !params().isFloat()
|| getCaptionInset()) {
status.setEnabled(false);
return true;
}