#include "Encoding.h"
#include "FuncRequest.h"
#include "FuncStatus.h"
+#include "LaTeXFeatures.h"
#include "LyX.h"
#include "LyXRC.h"
+#include "MetricsInfo.h"
#include "OutputParams.h"
+#include "TexRow.h"
#include "Text.h"
#include "frontends/Application.h"
#include "frontends/Painter.h"
#include "frontends/Selection.h"
-#include "support/lassert.h"
#include "support/debug.h"
+#include "support/docstream.h"
#include "support/gettext.h"
+#include "support/lassert.h"
#include "support/lstrings.h"
#include "support/textutils.h"
-#include "support/docstream.h"
#include <algorithm>
#include <sstream>
void InsetMathNest::dump() const
{
odocstringstream oss;
- TexRow texrow(false);
- otexrowstream ots(oss,texrow);
+ otexrowstream ots(oss);
WriteStream os(ots);
os << "---------------------------------------------\n";
write(os);
docstring const latex_name = name();
os << '\\' << latex_name;
for (size_t i = 0; i < nargs(); ++i) {
- os.pushRowEntry(TexRow::mathEntry(id(),i));
+ Changer dummy = os.changeRowEntry(TexRow::mathEntry(id(),i));
os << '{' << cell(i) << '}';
- os.popRowEntry();
}
if (nargs() == 0)
os.pendingSpace(true);
WriteStream wi(os, runparams.moving_arg, true,
runparams.dryrun ? WriteStream::wsDryrun : WriteStream::wsDefault,
runparams.encoding);
+ wi.strikeoutMath(runparams.inDeletedInset
+ && (!LaTeXFeatures::isAvailable("dvipost")
+ || (runparams.flavor != OutputParams::LATEX
+ && runparams.flavor != OutputParams::DVILUATEX)));
+ if (runparams.inulemcmd) {
+ wi.ulemCmd(WriteStream::UNDERLINE);
+ if (runparams.local_font) {
+ FontInfo f = runparams.local_font->fontInfo();
+ if (f.strikeout() == FONT_ON)
+ wi.ulemCmd(WriteStream::STRIKEOUT);
+ }
+ }
wi.canBreakLine(os.canBreakLine());
- if (runparams.lastid != -1) {
- wi.pushRowEntry(os.texrow().textEntry(runparams.lastid,
- runparams.lastpos));
- write(wi);
- wi.popRowEntry();
- } else
- write(wi);
+ Changer dummy = wi.changeRowEntry(TexRow::textEntry(runparams.lastid,
+ runparams.lastpos));
+ write(wi);
// Reset parbreak status after a math inset.
os.lastChar(0);
os.canBreakLine(wi.canBreakLine());
replaceSelection(cur);
docstring topaste;
if (cmd.argument().empty() && !theClipboard().isInternal())
- topaste = theClipboard().getAsText(Clipboard::PlainTextType);
+ topaste = theClipboard().getAsText(frontend::Clipboard::PlainTextType);
else {
size_t n = 0;
idocstringstream is(cmd.argument());
cur.selHandle(select);
// handle autocorrect:
- cur.autocorrect() = false;
- cur.message(_("Autocorrect Off ('!' to enter)"));
+ if (lyxrc.autocorrection_math && cur.autocorrect()) {
+ cur.autocorrect() = false;
+ cur.message(_("Autocorrect Off ('!' to enter)"));
+ }
// go up/down
bool up = act == LFUN_UP || act == LFUN_UP_SELECT;
}
case LFUN_MOUSE_DOUBLE:
- case LFUN_MOUSE_TRIPLE:
case LFUN_WORD_SELECT:
cur.pos() = 0;
+ cur.resetAnchor();
+ cur.selection(true);
+ cur.pos() = cur.lastpos();
+ cur.bv().cursor() = cur;
+ break;
+
+ case LFUN_MOUSE_TRIPLE:
cur.idx() = 0;
+ cur.pos() = 0;
cur.resetAnchor();
- cur.setSelection(true);
+ cur.selection(true);
cur.idx() = cur.lastidx();
cur.pos() = cur.lastpos();
cur.bv().cursor() = cur;
}
}
bool do_selection = cmd.button() == mouse_button::button1
- && cmd.argument() == "region-select";
+ && cmd.modifier() == ShiftModifier;
bv.mouseSetCursor(cur, do_selection);
if (cmd.button() == mouse_button::button1) {
//lyxerr << "## lfunMousePress: setting cursor to: " << cur << endl;
cur.noScreenUpdate();
else {
Cursor & bvcur = cur.bv().cursor();
- bvcur.setSelection(true);
+ bvcur.selection(true);
}
return;
}
// just clear selection on pressing the space bar
if (cur.selection() && c == ' ') {
- cur.setSelection(false);
+ cur.selection(false);
return true;
}
cur.niceInsert(createInsetMath("sim", buf));
return true;
}
- if (currentMode() == InsetMath::MATH_MODE && !isAsciiOrMathAlpha(c)) {
+ if (currentMode() == InsetMath::MATH_MODE && Encodings::isUnicodeTextOnly(c)) {
MathAtom at = createInsetMath("text", buf);
at.nucleus()->cell(0).push_back(MathAtom(new InsetMathChar(c)));
cur.niceInsert(at);