switch (cmd.action) {
- case LFUN_ESCAPE: {
- if (bv_->cursor().depth() > 1) {
- bv_->cursor().pop();
- // Tell the paragraph dialog that we changed paragraph
- dispatch(FuncRequest(LFUN_PARAGRAPH_UPDATE));
- }
- break;
- }
-
case LFUN_UNDO:
if (available()) {
cur.message(_("Undo"));
* text3.C: fixed LFUN_QUOTE and add lfun arguments single/double.
+2004-02-20 André Pönitz <poenitz@gmx.net>
+
+ * dispatchresult.h: rename 'FINISHED' to 'FINISHED_LEFT'
+
+ * cursor.[Ch]: prepare for localized getStatus()
+
+ * lyxtext.h:
+ * tabular.C:
+ * text.C:
+ * text2.C:
+ * text3.C: streamlines the LyXText cursor movement handlers a bit.
+
+
2004-02-20 André Pönitz <poenitz@gmx.net>
* lyxfunc.[Ch]: rename view_status_message() to viewStatusMessage()
// the inset handled the event fully
current_ = cursor_.size() - 1;
return DispatchResult(true, true);
- case FINISHED:
+ case FINISHED_LEFT:
// the inset handled the event partially
cmd = FuncRequest(LFUN_FINISHED_LEFT);
break;
}
+bool LCursor::getStatus(FuncRequest const & cmd, FuncStatus & status)
+{
+ lyxerr << "\nLCursor::getStatus: cmd: " << cmd << endl << *this << endl;
+ BOOST_ASSERT(pos() <= lastpos());
+ BOOST_ASSERT(idx() <= lastidx());
+ BOOST_ASSERT(par() <= lastpar());
+ for (current_ = cursor_.size() - 1; current_ >= 1; --current_) {
+ // the inset's getStatus() will return 'true' if it made
+ // a definitive decision on whether it want to handle the
+ // request or not. The result of this decision is put into
+ // the 'status' parameter.
+ bool const res = inset()->getStatus(*this, cmd, status);
+ if (res) {
+ current_ = cursor_.size() - 1;
+ return true;
+ }
+ }
+ BOOST_ASSERT(current_ == 0);
+ bool const res = bv_->text()->getStatus(*this, cmd, status);
+ current_ = cursor_.size() - 1;
+ return res;
+}
+
+
void LCursor::push(InsetBase * inset)
{
lyxerr << "LCursor::push() inset: " << inset << endl;
// Go back so that replacement string is also spellchecked
for (string::size_type i = 0; i < replacestring.length() + 1; ++i)
- t->cursorLeft(*this, true);
+ t->cursorLeft(*this);
}
class UpdatableInset;
class MathAtom;
class DispatchResult;
+class FuncStatus;
class FuncRequest;
class InsetTabular;
class LyXText;
explicit LCursor(BufferView & bv);
/// dispatch from innermost inset upwards
DispatchResult dispatch(FuncRequest const & cmd);
+ /// are we willing to handle this event?
+ bool getStatus(FuncRequest const & cmd, FuncStatus & flag);
+
/// add a new cursor slice
void push(InsetBase * inset);
/// add a new cursor slice, place cursor on left end
#define DISPATCH_RESULT_H
/** Dispatch result codes
- DISPATCHED = the inset caught the action
- DISPATCHED_NOUPDATE = the inset caught the action and no update
- is needed to redraw the inset
- FINISHED = the inset must be unlocked as a result
- of the action
+ NONE = no special action required
+ FINISHED_LEFT = the cursor leaves the inset to the LEFT
+ as consequence of this action
FINISHED_RIGHT = FINISHED, but move the cursor RIGHT from
the inset.
FINISHED_UP = FINISHED, but move the cursor UP from
the inset.
FINISHED_DOWN = FINISHED, but move the cursor DOWN from
the inset.
- FINISHED_POP = FINISHED, but move the cursor out the inset
- (possibly more than one level)
- UNDISPATCHED = the action was not caught, it should be
- dispatched by lower level insets
*/
enum dispatch_result_t {
NONE = 0,
- FINISHED,
+ FINISHED_LEFT,
FINISHED_RIGHT,
FINISHED_UP,
FINISHED_DOWN
}
+bool InsetBase::getStatus(LCursor &, FuncRequest const &, FuncStatus &)
+{
+ return false;
+}
+
+
void InsetBase::edit(LCursor &, bool)
{
lyxerr << "InsetBase: edit left/right" << std::endl;
class CursorSlice;
class DispatchResult;
class FuncRequest;
+class FuncStatus;
class LaTeXFeatures;
class LCursor;
class LyXLex;
// the real dispatcher
void dispatch(LCursor & cur, FuncRequest const & cmd);
+ /// do we want to handle this event?
+ virtual bool getStatus(LCursor & cur, FuncRequest const & cmd,
+ FuncStatus & status);
/// cursor enters
virtual void edit(LCursor & cur, bool left);
case LFUN_RIGHTSEL:
case LFUN_RIGHT:
cell(cur.idx()).dispatch(cur, cmd);
+ cur.dispatched(NONE); // override the cell's result
if (sl == cur.current())
isRightToLeft(cur) ? movePrevCell(cur) : moveNextCell(cur);
if (sl == cur.current())
case LFUN_LEFTSEL:
case LFUN_LEFT:
cell(cur.idx()).dispatch(cur, cmd);
+ cur.dispatched(NONE); // override the cell's result
if (sl == cur.current())
isRightToLeft(cur) ? moveNextCell(cur) : movePrevCell(cur);
if (sl == cur.current())
- cur.dispatched(FINISHED);
+ cur.dispatched(FINISHED_LEFT);
break;
case LFUN_DOWNSEL:
case LFUN_DOWN:
cell(cur.idx()).dispatch(cur, cmd);
+ cur.dispatched(NONE); // override the cell's result
if (sl == cur.current())
if (tabular.row_of_cell(cur.idx()) != tabular.rows() - 1) {
cur.idx() = tabular.getCellBelow(cur.idx());
case LFUN_UPSEL:
case LFUN_UP:
cell(cur.idx()).dispatch(cur, cmd);
+ cur.dispatched(NONE); // override the cell's result
if (sl == cur.current())
if (tabular.row_of_cell(cur.idx()) != 0) {
cur.idx() = tabular.getCellAbove(cur.idx());
class InsetBase;
class InsetOld_code;
class FuncRequest;
+class FuncStatus;
class LColor_color;
class LCursor;
class LyXTextClass;
int dist(int x, int y) const;
/// try to handle that request
- DispatchResult dispatch(LCursor & cur, FuncRequest const & cmd);
+ void dispatch(LCursor & cur, FuncRequest const & cmd);
+ /// do we want to handle this event?
+ bool getStatus(LCursor & cur, FuncRequest const & cmd, FuncStatus & status);
+
/// access to out BufferView. This should go...
BufferView * bv();
/// access to out BufferView. This should go...
///
InsetBase * editXY(LCursor & cur, int x, int y);
///
- void cursorUp(LCursor & cur, bool selecting = false);
+ void cursorUp(LCursor & cur);
///
- void cursorDown(LCursor & cur, bool selecting = false);
+ void cursorDown(LCursor & cur);
///
- bool cursorLeft(LCursor & cur, bool internal = true);
+ void cursorLeft(LCursor & cur);
///
- bool cursorRight(LCursor & cur, bool internal = true);
+ void cursorRight(LCursor & cur);
///
void cursorLeftOneWord(LCursor & cur);
///
std::string getPossibleLabel(LCursor & cur) const;
/// is this paragraph right-to-left?
bool isRTL(Paragraph const & par) const;
-
- ///
- DispatchResult moveRight(LCursor & cur);
- ///
- DispatchResult moveLeft(LCursor & cur);
- ///
- DispatchResult moveRightIntern(LCursor & cur, bool front,
- bool activate_inset, bool selecting);
- ///
- DispatchResult moveLeftIntern(LCursor & cur, bool front,
- bool activate_inset, bool selecting);
- ///
- DispatchResult moveUp(LCursor & cur);
- ///
- DispatchResult moveDown(LCursor & cur);
///
bool checkAndActivateInset(LCursor & cur, bool front);
void MathGridInset::splitCell(LCursor & cur)
{
- if (cur.idx() + 1 == nargs())
+ if (cur.idx() == cur.lastidx())
return;
MathArray ar = cur.cell();
ar.erase(0, cur.pos());
cur.idx() = cur.lastpos();
//mathcursor->normalize();
- cur.dispatched(FINISHED);
+ cur.dispatched(FINISHED_LEFT);
return;
}
cur.notdispatched();
return;
}
- lyxerr << "returning DispatchResult(true, FINISHED)" << endl;
+ lyxerr << "returning FINISHED_LEFT" << endl;
return;
}
case LFUN_LEFT:
cur.selHandle(cmd.action == LFUN_LEFTSEL);
if (!cur.left())
- cur.dispatched(FINISHED);
+ cur.dispatched(FINISHED_LEFT);
break;
case LFUN_UPSEL:
case LFUN_WORDLEFT:
cur.selHandle(cmd.action == LFUN_WORDLEFTSEL);
if (!cur.home())
- cur.dispatched(FINISHED);
+ cur.dispatched(FINISHED_LEFT);
break;
case LFUN_WORDRIGHTSEL:
case LFUN_HOME:
cur.selHandle(cmd.action == LFUN_HOMESEL);
if (!cur.home())
- cur.dispatched(FINISHED_RIGHT);
+ cur.dispatched(FINISHED_LEFT);
break;
case LFUN_ENDSEL:
case LFUN_PRIOR:
case LFUN_BEGINNINGBUFSEL:
case LFUN_BEGINNINGBUF:
- cur.dispatched(FINISHED);
+ cur.dispatched(FINISHED_LEFT);
break;
case LFUN_NEXTSEL:
case LFUN_DELETE:
//recordUndo(cur, Undo::ATOMIC);
cur.erase();
- cur.dispatched(FINISHED);
+ cur.dispatched(FINISHED_LEFT);
break;
case LFUN_ESCAPE:
if (cur.selection())
cur.selClear();
else
- cur.dispatched(FINISHED);
+ cur.dispatched(FINISHED_LEFT);
break;
case LFUN_INSET_TOGGLE:
{
int ret = 0;
int cell = getCellNumber(i, 0);
- BufferParams const & bufferparams = buf.params();
ret += TeXTopHLine(os, i);
for (int j = 0; j < columns_; ++j) {
if (cur.pos() != 0 && cur.textRow().pos() == cur.pos()
&& !cpit->isNewline(cur.pos() - 1))
{
- cursorLeft(cur, true);
+ cursorLeft(cur);
}
while (!next_par->empty() && next_par->isNewline(0))
{
BOOST_ASSERT(this == cur.text());
if (cur.lastpos() == 0)
- cursorRight(cur, true);
+ cursorRight(cur);
else {
cur.resetAnchor();
cur.selection() = true;
{
BOOST_ASSERT(this == cur.text());
if (cur.lastpos() == 0)
- cursorLeft(cur, true);
+ cursorLeft(cur);
else {
cur.resetAnchor();
cur.selection() = true;
BOOST_ASSERT(this == cur.text());
if (cur.lastpos() == 0) {
// Paragraph is empty, so we just go to the right
- cursorRight(cur, true);
+ cursorRight(cur);
} else {
cur.resetAnchor();
cur.selection() = true; // to avoid deletion
void LyXText::Delete(LCursor & cur)
{
BOOST_ASSERT(this == cur.text());
- // this is a very simple implementation
- // just move to the right
- // if you had success make a backspace
- size_t oldpar = cur.par();
- if (cursorRight(cur, true)) {
- recordUndo(cur, Undo::DELETE, oldpar);
+ // just move to the right, if we had success make a backspace
+ CursorSlice sl = cur.current();
+ cursorRight(cur);
+ if (sl == cur.current()) {
+ recordUndo(cur, Undo::DELETE, cur.par(), max(0, cur.par() - 1));
backspace(cur);
}
}
// handle the actual deletion of the paragraph.
if (cur.par() != 0) {
- cursorLeft(cur, true);
+ cursorLeft(cur);
// the layout things can change the height of a row !
redoParagraph(cur);
return;
// and fails if the cursor is behind the inset and getInset
// does not return the inset!
if (isHighlyEditableInset(inset))
- cursorLeft(cur, true);
+ cursorLeft(cur);
unFreezeUndo();
}
return;
cur.resetAnchor();
while (length--)
- cursorRight(cur, true);
+ cursorRight(cur);
cur.setSelection();
}
bool LyXText::checkAndActivateInset(LCursor & cur, bool front)
{
+ if (cur.selection())
+ return false;
if (cur.pos() == cur.lastpos())
return false;
InsetBase * inset = cur.nextInset();
}
-DispatchResult LyXText::moveRight(LCursor & cur)
-{
- if (isRTL(cur.paragraph()))
- return moveLeftIntern(cur, false, true, false);
- else
- return moveRightIntern(cur, true, true, false);
-}
-
-
-DispatchResult LyXText::moveLeft(LCursor & cur)
-{
- if (isRTL(cur.paragraph()))
- return moveRightIntern(cur, true, true, false);
- else
- return moveLeftIntern(cur, false, true, false);
-}
-
-
-DispatchResult LyXText::moveRightIntern(LCursor & cur,
- bool front, bool activate_inset, bool selecting)
-{
- if (cur.par() == cur.lastpar() && cur.pos() == cur.lastpos())
- return DispatchResult(false, FINISHED_RIGHT);
- if (activate_inset && checkAndActivateInset(cur, front))
- return DispatchResult(true, true);
- cursorRight(cur, true);
- if (!selecting)
- cur.clearSelection();
- return DispatchResult(true);
-}
-
-
-DispatchResult LyXText::moveLeftIntern(LCursor & cur,
- bool front, bool activate_inset, bool selecting)
-{
- if (cur.par() == 0 && cur.pos() == 0)
- return DispatchResult(false, FINISHED);
- cursorLeft(cur, true);
- if (!selecting)
- cur.clearSelection();
- if (activate_inset && checkAndActivateInset(cur, front))
- return DispatchResult(true, true);
- return DispatchResult(true);
-}
-
-
-DispatchResult LyXText::moveUp(LCursor & cur)
-{
- if (cur.par() == 0 && cur.crow() == 0)
- return DispatchResult(false, FINISHED_UP);
- cursorUp(cur, false);
- cur.clearSelection();
- return DispatchResult(true);
-}
-
-
-DispatchResult LyXText::moveDown(LCursor & cur)
-{
- if (cur.par() == cur.lastpar() && cur.textRow().endpos() == cur.lastpos())
- return DispatchResult(false, FINISHED_DOWN);
- cursorDown(cur, false);
- cur.clearSelection();
- return DispatchResult(true);
-}
-
-
-bool LyXText::cursorLeft(LCursor & cur, bool internal)
+void LyXText::cursorLeft(LCursor & cur)
{
if (cur.pos() != 0) {
bool boundary = cur.boundary();
setCursor(cur, cur.par(), cur.pos() - 1, true, false);
- if (!internal && !boundary &&
- bidi.isBoundary(*bv()->buffer(), cur.paragraph(), cur.pos() + 1))
- setCursor(cur, cur.par(), cur.pos() + 1, true, true);
- return true;
+ if (!checkAndActivateInset(cur, false)) {
+ if (false && !boundary &&
+ bidi.isBoundary(*bv()->buffer(), cur.paragraph(), cur.pos() + 1))
+ setCursor(cur, cur.par(), cur.pos() + 1, true, true);
+ return;
+ }
}
if (cur.par() != 0) {
// steps into the paragraph above
setCursor(cur, cur.par() - 1, getPar(cur.par() - 1)->size());
- return true;
}
-
- return false;
}
-bool LyXText::cursorRight(LCursor & cur, bool internal)
+void LyXText::cursorRight(LCursor & cur)
{
- if (!internal && cur.boundary()) {
+ if (false && cur.boundary()) {
setCursor(cur, cur.par(), cur.pos(), true, false);
- return true;
+ return;
}
if (cur.pos() != cur.lastpos()) {
- setCursor(cur, cur.par(), cur.pos() + 1, true, false);
- if (!internal && bidi.isBoundary(*bv()->buffer(), cur.paragraph(),
- cur.pos()))
- setCursor(cur, cur.par(), cur.pos(), true, true);
- return true;
+ if (!checkAndActivateInset(cur, true)) {
+ setCursor(cur, cur.par(), cur.pos() + 1, true, false);
+ if (false && bidi.isBoundary(*bv()->buffer(), cur.paragraph(),
+ cur.pos()))
+ setCursor(cur, cur.par(), cur.pos(), true, true);
+ }
+ return;
}
- if (cur.par() != cur.lastpar()) {
+ if (cur.par() != cur.lastpar())
setCursor(cur, cur.par() + 1, 0);
- return true;
- }
-
- return false;
}
-void LyXText::cursorUp(LCursor & cur, bool selecting)
+void LyXText::cursorUp(LCursor & cur)
{
Row const & row = cur.textRow();
int x = cur.x_target();
int y = cursorY(cur.current()) - row.baseline() - 1;
setCursorFromCoordinates(cur, x, y);
- if (!selecting) {
+ if (!cur.selection()) {
InsetBase * inset_hit = checkInsetHit(cur.x_target(), y);
if (inset_hit && isHighlyEditableInset(inset_hit))
inset_hit->editXY(cur, cur.x_target(), y);
}
-void LyXText::cursorDown(LCursor & cur, bool selecting)
+void LyXText::cursorDown(LCursor & cur)
{
Row const & row = cur.textRow();
int x = cur.x_target();
int y = cursorY(cur.current()) - row.baseline() + row.height() + 1;
setCursorFromCoordinates(cur, x, y);
- if (!selecting) {
+ if (!cur.selection()) {
InsetBase * inset_hit = checkInsetHit(cur.x_target(), y);
if (inset_hit && isHighlyEditableInset(inset_hit))
inset_hit->editXY(cur, cur.x_target(), y);
if (cpar == cur.par() && cpos == cur.pos()) {
// we have a row which is taller than the workarea. The
// simplest solution is to move to the previous row instead.
- cursorUp(cur, true);
+ cursorUp(cur);
}
bv()->updateScrollbar();
if (cpar == cur.par() && cpos == cur.pos()) {
// we have a row which is taller than the workarea. The
// simplest solution is to move to the next row instead.
- cursorDown(cur, true);
+ cursorDown(cur);
}
bv()->updateScrollbar();
}
-DispatchResult LyXText::dispatch(LCursor & cur, FuncRequest const & cmd)
+void LyXText::dispatch(LCursor & cur, FuncRequest const & cmd)
{
lyxerr[Debug::ACTION] << "LyXText::dispatch: cmd: " << cmd << endl;
//lyxerr << "*** LyXText::dispatch: cmd: " << cmd << endl;
BufferView * bv = &cur.bv();
+ CursorSlice sl = cur.current();
switch (cmd.action) {
finishChange(cur);
break;
+ case LFUN_RIGHT:
case LFUN_RIGHTSEL:
- if (!cur.selection())
- cur.resetAnchor();
+ cur.selHandle(cmd.action == LFUN_RIGHTSEL);
if (isRTL(cur.paragraph()))
- cursorLeft(cur, true);
+ cursorLeft(cur);
else
- cursorRight(cur, true);
- finishChange(cur, true);
+ cursorRight(cur);
+ if (sl == cur.current())
+ cur.dispatched(FINISHED_RIGHT);
break;
+ case LFUN_LEFT:
case LFUN_LEFTSEL:
- if (!cur.selection())
- cur.resetAnchor();
+ cur.selHandle(cmd.action == LFUN_LEFTSEL);
if (isRTL(cur.paragraph()))
- cursorRight(cur, true);
+ cursorRight(cur);
else
- cursorLeft(cur, true);
- finishChange(cur, true);
+ cursorLeft(cur);
+ if (sl == cur.current())
+ cur.dispatched(FINISHED_LEFT);
break;
+ case LFUN_UP:
case LFUN_UPSEL:
- if (!cur.selection())
- cur.resetAnchor();
- cursorUp(cur, true);
- finishChange(cur, true);
+ cur.selHandle(cmd.action == LFUN_UPSEL);
+ cursorUp(cur);
+ if (sl == cur.current())
+ cur.dispatched(FINISHED_UP);
break;
+ case LFUN_DOWN:
case LFUN_DOWNSEL:
- if (!cur.selection())
- cur.resetAnchor();
- cursorDown(cur, true);
- finishChange(cur, true);
+ cur.selHandle(cmd.action == LFUN_DOWNSEL);
+ cursorDown(cur);
+ if (sl == cur.current())
+ cur.dispatched(FINISHED_DOWN);
break;
case LFUN_UP_PARAGRAPHSEL:
break;
}
- case LFUN_RIGHT:
- finishChange(cur);
- return moveRight(cur);
-
- case LFUN_LEFT:
- finishChange(cur);
- return moveLeft(cur);
-
- case LFUN_UP:
- finishChange(cur);
- return moveUp(cur);
-
- case LFUN_DOWN:
- finishChange(cur);
- return moveDown(cur);
-
case LFUN_UP_PARAGRAPH:
if (!cur.mark())
cur.clearSelection();
cur.clearSelection();
finishChange(cur, false);
if (cur.par() == 0 && cur.textRow().pos() == 0)
- return DispatchResult(false, FINISHED_UP);
- cursorPrevious(cur);
+ cur.dispatched(FINISHED_UP);
+ else
+ cursorPrevious(cur);
break;
case LFUN_NEXT:
finishChange(cur, false);
if (cur.par() == cur.lastpar()
&& cur.textRow().endpos() == cur.lastpos())
- return DispatchResult(false, FINISHED_DOWN);
- cursorNext(cur);
+ cur.dispatched(FINISHED_DOWN);
+ else
+ cursorNext(cur);
break;
case LFUN_HOME:
// Reverse the effect of LFUN_BREAKPARAGRAPH_SKIP.
if (!cur.selection()) {
if (cur.pos() == cur.lastpos()) {
- cursorRight(cur, true);
- cursorLeft(cur, true);
+ cursorRight(cur);
+ cursorLeft(cur);
}
Delete(cur);
cur.resetAnchor();
case LFUN_INSET_TOGGLE:
cur.clearSelection();
if (!toggleInset(cur))
- return DispatchResult(false);
- cur.update();
- bv->switchKeyMap();
+ cur.notdispatched();
+ else
+ bv->switchKeyMap();
break;
case LFUN_SPACE_INSERT:
break;
case LFUN_BEGINNINGBUFSEL:
- if (in_inset_)
- return DispatchResult(false);
- if (!cur.selection())
- cur.resetAnchor();
- cursorTop(cur);
- finishChange(cur, true);
+ if (in_inset_) {
+ cur.notdispatched();
+ } else {
+ if (!cur.selection())
+ cur.resetAnchor();
+ cursorTop(cur);
+ finishChange(cur, true);
+ }
break;
case LFUN_ENDBUFSEL:
- if (in_inset_)
- return DispatchResult(false);
- if (!cur.selection())
- cur.resetAnchor();
- cursorBottom(cur);
- finishChange(cur, true);
+ if (in_inset_) {
+ cur.notdispatched();
+ } else {
+ if (!cur.selection())
+ cur.resetAnchor();
+ cursorBottom(cur);
+ finishChange(cur, true);
+ }
break;
case LFUN_GETXY:
// FIXME: shouldn't be top-text-specific
if (!in_inset_ && cur.current() == old) {
if (cmd.y - bv->top_y() >= bv->workHeight())
- cursorDown(cur, true);
+ cursorDown(cur);
else if (cmd.y - bv->top_y() < 0)
- cursorUp(cur, true);
+ cursorUp(cur);
}
// don't set anchor_
case LFUN_MOUSE_RELEASE: {
// do nothing if we used the mouse wheel
if (cmd.button() == mouse_button::button4
- || cmd.button() == mouse_button::button5)
- return DispatchResult(true, false);
+ || cmd.button() == mouse_button::button5) {
+ cur.notdispatched();
+ break;
+ }
selection_possible = false;
lyxerr << "handle LFUN_FINISHED_LEFT" << endl;
cur.pop(cur.currentDepth());
if (isRTL(cur.paragraph()))
- cursorLeft(cur, true);
+ cursorLeft(cur);
cur.bv().cursor() = cur;
break;
lyxerr << "handle LFUN_FINISHED_RIGHT" << endl;
cur.pop(cur.currentDepth());
if (!isRTL(cur.paragraph()))
- cursorRight(cur, true);
+ cursorRight(cur);
cur.bv().cursor() = cur;
break;
case LFUN_FINISHED_UP:
lyxerr << "handle LFUN_FINISHED_UP" << endl;
cur.pop(cur.currentDepth());
- cursorUp(cur, true);
+ cursorUp(cur);
cur.bv().cursor() = cur;
break;
case LFUN_FINISHED_DOWN:
lyxerr << "handle LFUN_FINISHED_DOWN" << endl;
cur.pop(cur.currentDepth());
- cursorDown(cur, true);
+ cursorDown(cur);
cur.bv().cursor() = cur;
break;
breakParagraph(cur);
if (cur.lastpos() != 0) {
- cursorLeft(cur, true);
+ cursorLeft(cur);
breakParagraph(cur);
}
break;
}
+ case LFUN_ESCAPE:
+ if (cur.selection())
+ cur.selection() = false;
+ else
+ cur.dispatched(FINISHED_LEFT);
+ break;
+
default:
- return DispatchResult(false);
+ cur.notdispatched();
+ break;
}
+}
+
- return DispatchResult(true, true);
+bool LyXText::getStatus(LCursor &, FuncRequest const &, FuncStatus &)
+{
+ return false;
}