mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Select the whole paragraph with tripple-left-click
Fixes #9175 Also added new function: paragraph-select.
This commit is contained in:
parent
f6f08f0c50
commit
e0f5641089
@ -484,6 +484,7 @@ enum FuncCode
|
||||
LFUN_SEARCH_IGNORE, // kornel, 20181115
|
||||
LFUN_BUFFER_WRITE_AS_TEMPLATE, // spitz, 20190323
|
||||
LFUN_TABULAR_STYLE_INSERT, // spitz, 20190325
|
||||
LFUN_PARAGRAPH_SELECT, // Kornel, 20190416
|
||||
LFUN_LASTACTION // end of the table
|
||||
};
|
||||
|
||||
|
@ -3251,6 +3251,15 @@ void LyXAction::init()
|
||||
*/
|
||||
{ LFUN_PARAGRAPH_UPDATE, "", Noop, Hidden },
|
||||
|
||||
/*!
|
||||
* \var lyx::FuncCode lyx::LFUN_PARAGRAPH_SELECT
|
||||
* \li Action: Move cursor to beginning of current paragraph
|
||||
and select to the end in downward direction
|
||||
* \li Syntax: paragraph-select
|
||||
* \li Origin: Kornel, 16 Apr 2019
|
||||
* \endvar
|
||||
*/
|
||||
{ LFUN_PARAGRAPH_SELECT, "paragraph-select", ReadOnly, Edit },
|
||||
|
||||
/*!
|
||||
* \var lyx::FuncCode lyx::LFUN_PARAGRAPH_UP_SELECT
|
||||
|
@ -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;
|
||||
}
|
||||
@ -3534,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:
|
||||
|
Loading…
Reference in New Issue
Block a user