Enter subindex on Enter in index

This commit is contained in:
Juergen Spitzmueller 2022-10-31 05:25:04 +01:00
parent 5a7c6aaeee
commit 9dc9fa68ce

View 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));