Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!pbox!okstate!gregg From: gregg@a.cs.okstate.edu (Gregg Wonderly) Newsgroups: comp.os.vms Subject: Re: TPUVI Bug Message-ID: <2728@okstate.UUCP> Date: Wed, 21-Oct-87 15:28:25 EST Article-I.D.: okstate.2728 Posted: Wed Oct 21 15:28:25 1987 Date-Received: Mon, 26-Oct-87 05:56:07 EST References: <8710201014.AA04165@ucbvax.Berkeley.EDU> Organization: Oklahoma State Univ., Stillwater Lines: 42 in article <8710201014.AA04165@ucbvax.Berkeley.EDU>, VAUGHAN@CANISIUS.BITNET (Tom Vaughan @ Computer Center) says: > > I have put up TPU-VI and have encountered a problem: > > using the global substitution command > :g/targetstring/s//replace string/g > > The VI editor goes into an infinite tail spin giving me > that "Line Length at Maximum, Can't Insert Characters" type of message. > You can't break out with ctrl-y or ctrl-c, luckily we are on a PBX > and can disconnect. > You are the second person that I have heard of that uses :g/targetstring/s//replace string/g as opposed to the more obvious :%s/targetstring/replace string/g TPU VI is not attempting to use any special techniques here for determining that the source string of the 's' command is null, so it should use the string from the global command. The global command only identifies a line to act on. The substitute command is then applied to that line. What you are experiencing is TPU always matching a null pattern, and then inserting the 'replace string', thus lengthening the line forever. The simple workaround is to use the second notation given above. I have made TPU VI compatible with this notation, but it was not obvious to me that it should have worked that way. ----- Gregg Wonderly Department of Mathematics Oklahoma State University UUCP: {cbosgd, ihnp4, rutgers}!okstate!nemo.math.okstate.edu!gregg ARPA: gregg@NEMO.MATH.OKSTATE.EDU