leave formula when pressing end at the end of a formula (and similarly

'home' at the beginning)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4700 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-07-18 10:07:20 +00:00
parent d242ff53eb
commit 31d1ab96b6
3 changed files with 10 additions and 8 deletions

View File

@ -481,7 +481,7 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
sel = true;
case LFUN_HOME:
mathcursor->home(sel);
result = mathcursor->home(sel) ? DISPATCHED : FINISHED;
updateLocal(bv, false);
break;
@ -489,7 +489,7 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
sel = true;
case LFUN_END:
mathcursor->end(sel);
result = mathcursor->end(sel) ? DISPATCHED : FINISHED_RIGHT;
updateLocal(bv, false);
break;

View File

@ -292,27 +292,29 @@ void MathCursor::setPos(int x, int y)
void MathCursor::home(bool sel)
bool MathCursor::home(bool sel)
{
dump("home 1");
autocorrect_ = false;
selHandle(sel);
macroModeClose();
if (!par()->idxHome(idx(), pos()))
popLeft();
return popLeft();
dump("home 2");
return true;
}
void MathCursor::end(bool sel)
bool MathCursor::end(bool sel)
{
dump("end 1");
autocorrect_ = false;
selHandle(sel);
macroModeClose();
if (!par()->idxEnd(idx(), pos()))
popRight();
return popRight();
dump("end 2");
return true;
}

View File

@ -74,9 +74,9 @@ public:
///
void backspace();
/// called for LFUN_HOME etc
void home(bool sel = false);
bool home(bool sel = false);
/// called for LFUN_END etc
void end(bool sel = false);
bool end(bool sel = false);
/// called for LFUN_RIGHT and LFUN_RIGHTSEL
bool right(bool sel = false);
/// called for LFUN_LEFT etc