#include <config.h>
#include "BufferView.h"
+#include "bufferview_funcs.h"
#include "buffer.h"
#include "cursor.h"
#include "coordcache.h"
#include "mathed/InsetMath.h"
#include "mathed/InsetMathScript.h"
#include "mathed/MathMacroTable.h"
-#include "mathed/MathParser.h"
#include "support/limited_stack.h"
{
BOOST_ASSERT(!empty());
//lyxerr << "Leaving inset to the right" << endl;
+ const pos_type lp = (depth() > 1) ? (*this)[depth() - 2].lastpos() : 0;
inset().notifyCursorLeaves(*this);
if (depth() == 1)
return false;
pop();
- ++pos();
+ pos() += lastpos() - lp + 1;
return true;
}
}
+Row const & LCursor::textRow() const
+{
+ ParagraphMetrics const & pm = bv().parMetrics(text(), pit());
+ BOOST_ASSERT(!pm.rows().empty());
+ return pm.getRow(pos(), boundary());
+}
+
+
void LCursor::resetAnchor()
{
anchor_ = *this;
}
-string LCursor::currentState()
+docstring LCursor::currentState()
{
if (inMathed()) {
odocstringstream os;
info(os);
- return to_utf8(os.str());
+ return os.str();
}
if (inTexted())
return text()->currentState(*this);
- return string();
+ return docstring();
}