VI - Bug or feature?????

Peter da Silva peter at ficc.UUCP
Tue Jul 26 01:47:51 AEST 1988


In article <394 at piring.cwi.nl>, hansm at cwi.nl (Hans Mulder) writes:
> I agree with you that this behaviour is incorrect.  But I am afraid it is
> not easy to repair.  The cause of the problem seems to be that vi is based
> on a line editor (ex, a derivative of ed).  Ex has this routine that finds
> all non-overlapping matches on the current line, which is very handy for the
> :s/pat/repl/g command, but not quite what vi should have borrowed.

I disagree. This behaviour is correct. I have used an editor on the PC
that does what you suggest -- terminate closures with the shortest match --
and it's very irritating. You can't emulate long closures with a short
closure regular expression, but you can do the opposite -- emulate short
closures with a long closure RE. It's almost always better to use the
more general method.
-- 
Peter da Silva  `-_-'  Ferranti International Controls Corporation.
"Have you hugged  U  your wolf today?" (uunet,tness1)!sugar!ficc!peter.



More information about the Comp.unix.questions mailing list