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:
Edwin Leuven 2006-04-26 22:43:26 +00:00
parent 71f356c372
commit 513ea10589
8 changed files with 54 additions and 0 deletions

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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 }
};

View File

@ -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
};

View File

@ -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: