commit fd0756141c960d1eb2ffa0e947f01f91aa6b6334
Author: Enrico Forestieri <[email protected]>
Date:   Wed Jun 7 18:15:59 2017 +0200

    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.
---
 src/insets/InsetListings.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/insets/InsetListings.cpp b/src/insets/InsetListings.cpp
index b5a5701..033b72e 100644
--- a/src/insets/InsetListings.cpp
+++ b/src/insets/InsetListings.cpp
@@ -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;
                        }

Reply via email to