Cursor position after paste

wwp subscript at free.fr
Wed Nov 28 15:12:56 CET 2007


Hello Tony,


On Wed, 28 Nov 2007 13:54:49 +0100 Tony Balinski <ajbj at free.fr> wrote:

> Quoting wwp <subscript at free.fr>:
> 
> > Hello there,
> >
> >
> > I wonder, is there a way NOT to move the cursor position after a paste?
> > I mean, when you paste something, the cursor moves to after the pasted
> > block. I'd like to (optionally or not) keep the cursor at the position
> > where I pasted, instead. Is it possible?
> 
> Well, the cursor can logically be either at the end or at the beginning
> of the pasted block. You can do what you want with a macro, I suppose, eg
> 
>   s = get_selection("any")
>   replace_range($cursor, $cursor, s)
> 
> which you can then bind to a keystroke. (It'll beep if there is no
> selection around.) With some X resource jiggerypokery you could invoke
> it from a mouse event too.

The power of macros, thanks for suggesting :-).

On another hand, I've found that I need such pasting behaviour in very
specific conditions, like inserting at the same column in different
several lines. For instance, inserting a word after ':' on every line
that follows:

context1: context2
context2: context3
context3: context3
->
context1: foo context2
context2: foo context3
context3: foo context3

the default paste behaviour WRT cursor placement in mcedit and vi
allows this to be done w/o having to change the cursor horizontal
placement, making the sequence easier and quicker. CTRL+V, DOWN-ARROW,
CTRL+V, DOWN-ARROW, etc. instead of CTRL+V, move N times left or jump
word left, DOWN-ARROW, etc.

But.. what I've found is that NEdit's paste column feature does it,
provided that I have a single-line text in clipboard and no selected
text. Isn't that perfect!


Regards,

-- 
wwp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.nedit.org/pipermail/discuss/attachments/20071128/4bf406c1/signature.bin


More information about the Discuss mailing list