commit 75aaa8e22b2bec4d3c03712ca09ba13414ee6175
Author: Juergen Spitzmueller <sp...@lyx.org>
Date:   Sun Aug 7 10:41:02 2022 +0200

    Amend 4ba989000c4
    
    If the lfun argument already has a Flex: prefix (which is equivalent),
    do not append one
---
 src/Text3.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/Text3.cpp b/src/Text3.cpp
index f3d4d61..da23857 100644
--- a/src/Text3.cpp
+++ b/src/Text3.cpp
@@ -3182,7 +3182,10 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & 
cmd,
                break;
        case LFUN_FLEX_INSERT: {
                code = FLEX_CODE;
-               docstring s = from_ascii("Flex:") + from_utf8(cmd.getArg(0));
+               docstring s = from_utf8(cmd.getArg(0));
+               // Prepend "Flex:" prefix if not there
+               if (!prefixIs(s, from_ascii("Flex:")))
+                       s = from_ascii("Flex:") + s;
                if (!cur.buffer()->params().documentClass().hasInsetLayout(s))
                        enable = false;
                else {
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to