Fix a crash reported in #7727. This happened because cur.pos() was reset before cur.pit(). In this case, cur.lastpos() will usually be wrong.
Fix bad behaviour when selecting at top level with several paragraphs.
Update documentation.
\end_layout
\begin_layout Date
-2014-10-23
+2014-11-14
\end_layout
\begin_layout Section*
inset-select-all
\end_layout
\begin_layout Description
-Action Selects all contents of an inset.
+Action Select all contents of an inset.
+\end_layout
+\begin_layout Description
+Notion There are 3 successive levels: select current cell, select all cells of inset, select the inset from outside (in the enclosing inset).
\end_layout
\begin_layout Description
Syntax inset-select-all
\end_layout
\begin_layout Description
-Origin vfr, 22 Aug 2009
+Origin vfr, 22 Aug 2009; lasgouttes 1 Nov 2014
\end_layout
\begin_layout Subsection*
section-select
\end_layout
\begin_layout Description
-Action Selects the whole section.
+Action Select the whole section.
\end_layout
\begin_layout Description
Notion The cursor should be in a section heading before calling this lfun.
cur.setSelection(true);
cur.posForward();
} else if (cur.selBegin().idx() != cur.selEnd().idx()
- || (cur.selBegin().at_cell_begin()
+ || (cur.depth() > 1
+ && cur.selBegin().at_cell_begin()
&& cur.selEnd().at_cell_end())) {
// At least one complete cell is selected.
// Select all cells
- cur.pos() = 0;
cur.idx() = 0;
+ cur.pos() = 0;
cur.resetAnchor();
cur.setSelection(true);
cur.idx() = cur.lastidx();
cur.pos() = cur.lastpos();
} else {
// select current cell
- cur.pos() = 0;
cur.pit() = 0;
+ cur.pos() = 0;
cur.resetAnchor();
cur.setSelection(true);
- cur.pos() = cur.lastpos();
cur.pit() = cur.lastpit();
+ cur.pos() = cur.lastpos();
}
dr.screenUpdate(Update::Force);
break;
/*!
* \var lyx::FuncCode lyx::LFUN_INSET_SELECT_ALL
- * \li Action: Selects all contents of an inset.
+ * \li Action: Select all contents of an inset.
+ * \li Notion: There are 3 successive levels: select current cell,
+ * select all cells of inset, select the inset from outside
+ * (in the enclosing inset).
* \li Syntax: inset-select-all
- * \li Origin: vfr, 22 Aug 2009
+ * \li Origin: vfr, 22 Aug 2009; lasgouttes 1 Nov 2014
* \endvar
*/
{ LFUN_INSET_SELECT_ALL, "inset-select-all", ReadOnly, Edit },
/*!
* \var lyx::FuncCode lyx::LFUN_SECTION_SELECT
- * \li Action: Selects the whole section.
+ * \li Action: Select the whole section.
* \li Notion: The cursor should be in a section heading
before calling this lfun.
* \li Syntax: section-select