[comp.editors] vi range delete sometimes gets lost

les@chinet.chi.il.us (Leslie Mikesell) (03/27/91)

At seemingly random times when I delete a range of lines in vi using
the ex mode command :'a,.d
(delete from mark a through the cursor line), I can't move the deleted text 
with 'p' or 'P' to another location, although if I remember to do it
immediately 'u' will undo the deletion.   I never have this problem using
ndd to delete some number of lines, but I prefer to refer to ranges using
the "mark to cursor" notation.
Does anyone know why this happens or how to avoid it? 
(The vi in question is the one that comes with SysVr3).

Les Mikesell
  les@chinet.chi.il.us

wyle@inf.ethz.ch (Mitchell Wyle) (03/29/91)

In <1991Mar26.181950.3078@chinet.chi.il.us> 
les@chinet.chi.il.us (Leslie Mikesell) writes:
>At seemingly random times when I delete a range of lines in vi using
>the ex mode command :'a,.d
>(delete from mark a through the cursor line), I can't move the deleted text 
>with 'p' or 'P' to another location, although if I remember to do it
>immediately 'u' will undo the deletion.   I never have this problem using
>ndd to delete some number of lines, but I prefer to refer to ranges using
>the "mark to cursor" notation.
>Does anyone know why this happens or how to avoid it? 

Dunno why it happens, though sysVr3 vi is suspect.  The solution is
1) don't delete in ex mode; do it in visual mode as in

d`a

It saves you half the keystrokes.  2) To be safe, you might try

"ad`a

to but the deleted text in buffer a.

"Vi users do it visually."

markh@squirrel.LABS.TEK.COM (Mark C. Henderson) (03/31/91)

How about "1 through "9. Can the deleted text at least be
recovered from one of these?

Mark
--
       Mark C. Henderson, Computer Research Laboratory, Tektronix, Inc.
             MS 50-662, P.O. Box 500, Beaverton, OR 97077, U.S.A.
           INTERNET: markh@crl.labs.tek.com      MCI MAIL: 378-4996
     Tel: +1 503 627 6280  Fax: +1 503 627 5502  TELEX: 6503784996MCI UW

les@chinet.chi.il.us (Leslie Mikesell) (04/01/91)

In article <971@crl.LABS.TEK.COM> markh@squirrel.LABS.TEK.COM (Mark C. Henderson) writes:

>How about "1 through "9. Can the deleted text at least be
>recovered from one of these?

No, and any attempt to use them screws up the one way that I have been able
to recover (i.e. "undo" immediately after the failed "put").  After seeing
the posting by Dan Bloch though, I suspect this bug may be related and
perhaps the text would reappear in the numbered registers after doing
another simple operation.  I haven't been able to reproduce this on demand
so I'll have to wait till the next time it happens to find out.

Les Mikesell
  les@chinet.chi.il.us