mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Adding PARAGRAPH_MOVE_UP/DOWN + key bindings:
* src/LyXAction.C * src/text3.C * src/lfuns.h * lib/bind/cua.bind * lib/bind/sciword.bind * lib/bind/xemacs.bind * lib/bind/emacs.bind * lib/bind/mac.bind git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13752 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
71f356c372
commit
513ea10589
@ -102,6 +102,8 @@
|
||||
# Motion group
|
||||
#
|
||||
|
||||
\bind "M-Up" "paragraph-move-up"
|
||||
\bind "M-Down" "paragraph-move-down"
|
||||
\bind "C-Right" "word-forward"
|
||||
\bind "C-Left" "word-backward"
|
||||
\bind "C-Up" "paragraph-up"
|
||||
|
@ -139,6 +139,8 @@
|
||||
# Motion group
|
||||
#
|
||||
|
||||
\bind "M-Up" "paragraph-move-up"
|
||||
\bind "M-Down" "paragraph-move-down"
|
||||
\bind "C-Right" "word-forward"
|
||||
\bind "C-Left" "word-backward"
|
||||
\bind "C-Up" "paragraph-up"
|
||||
|
@ -176,6 +176,8 @@
|
||||
\bind "C-period" "end-of-sentence-period-insert"
|
||||
\bind "M-period" "dots-insert"
|
||||
\bind "Escape" "cancel"
|
||||
\bind "C-M-Up" "paragraph-move-up"
|
||||
\bind "C-M-Down" "paragraph-move-down"
|
||||
#\bind "F9" "meta-prefix"
|
||||
|
||||
|
||||
|
@ -216,6 +216,8 @@
|
||||
\bind_file greekkeys.bind
|
||||
|
||||
|
||||
\bind "M-Up" "paragraph-move-up"
|
||||
\bind "M-Down" "paragraph-move-down"
|
||||
\bind "S-KP_Right" "forward-select"
|
||||
\bind "S-KP_Left" "backward-select"
|
||||
\bind "S-KP_Up" "up-select"
|
||||
|
@ -144,6 +144,8 @@
|
||||
# Motion group
|
||||
#
|
||||
|
||||
\bind "M-Up" "paragraph-move-up"
|
||||
\bind "M-Down" "paragraph-move-down"
|
||||
\bind "C-Right" "word-forward"
|
||||
\bind "C-Left" "word-backward"
|
||||
\bind "C-Up" "paragraph-up"
|
||||
|
@ -356,6 +356,8 @@ void LyXAction::init()
|
||||
{ LFUN_MOUSE_RELEASE, "", ReadOnly },
|
||||
{ LFUN_MOUSE_DOUBLE, "", ReadOnly },
|
||||
{ LFUN_MOUSE_TRIPLE, "", ReadOnly },
|
||||
{ LFUN_PARAGRAPH_MOVE_DOWN, "paragraph-move-down", Noop },
|
||||
{ LFUN_PARAGRAPH_MOVE_UP, "paragraph-move-up", Noop },
|
||||
{ LFUN_NOACTION, "", Noop }
|
||||
};
|
||||
|
||||
|
@ -362,6 +362,9 @@ enum kb_action {
|
||||
LFUN_OUTLINE_DOWN,
|
||||
LFUN_OUTLINE_IN,
|
||||
LFUN_OUTLINE_OUT,
|
||||
// 275
|
||||
LFUN_PARAGRAPH_MOVE_DOWN, // Edwin 20060408
|
||||
LFUN_PARAGRAPH_MOVE_UP, // Edwin 20060408
|
||||
|
||||
LFUN_LASTACTION // end of the table
|
||||
};
|
||||
|
39
src/text3.C
39
src/text3.C
@ -44,6 +44,7 @@
|
||||
#include "ParagraphParameters.h"
|
||||
#include "undo.h"
|
||||
#include "vspace.h"
|
||||
#include "pariterator.h"
|
||||
|
||||
#include "frontends/Dialogs.h"
|
||||
#include "frontends/LyXView.h"
|
||||
@ -321,6 +322,34 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
|
||||
|
||||
switch (cmd.action) {
|
||||
|
||||
case LFUN_PARAGRAPH_MOVE_DOWN: {
|
||||
pit_type const pit = cur.pit();
|
||||
recUndo(pit, pit + 1);
|
||||
finishUndo();
|
||||
std::swap(pars_[pit], pars_[pit + 1]);
|
||||
++cur.pit();
|
||||
|
||||
ParIterator parit(cur);
|
||||
updateLabels(cur.buffer(), parit);
|
||||
|
||||
needsUpdate = true;
|
||||
break;
|
||||
}
|
||||
|
||||
case LFUN_PARAGRAPH_MOVE_UP: {
|
||||
pit_type const pit = cur.pit();
|
||||
recUndo(pit - 1, pit);
|
||||
finishUndo();
|
||||
std::swap(pars_[pit], pars_[pit - 1]);
|
||||
--cur.pit();
|
||||
|
||||
ParIterator parit(cur);
|
||||
updateLabels(cur.buffer(), parit);
|
||||
|
||||
needsUpdate = true;
|
||||
break;
|
||||
}
|
||||
|
||||
case LFUN_APPENDIX: {
|
||||
Paragraph & par = cur.paragraph();
|
||||
bool start = !par.params().startOfAppendix();
|
||||
@ -1777,6 +1806,16 @@ bool LyXText::getStatus(LCursor & cur, FuncRequest const & cmd,
|
||||
enable = lyx::cap::numberOfSelections() > 0;
|
||||
break;
|
||||
|
||||
case LFUN_PARAGRAPH_MOVE_UP: {
|
||||
enable = cur.pit() > 0 && !cur.selection();
|
||||
break;
|
||||
}
|
||||
|
||||
case LFUN_PARAGRAPH_MOVE_DOWN: {
|
||||
enable = cur.pit() < cur.lastpit() && !cur.selection();
|
||||
break;
|
||||
}
|
||||
|
||||
case LFUN_DELETE_WORD_FORWARD:
|
||||
case LFUN_DELETE_WORD_BACKWARD:
|
||||
case LFUN_DELETE_LINE_FORWARD:
|
||||
|
Loading…
Reference in New Issue
Block a user