From 77306b7e24e2b6afaacb4319a021a99b38c73ad2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Thu, 30 Aug 2001 10:17:28 +0000 Subject: [PATCH] Make Shift-End and Shift-Pos1 work as expected git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2629 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/formulabase.C | 12 ++++++++---- src/mathed/math_cursor.C | 6 ++++-- src/mathed/math_cursor.h | 4 ++-- src/mathed/math_parser.C | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index e55f403642..5caf393738 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -412,13 +412,19 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action, updateLocal(bv, false); break; + case LFUN_HOMESEL: + sel = true; + case LFUN_HOME: - mathcursor->home(); + mathcursor->home(sel); updateLocal(bv, false); break; + case LFUN_ENDSEL: + sel = true; + case LFUN_END: - mathcursor->end(); + mathcursor->end(sel); updateLocal(bv, false); break; @@ -492,8 +498,6 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action, mathcursor->selCopy(); break; - case LFUN_HOMESEL: - case LFUN_ENDSEL: case LFUN_WORDRIGHTSEL: case LFUN_WORDLEFTSEL: break; diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index a5086ffba6..fee51f6ff3 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -368,9 +368,10 @@ void MathCursor::setPos(int x, int y) } -void MathCursor::home() +void MathCursor::home(bool sel) { dump("home 1"); + selHandle(sel); macroModeClose(); lastcode_ = LM_TC_VAR; if (!par()->idxHome(idx(), pos())) @@ -379,9 +380,10 @@ void MathCursor::home() } -void MathCursor::end() +void MathCursor::end(bool sel) { dump("end 1"); + selHandle(sel); macroModeClose(); lastcode_ = LM_TC_VAR; if (!par()->idxEnd(idx(), pos())) diff --git a/src/mathed/math_cursor.h b/src/mathed/math_cursor.h index 90519bec17..65d83ba2f2 100644 --- a/src/mathed/math_cursor.h +++ b/src/mathed/math_cursor.h @@ -73,9 +73,9 @@ public: /// void backspace(); /// - void home(); + void home(bool sel = false); /// - void end(); + void end(bool sel = false); /// bool right(bool sel = false); /// diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index 168a438bdf..42256d2fbc 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -439,7 +439,7 @@ void Parser::tokenize(string const & buffer) } } -#if 1 +#if 0 lyxerr << "\nTokens: "; for (unsigned i = 0; i < tokens_.size(); ++i) lyxerr << tokens_[i]; -- 2.39.2