Reg Expr bugs in vi? - (nf)

chris at umcp-cs.UUCP chris at umcp-cs.UUCP
Mon Oct 3 14:31:02 AEST 1983


I think I've figured it out:

When you search for a string in VI, in order to ``guarantee'' that it
doesn't match the last-found version of the same string, vi attempts
to determine the first match on the current line; if the END of this
match is AT OR BEYOND the current cursor position (before the search
started) the match is discarded.  Thus:

	mississippi
	  ^
	cursor
/issi/ doesn't find the second "issi" (which overlaps the first "issi")
because it starts at the current line, finds "issi"; this goes over the
cursor position, so it searches for the next starting from AFTER the
issi!

The problem is, simply, that vi is a LINE EDITOR.  The most basic unit
is the LINE.  Occaisonally you get finer granularity, mostly from the
open/visual code.  The search code was probably hacked to make it look
like was character oriented; it's not.

(This bugs me no end when I ^Z and come back to find that my cursor is
now at the beginning of the line!)
-- 
Real:	Chris Torek, Univ of MD Comp Sci
UUCP:	{seismo,allegra,brl-bmd}!umcp-cs!chris
CSNet:	chris at umcp-cs
ARPA:	chris%umcp-cs at UDel-Relay



More information about the Comp.bugs.4bsd.ucb-fixes mailing list