Cursor::Cursor(BufferView & bv)
: CursorData(&bv.buffer()), bv_(&bv),
x_target_(-1), textTargetOffset_(0),
+ x_clickpos_(-1), y_clickpos_(-1),
beforeDispatchPosX_(0), beforeDispatchPosY_(0)
{}
beginUndoGroup();
+ Inset * nextins = nextInset();
// Is this a function that acts on inset at point?
- if (lyxaction.funcHasFlag(cmd.action(), LyXAction::AtPoint)
- && nextInset()) {
+ if (lyxaction.funcHasFlag(cmd.action(), LyXAction::AtPoint) && nextins) {
disp_.dispatched(true);
disp_.screenUpdate(Update::FitCursor | Update::Force);
FuncRequest tmpcmd = cmd;
- LYXERR(Debug::DEBUG, "Cursor::dispatch: (AtPoint) cmd: "
+ LYXERR(Debug::ACTION, "Cursor::dispatch: (AtPoint) cmd: "
<< cmd0 << endl << *this);
- nextInset()->dispatch(*this, tmpcmd);
+ nextins->dispatch(*this, tmpcmd);
if (disp_.dispatched()) {
endUndoGroup();
return;
// store some values to be used inside of the handlers
beforeDispatchCursor_ = *this;
for (; depth(); pop(), boundary(false)) {
- LYXERR(Debug::DEBUG, "Cursor::dispatch: cmd: "
+ LYXERR(Debug::ACTION, "Cursor::dispatch: cmd: "
<< cmd0 << endl << *this);
// In any of these cases, the cursor is invalid, and we should
// it completely to get a 'bomb early' behaviour in case this
// object will be used again.
if (!disp_.dispatched()) {
- LYXERR(Debug::DEBUG, "RESTORING OLD CURSOR!");
+ LYXERR(Debug::ACTION, "RESTORING OLD CURSOR!");
// We might have invalidated the cursor when removing an empty
// paragraph while the cursor could not be moved out the inset
// while we initially thought we could. This might happen when
}
+void Cursor::setClickPos(int x, int y)
+{
+ x_clickpos_ = x;
+ y_clickpos_ = y;
+}
+
+
bool Cursor::selHandle(bool selecting)
{
//lyxerr << "Cursor::selHandle" << endl;
bool keep_mathmode = user_macro
|| (it != words.end() && (it->second.inset == "font"
|| it->second.inset == "oldfont"
+ || it->second.inset == "textsize"
|| it->second.inset == "mbox"));
bool ert_macro = !user_macro && it == words.end() && atomAsMacro;
plainErase();
cell().insert(pos(), ar);
resetAnchor();
- } else {
- //formula()->mutateToText();
}
}
// try to find best position within this inset
if (!selection())
setCursor(bruteFind(*this, xo, yo));
+ // FIXME : this is actually only needed for InsetMathMacro (bug #12952).
+ screenUpdateFlags(Update::SinglePar);
return true;
}
if (updateNeeded)
forceBufferUpdate();
}
- return valid_destination;
+ return false;
}
// with and without selection are handled differently