diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index a54c32e82e..f33b0f8012 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -942,6 +942,8 @@ FuncStatus BufferView::Pimpl::getStatus(FuncRequest const & cmd) case LFUN_MARK_ON: case LFUN_SETMARK: case LFUN_CENTER: + case LFUN_BEGINNINGBUF: + case LFUN_ENDBUF: case LFUN_BEGINNINGBUFSEL: case LFUN_ENDBUFSEL: flag.enabled(true); diff --git a/src/mathed/math_nestinset.C b/src/mathed/math_nestinset.C index 341faf7d41..0f946e5724 100644 --- a/src/mathed/math_nestinset.C +++ b/src/mathed/math_nestinset.C @@ -542,15 +542,11 @@ void MathNestInset::priv_dispatch(LCursor & cur, FuncRequest & cmd) case LFUN_PRIORSEL: case LFUN_PRIOR: - case LFUN_BEGINNINGBUFSEL: - case LFUN_BEGINNINGBUF: cmd = FuncRequest(LFUN_FINISHED_LEFT); break; case LFUN_NEXTSEL: case LFUN_NEXT: - case LFUN_ENDBUFSEL: - case LFUN_ENDBUF: cmd = FuncRequest(LFUN_FINISHED_RIGHT); break; diff --git a/src/text3.C b/src/text3.C index dd6b10244a..6b9213a9da 100644 --- a/src/text3.C +++ b/src/text3.C @@ -454,18 +454,26 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) finishChange(cur, false); break; - case LFUN_BEGINNINGBUF: - if (!cur.mark()) - cur.clearSelection(); - cursorTop(cur); - finishChange(cur, false); + case LFUN_BEGINNINGBUF: + if (cur.size() == 1) { + if (!cur.mark()) + cur.clearSelection(); + cursorTop(cur); + finishChange(cur, false); + } else { + cur.undispatched(); + } break; case LFUN_ENDBUF: - if (!cur.mark()) - cur.clearSelection(); - cursorBottom(cur); - finishChange(cur, false); + if (cur.size() == 1) { + if (!cur.mark()) + cur.clearSelection(); + cursorBottom(cur); + finishChange(cur, false); + } else { + cur.undispatched(); + } break; case LFUN_RIGHT: @@ -1827,8 +1835,6 @@ bool LyXText::getStatus(LCursor & cur, FuncRequest const & cmd, case LFUN_DELETE_LINE_FORWARD: case LFUN_WORDRIGHT: case LFUN_WORDLEFT: - case LFUN_ENDBUF: - case LFUN_BEGINNINGBUF: case LFUN_RIGHT: case LFUN_RIGHTSEL: case LFUN_LEFT: @@ -1937,6 +1943,11 @@ bool LyXText::getStatus(LCursor & cur, FuncRequest const & cmd, enable = true; break; + case LFUN_ENDBUF: + case LFUN_BEGINNINGBUF: + enable = true; + break; + default: enable = false; break;