]> git.lyx.org Git - features.git/commitdiff
Enter subindex on Enter in index
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 31 Oct 2022 04:25:04 +0000 (05:25 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 31 Oct 2022 04:25:04 +0000 (05:25 +0100)
src/insets/InsetIndex.cpp

index dd2957981a131c9e21043974b1c8a8d245de0701..25dfb4649ba57dc410b86a5e4d1ec19a0a946b0e 100644 (file)
@@ -29,6 +29,7 @@
 #include "LaTeX.h"
 #include "LaTeXFeatures.h"
 #include "Lexer.h"
+#include "LyX.h"
 #include "output_latex.h"
 #include "output_xhtml.h"
 #include "xml.h"
@@ -579,6 +580,14 @@ void InsetIndex::doDispatch(Cursor & cur, FuncRequest & cmd)
                cur.bv().updateDialog("index", params2string(params_));
                break;
 
+       case LFUN_PARAGRAPH_BREAK: {
+               // Since this inset in single-par anyway, let's use
+               // return to enter subindexes
+               FuncRequest fr(LFUN_INDEXMACRO_INSERT, "subindex");
+               lyx::dispatch(fr);
+               break;
+       }
+
        default:
                InsetCollapsible::doDispatch(cur, cmd);
                break;
@@ -610,6 +619,9 @@ bool InsetIndex::getStatus(Cursor & cur, FuncRequest const & cmd,
                return true;
        }
        
+       case LFUN_PARAGRAPH_BREAK:
+               return macrosPossible("subindex");
+       
        case LFUN_INDEXMACRO_INSERT:
                return macrosPossible(cmd.getArg(0));