The following LyX key bindings have been changed:
+- In LyX 2.1.3, the binding "C-a" was moved from selecting the whole
+ document to "inset-select-all". This function allows to select the
+ document in a incremental way. The old behavior is now bound to
+ "C-M-a".
+
- The binding "C-w" was moved from "buffer-close" to "view-close"
(only in cua.bind).
\bind "C-y" "redo"
\bind "C-S-Z" "redo"
-\bind "C-a" "command-sequence buffer-begin ; buffer-end-select" # select all
-\bind "C-M-a" "inset-select-all"
+\bind "C-M-a" "command-sequence buffer-begin ; buffer-end-select" # select all
+\bind "C-a" "inset-select-all"
\bind "C-S-E" "changes-track" # it's what MS Word uses
\bind "~S-M-quotedbl" "quote-insert single"
# +: "Shift-Command-4" # Capture a selection to a file
# +: "Shift-Control-Command-4" # Capture a selection to the Clipboard
# +: "Command-A" # Highlight every item in a document or window, or all characters in a text field
-\bind "C-a" "command-sequence buffer-begin ; buffer-end-select"
-\bind "C-M-a" "inset-select-all"
+\bind "C-M-a" "command-sequence buffer-begin ; buffer-end-select"
+\bind "C-a" "inset-select-all"
# +: "Command-B" # Boldface the selected text or toggle boldfaced text on and off
\bind "C-M-b" "font-boldsymbol"
\bind "C-b" "font-bold"
\bind "C-x" "cut"
\bind "C-z" "undo"
\bind "S-C-Z" "redo"
-\bind "C-a" "command-sequence buffer-begin ; buffer-end-select" # select all
+\bind "C-a" "inset-select-all"
+\bind "C-M-a" "command-sequence buffer-begin ; buffer-end-select" # select all
# This combination makes an umlaut accent now.
\end_layout
\begin_layout Date
-2014-02-13
+2014-11-20
\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.
case LFUN_KEYMAP_PRIMARY:
case LFUN_KEYMAP_SECONDARY:
case LFUN_KEYMAP_TOGGLE:
+ case LFUN_INSET_SELECT_ALL:
flag.setEnabled(true);
break;
}
+ case LFUN_INSET_SELECT_ALL:
+ if (cur.depth() > 1
+ && cur.selBegin().at_begin()
+ && cur.selEnd().at_end()) {
+ // All the contents of the inset if selected.
+ // Select the inset from outside.
+ cur.pop();
+ cur.resetAnchor();
+ cur.setSelection(true);
+ cur.posForward();
+ } else if (cur.selBegin().idx() != cur.selEnd().idx()
+ || (cur.depth() > 1
+ && cur.selBegin().at_cell_begin()
+ && cur.selEnd().at_cell_end())) {
+ // At least one complete cell is selected.
+ // Select all cells
+ cur.idx() = 0;
+ cur.pos() = 0;
+ cur.resetAnchor();
+ cur.setSelection(true);
+ cur.idx() = cur.lastidx();
+ cur.pos() = cur.lastpos();
+ } else {
+ // select current cell
+ cur.pit() = 0;
+ cur.pos() = 0;
+ cur.resetAnchor();
+ cur.setSelection(true);
+ cur.pit() = cur.lastpit();
+ cur.pos() = cur.lastpos();
+ }
+ dr.screenUpdate(Update::Force);
+ break;
+
+
// This would be in Buffer class if only Cursor did not
// require a bufferview
case LFUN_INSET_FORALL: {
}
-bool CursorSlice::at_end() const
+bool CursorSlice::at_cell_end() const
{
- return idx_ == lastidx() && pit_ == lastpit() && pos_ == lastpos();
+ return pit_ == lastpit() && pos_ == lastpos();
+}
+
+
+bool CursorSlice::at_cell_begin() const
+{
+ return pit_ == 0 && pos_ == 0;
+}
+
+
+bool CursorSlice::at_end() const
+{
+ return idx_ == lastidx() && at_cell_end();
}
bool CursorSlice::at_begin() const
{
- return idx_ == 0 && pit_ == 0 && pos_ == 0;
+ return idx_ == 0 && at_cell_begin();
}
void forwardIdx();
/// move to previous cell
void backwardIdx();
+ /// are we at the end of the cell
+ bool at_cell_end() const;
+ /// are we at the start of the cell
+ bool at_cell_begin() const;
/// are we at the end of this slice
bool at_end() const;
/// are we at the start of this slice
/*!
* \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
cur.screenUpdateFlags(Update::FitCursor);
break;
- case LFUN_INSET_SELECT_ALL:
- if (cur.depth() == 1 || !cur.selection() || !cur.selBegin().at_begin()
- || !cur.selEnd().at_end()) {
- needsUpdate |= cur.selHandle(false);
- needsUpdate |= cursorTop(cur);
- needsUpdate |= cur.selHandle(true);
- needsUpdate |= cursorBottom(cur);
- } else
- cur.undispatched();
- cur.screenUpdateFlags(Update::FitCursor);
- break;
-
case LFUN_CHAR_FORWARD:
case LFUN_CHAR_FORWARD_SELECT:
//LYXERR0(" LFUN_CHAR_FORWARD[SEL]:\n" << cur);
case LFUN_INSET_END:
case LFUN_INSET_BEGIN_SELECT:
case LFUN_INSET_END_SELECT:
- case LFUN_INSET_SELECT_ALL:
case LFUN_PARAGRAPH_UP:
case LFUN_PARAGRAPH_DOWN:
case LFUN_LINE_BEGIN:
case LFUN_MOUSE_DOUBLE:
case LFUN_MOUSE_TRIPLE:
case LFUN_WORD_SELECT:
- case LFUN_INSET_SELECT_ALL:
cur.pos() = 0;
cur.idx() = 0;
cur.resetAnchor();
* USER INTERFACE
-- Debug options in message pane are now sorted alphabetically.
-
- References no longer truncated in outliner (bug 9312).
- Allow computing selected subformulas with computer algebra systems.
- Number correctly footnotes in title layouts (part of bug 2666).
+- Ctrl+A is now bound to inset-select-all, which does a local
+ selection (current inset) and grows at each new invokation. Try it!
+
+- Debug options in message pane are now sorted alphabetically.
+
* DOCUMENTATION AND LOCALIZATION
- New example file "PDF-comment.lyx" describing the support for PDF annotations.