From 789f9e5ee397be33f5b3b88a14978cd1e61a0f2b Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Thu, 19 Apr 2007 13:37:17 +0000 Subject: [PATCH] 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 --- src/BufferView.C | 3 ++- src/cursor.C | 11 ++++------- 2 files changed, 6 insertions(+), 8 deletions(-) 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; -- 2.39.2