commit 725bee17b11edcdabd783803055d3c5d25b2a5b0
Author: Richard Kimberly Heck <[email protected]>
Date:   Sat Jan 9 18:06:50 2021 -0500

    Show plural and caps status for formatted references. Rest of #11073.
    
    Patch from Daniel, more or less.
---
 src/insets/InsetRef.cpp |   42 +++++++++++++++++++++++++++---------------
 1 files changed, 27 insertions(+), 15 deletions(-)

diff --git a/src/insets/InsetRef.cpp b/src/insets/InsetRef.cpp
index 4d21915..ed43d6a 100644
--- a/src/insets/InsetRef.cpp
+++ b/src/insets/InsetRef.cpp
@@ -103,6 +103,13 @@ void InsetRef::changeTarget(docstring const & new_label)
 
 void InsetRef::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
+       // Ctrl + click: go to label
+       if (cmd.action() == LFUN_MOUSE_RELEASE && cmd.modifier() == 
ControlModifier) {
+                       lyx::dispatch(FuncRequest(LFUN_BOOKMARK_SAVE, "0"));
+                       lyx::dispatch(FuncRequest(LFUN_LABEL_GOTO, 
getParam("reference")));
+                       return;
+               }
+
        string const inset = cmd.getArg(0);
        string const arg   = cmd.getArg(1);
        string pstring;
@@ -124,13 +131,6 @@ void InsetRef::doDispatch(Cursor & cur, FuncRequest & cmd)
                }
        }
 
-       // Ctrl + click: go to label
-       if (cmd.action() == LFUN_MOUSE_RELEASE && cmd.modifier() == 
ControlModifier) {
-                       lyx::dispatch(FuncRequest(LFUN_BOOKMARK_SAVE, "0"));
-                       lyx::dispatch(FuncRequest(LFUN_LABEL_GOTO, 
getParam("reference")));
-                       return;
-               }
-
        // otherwise not for us
        if (pstring.empty())
                return InsetCommand::doDispatch(cur, cmd);
@@ -459,6 +459,18 @@ void InsetRef::updateBuffer(ParIterator const & it, 
UpdateType, bool const /*del
        for (int i = 0; !types[i].latex_name.empty(); ++i) {
                if (cmd == types[i].latex_name) {
                        label = _(types[i].short_gui_name);
+                       // indicate plural and caps
+                       if (cmd == "formatted") {
+                               bool const isPlural = getParam("plural") == 
"true";
+                               bool const isCaps = getParam("caps") == "true";
+                               if (isPlural)
+                                       label += from_ascii("+");
+                               if (isCaps) {
+                                       // up arrow (shift key) symbol
+                                       label += docstring(1, 
char_type(0x21E7));
+                               }
+                       }
+                       label += from_ascii(": ");
                        break;
                }
        }
@@ -580,14 +592,14 @@ bool InsetRef::forceLTR(OutputParams const & rp) const
 
 
 InsetRef::type_info const InsetRef::types[] = {
-       { "ref",       N_("Standard"),              N_("Ref: ")},
-       { "eqref",     N_("Equation"),              N_("EqRef: ")},
-       { "pageref",   N_("Page Number"),           N_("Page: ")},
-       { "vpageref",  N_("Textual Page Number"),   N_("TextPage: ")},
-       { "vref",      N_("Standard+Textual Page"), N_("Ref+Text: ")},
-       { "nameref",   N_("Reference to Name"),     N_("NameRef: ")},
-       { "formatted", N_("Formatted"),             N_("Format: ")},
-       { "labelonly", N_("Label Only"),            N_("Label: ")},
+       { "ref",       N_("Standard"),              N_("Ref")},
+       { "eqref",     N_("Equation"),              N_("EqRef")},
+       { "pageref",   N_("Page Number"),           N_("Page")},
+       { "vpageref",  N_("Textual Page Number"),   N_("TextPage")},
+       { "vref",      N_("Standard+Textual Page"), N_("Ref+Text")},
+       { "nameref",   N_("Reference to Name"),     N_("NameRef")},
+       { "formatted", N_("Formatted"),             N_("Format")},
+       { "labelonly", N_("Label Only"),            N_("Label")},
        { "", "", "" }
 };
 
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to