X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FText3.cpp;h=7e24041cef7f7918aa64dd6341970f44b8e613ea;hb=1e519d1115f41f71c253cb9e2fbb7803e9a583a9;hp=aa527d1c0545c3c06cfbb78d8dd4ce5c84e98d39;hpb=f609a4717fbdf5e2a5eeb1cf08feb16f8ecca7c5;p=lyx.git diff --git a/src/Text3.cpp b/src/Text3.cpp index aa527d1c05..7e24041cef 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -927,6 +927,14 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) break; } + case LFUN_PARAGRAPH_SELECT: + if (cur.pos() > 0) + needsUpdate |= setCursor(cur, cur.pit(), 0); + needsUpdate |= cur.selHandle(true); + if (cur.pos() < cur.lastpos()) + needsUpdate |= setCursor(cur, cur.pit(), cur.lastpos()); + break; + case LFUN_PARAGRAPH_UP: case LFUN_PARAGRAPH_UP_SELECT: needsUpdate |= cur.selHandle(cmd.action() == LFUN_PARAGRAPH_UP_SELECT); @@ -1762,9 +1770,12 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) case LFUN_MOUSE_TRIPLE: if (cmd.button() == mouse_button::button1) { - tm->cursorHome(cur); + if (cur.pos() > 0) + setCursor(cur, cur.pit(), 0); + bv->cursor() = cur; cur.resetAnchor(); - tm->cursorEnd(cur); + if (cur.pos() < cur.lastpos()) + setCursor(cur, cur.pit(), cur.lastpos()); cur.setSelection(); bv->cursor() = cur; } @@ -2126,30 +2137,27 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) cur.recordUndo(); FuncRequest cmd2(LFUN_FILE_INSERT, tabstyle.absFileName() + " ignorelang"); lyx::dispatch(cmd2); + // go into table + cur.backwardPos(); if (r > 2) { - // go into table - cur.backwardPos(); // move one cell up to middle cell cur.up(); - // now add the missing rows and columns + // add the missing rows int const addrows = r - 3; - int const addcols = c - 1; for (int i = 0 ; i < addrows ; ++i) { FuncRequest fr(LFUN_TABULAR_FEATURE, "append-row"); lyx::dispatch(fr); } - for (int i = 0 ; i < addcols ; ++i) { - FuncRequest fr(LFUN_TABULAR_FEATURE, "append-column"); - lyx::dispatch(fr); - } + } + // add the missing columns + int const addcols = c - 1; + for (int i = 0 ; i < addcols ; ++i) { + FuncRequest fr(LFUN_TABULAR_FEATURE, "append-column"); + lyx::dispatch(fr); + } + if (r > 1) // go to first cell cur.up(); - } else { - // jump over table - cur.backwardChar(); - // go to first cell - cur.forwardPos(); - } break; } @@ -3537,6 +3545,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd, case LFUN_UP_SELECT: case LFUN_DOWN: case LFUN_DOWN_SELECT: + case LFUN_PARAGRAPH_SELECT: case LFUN_PARAGRAPH_UP_SELECT: case LFUN_PARAGRAPH_DOWN_SELECT: case LFUN_LINE_BEGIN_SELECT: