[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lyx-devel
Subject:    Re: feature request
From:       Jean-Marc Lasgouttes <lasgouttes () lyx ! org>
Date:       2006-04-26 8:39:42
Message-ID: liyodyo20j5.fsf () fantomas ! inria ! fr
[Download RAW message or body]

>>>>> "Edwin" == Edwin Leuven <e.leuven@uva.nl> writes:

Edwin> and nr 12... can this go in, or shall i ditch it? 

I'd say it can go in.

Adding bindings to mac.bind, xemacs.bind and sciword.bind (if they do
not conflict) would be a bonus.

JMarc

Edwin> Index: src/LyXAction.C
Edwin> ===================================================================
Edwin> --- src/LyXAction.C (revision 13740) +++ src/LyXAction.C
Edwin> (working copy) @@ -353,6 +353,8 @@ { LFUN_MOUSE_RELEASE, "",
Edwin> ReadOnly }, { LFUN_MOUSE_DOUBLE, "", ReadOnly }, {
Edwin> LFUN_MOUSE_TRIPLE, "", ReadOnly }, + {
Edwin> LFUN_PARAGRAPH_MOVE_DOWN, "paragraph-move-down", Noop }, + {
Edwin> LFUN_PARAGRAPH_MOVE_UP, "paragraph-move-up", Noop }, {
Edwin> LFUN_NOACTION, "", Noop } };
 
Edwin> Index: src/text3.C
Edwin> ===================================================================
Edwin> --- src/text3.C (revision 13740) +++ src/text3.C (working copy)
Edwin> @@ -44,6 +44,7 @@ #include "ParagraphParameters.h" #include
Edwin> "undo.h" #include "vspace.h" +#include "pariterator.h"
 
Edwin>  #include "frontends/Dialogs.h" #include "frontends/LyXView.h"
Edwin> @@ -321,6 +322,34 @@
 
Edwin>  	switch (cmd.action) {
 
Edwin> + case LFUN_PARAGRAPH_MOVE_DOWN: { + pit_type const pit =
Edwin> cur.pit(); + recUndo(pit, pit + 1); + finishUndo(); +
Edwin> std::swap(pars_[pit], pars_[pit + 1]); + ++cur.pit();
Edwin> +
Edwin> + ParIterator parit(cur); + updateLabels(cur.buffer(), parit);
Edwin> +
Edwin> + needsUpdate = true; + break;
Edwin> +	}
Edwin> +
Edwin> + case LFUN_PARAGRAPH_MOVE_UP: { + pit_type const pit =
Edwin> cur.pit(); + recUndo(pit - 1, pit); + finishUndo(); +
Edwin> std::swap(pars_[pit], pars_[pit - 1]); + --cur.pit();
Edwin> +
Edwin> + ParIterator parit(cur); + updateLabels(cur.buffer(), parit);
Edwin> +
Edwin> + needsUpdate = true; + break;
Edwin> +	}
Edwin> +
Edwin>  	case LFUN_APPENDIX: { Paragraph & par =
Edwin> cur.paragraph(); bool start = !par.params().startOfAppendix();
Edwin> @@ -1777,6 +1806,16 @@ enable = lyx::cap::numberOfSelections()
Edwin> > 0; break;
 
Edwin> + case LFUN_PARAGRAPH_MOVE_UP: { + enable = cur.pit() > 0 &&
Edwin> !cur.selection(); + break;
Edwin> +	}
Edwin> +
Edwin> + case LFUN_PARAGRAPH_MOVE_DOWN: { + enable = cur.pit() <
Edwin> cur.lastpit() && !cur.selection(); + break;
Edwin> +	}
Edwin> +
Edwin>  	case LFUN_DELETE_WORD_FORWARD: case
Edwin> LFUN_DELETE_WORD_BACKWARD: case LFUN_DELETE_LINE_FORWARD:
Edwin> Index: src/lfuns.h
Edwin> ===================================================================
Edwin> --- src/lfuns.h (revision 13740) +++ src/lfuns.h (working copy)
Edwin> @@ -358,6 +358,9 @@ LFUN_BIBDB_DEL, LFUN_INSERT_CITATION,
Edwin> LFUN_OUTLINE, // Vermeer 20060323 + // 275 +
Edwin> LFUN_PARAGRAPH_MOVE_DOWN, // Edwin 20060408 +
Edwin> LFUN_PARAGRAPH_MOVE_UP, // Edwin 20060408
 
Edwin>  	LFUN_LASTACTION // end of the table }; Index:
Edwin> lib/bind/cua.bind
Edwin> ===================================================================
Edwin> --- lib/bind/cua.bind (revision 13740) +++ lib/bind/cua.bind
Edwin> (working copy) @@ -102,6 +102,8 @@ # Motion group #
 
Edwin> +\bind "M-Up" "paragraph-move-up" +\bind "M-Down"
Edwin> "paragraph-move-down" \bind "C-Right" "word-forward" \bind
Edwin> "C-Left" "word-backward" \bind "C-Up" "paragraph-up" Index:
Edwin> lib/bind/emacs.bind
Edwin> ===================================================================
Edwin> --- lib/bind/emacs.bind (revision 13740) +++
Edwin> lib/bind/emacs.bind (working copy) @@ -139,6 +139,8 @@ # Motion
Edwin> group #
 
Edwin> +\bind "M-Up" "paragraph-move-up" +\bind "M-Down"
Edwin> "paragraph-move-down" \bind "C-Right" "word-forward" \bind
Edwin> "C-Left" "word-backward" \bind "C-Up" "paragraph-up"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic