mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 19:14:51 +00:00
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:
parent
d242ff53eb
commit
31d1ab96b6
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user