Actually, this probably isn't a bug, but a consequence of nvi/nex's unlimited undo feature. And unlimited undo has been around at least since the year I was born, so this is probably a non-issue. At most, it might be relevant to add something to https://man.openbsd.org/vi.1#STANDARDS about unlimited undo differing with POSIX vi and ye olde original vi.
My apologies for noise. On Fri, Jun 5, 2020 at 6:15 PM Andras Farkas <[email protected]> wrote: > > I'm working my way through > src/usr.bin/vi/docs/tutorial/vi.advanced > and I noticed the instructions in Section 33 don't work, or at least, > not as expected or described. > I installed vim to compare against OpenBSD's vi, nvi. In nvi, when > executing the long example line, it simply alternates between putting > "Line 26: line 9" above and below a certain line. > When using 'gvim -i NONE -u NONE -U NONE' (making sure vim is in > vi-compatible mode and using no .vimrc) I get the behavior described > in the tutorial: I get to see each of the earlier deleted lines appear > and disappear in decreasing order, seeing what was in all the numeric > buffers. > POSIX doesn't seem very clear on this, but this section seems to > support vim's vi-compatible behavior a little: > https://pubs.opengroup.org/onlinepubs/9699919799/utilities/vi.html#tag_20_152_13_35 > > The bug seems to be based around what vi decides the . command applies > to. Oddly enough, I don't see the u command in POSIX's list of what . > can repeat. This might not be a bug, but may be an intentional > deviation from old/POSIX behavior. If so, I'll simply re-work Section > 33 of the tutorial. > > If anyone has access to a System V vi, or any other vi's which aren't > nvi or vim, I'd be grateful to hear about how they behave.
