bool MathMacro::completionSupported(Cursor const & cur) const
{
+ if (displayMode() != DISPLAY_UNFOLDED)
+ return InsetMathNest::completionSupported(cur);
+
return lyxrc.completion_popup_math
&& displayMode() == DISPLAY_UNFOLDED
&& cur.bv().cursor().pos() == int(name().size());
bool MathMacro::inlineCompletionSupported(Cursor const & cur) const
{
+ if (displayMode() != DISPLAY_UNFOLDED)
+ return InsetMathNest::inlineCompletionSupported(cur);
+
return lyxrc.completion_inline_math
&& displayMode() == DISPLAY_UNFOLDED
&& cur.bv().cursor().pos() == int(name().size());
bool MathMacro::automaticInlineCompletion() const
{
+ if (displayMode() != DISPLAY_UNFOLDED)
+ return InsetMathNest::automaticInlineCompletion();
+
return lyxrc.completion_inline_math;
}
bool MathMacro::automaticPopupCompletion() const
{
+ if (displayMode() != DISPLAY_UNFOLDED)
+ return InsetMathNest::automaticPopupCompletion();
+
return lyxrc.completion_popup_math;
}
Inset::CompletionListPtr MathMacro::completionList(Cursor const & cur) const
{
+ if (displayMode() != DISPLAY_UNFOLDED)
+ return InsetMathNest::completionList(cur);
+
return CompletionListPtr(new MathCompletionList(cur.bv().cursor()));
}
docstring MathMacro::completionPrefix(Cursor const & cur) const
{
+ if (displayMode() != DISPLAY_UNFOLDED)
+ return InsetMathNest::completionPrefix(cur);
+
if (!completionSupported(cur))
return docstring();
bool MathMacro::insertCompletion(Cursor & cur, docstring const & s,
bool finished)
{
- if (completionSupported(cur))
+ if (displayMode() != DISPLAY_UNFOLDED)
+ return InsetMathNest::insertCompletion(cur, s, finished);
+
+ if (!completionSupported(cur))
return false;
// append completion
void MathMacro::completionPosAndDim(Cursor const & cur, int & x, int & y,
Dimension & dim) const
{
+ if (displayMode() != DISPLAY_UNFOLDED)
+ InsetMathNest::completionPosAndDim(cur, x, y, dim);
+
// get inset dimensions
dim = cur.bv().coordCache().insets().dim(this);
// FIXME: these 3 are no accurate, but should depend on the font.