🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.4bsd
Article #1085

Another VI bug...

#1085
From: Dan Ts'o
Date: Sun, 24 Jul 1988 05:20
30 lines
1516 bytes
	I think I found another VI bug. Sorry if its an oldie, although it
certainly isn't fixed in 4.3BSD.

If you're editing a file and the edit cursor is currently somewhere in the
middle of the file, and you then wish to include the contents of another file,
appending it to the end of the buffer by,

:$r file2

	The file2 contents are appended correctly. If you then change your mind
and type 'u' to undo that read command, VI will delete the appropriate number
of lines -- HOWEVER, not from the end, but from where your cursor currently is.
That is, VI attempts to undo the read command by the correct number of lines,
but ends up deleting those lines from the middle of your buffer, rather than
the lines you read in.
	The problem seems to be that the undo code normally saves the state
prior to any text-changing command, including the position of the cursor.
However, when performing the

:$r files2

	the undo code should really save $ as the position of the cursor.

				Cheers,
				Dan Ts'o		212-570-7671
				Dept. Neurobiology	dan@rna.rockefeller.edu
				Rockefeller Univ.	...cmcl2!rna!dan
				1230 York Ave.		rna!dan@nyu.edu
				NY, NY 10021		tso@rockefeller.edu
Technical Details
Message-ID: <179@rna.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!ucbvax!husc6!cmcl2!rna!dan

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!ucbvax!husc6!cmcl2!rna!dan
From: dan@rna.UUCP (Dan Ts'o)
Newsgroups: comp.bugs.4bsd,comp.bugs.misc
Subject: Another VI bug...
Keywords: vi bug
Message-ID: <179@rna.UUCP>
Date: 24 Jul 88 05:20:02 GMT
Organization: Rockefeller University - Neurobiology
Lines: 30