From: Abdelrazak Younes Date: Thu, 19 Apr 2007 13:37:17 +0000 (+0000) Subject: Fix bug 2466 by Stefan Schimanski: X-Git-Tag: 1.6.10~10210 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=789f9e5ee397be33f5b3b88a14978cd1e61a0f2b;p=features.git Fix bug 2466 by Stefan Schimanski: If the cursor is currently in macro mode (e.g. the user is typing \fra, but hasn't finished the command \frac) macros shouldn't be updated. Another forced screen update is needed if the user leaves macro mode just with the cursor right key (which doesn't trigger full screen updates itself). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17860 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/BufferView.C b/src/BufferView.C index ada9cd1171..2c4b7a36b0 100644 --- a/src/BufferView.C +++ b/src/BufferView.C @@ -357,7 +357,8 @@ bool BufferView::update(Update::flags flags) LYXERR(Debug::WORKAREA) << "BufferView::update" << std::endl; // Update macro store - buffer_->buildMacros(); + if (!(cursor().inMathed() && cursor().inMacroMode())) + buffer_->buildMacros(); // Now do the first drawing step if needed. This consists on updating // the CoordCache in updateMetrics(). diff --git a/src/cursor.C b/src/cursor.C index 68a5e8ba4b..e1ff22f267 100644 --- a/src/cursor.C +++ b/src/cursor.C @@ -899,14 +899,11 @@ bool LCursor::macroModeClose() if (s == "\\") return false; - // prevent entering of recursive macros - // FIXME: this is only a weak attempt... only prevents immediate - // recursion - docstring const name = s.substr(1); - InsetBase const * macro = innerInsetOfType(InsetBase::MATHMACRO_CODE); - if (macro && macro->getInsetName() == name) - lyxerr << "can't enter recursive macro" << endl; + // trigger updates of macros, at least, if no full + // updates take place anyway + updateFlags(Update::Force); + docstring const name = s.substr(1); InsetMathNest * const in = inset().asInsetMath()->asNestInset(); if (in && in->interpretString(*this, s)) return true;