From: Enrico Forestieri Date: Sat, 18 Oct 2008 09:06:27 +0000 (+0000) Subject: When pasting into mathed, take into account the current mode. X-Git-Tag: 1.6.10~3009 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=6bd593d8b38770ce0661bb8e7a83ba754ed17c79;p=features.git When pasting into mathed, take into account the current mode. For example, this allows to paste something like $x$ to a textmode inset and get the expected result. If $x$ is pasted in mathmode, it is pasted verbatim, such that no compile errors can arise. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26935 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp index aa79ed0f78..52c79f458a 100644 --- a/src/mathed/InsetMathGrid.cpp +++ b/src/mathed/InsetMathGrid.cpp @@ -1251,6 +1251,8 @@ void InsetMathGrid::doDispatch(Cursor & cur, FuncRequest & cmd) parseflg |= Parse::VERBATIM; // fall through case LFUN_PASTE: { + if (cur.currentMode() == TEXT_MODE) + parseflg |= Parse::TEXTMODE; cur.message(_("Paste")); cap::replaceSelection(cur); docstring topaste; diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index a1f739afb9..591e3609e4 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -521,6 +521,8 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd) parseflg |= Parse::VERBATIM; // fall through case LFUN_PASTE: { + if (cur.currentMode() == TEXT_MODE) + parseflg |= Parse::TEXTMODE; cur.recordUndoSelection(); cur.message(_("Paste")); replaceSelection(cur);