nvi2 icon indicating copy to clipboard operation
nvi2 copied to clipboard

Cannot insert blank line in global insert mode

Open mohd-akram opened this issue 1 year ago • 3 comments

To reproduce:

$ cat file
enum
$ printf '%s\n' 'g/enum/i\' '\' '.' '%p' | nvi -e file

Expected output:


enum

Actual output:

enum

The correct behavior is observed in ed and classic vi/ex (tested on OpenIndiana 2024.04).

mohd-akram avatar Jul 06 '24 18:07 mohd-akram

The debugger leads me to https://github.com/lichray/nvi2/blob/52c07e84df713c967568b610294aa1d3f5b3f38a/ex/ex_append.c#L110-L147 Is this document relevant?

lichray avatar Jul 09 '24 03:07 lichray

Yes, somewhat, I think this is just a bug. A possible fix is to just remove the if (t != p || len == 0) check (I suggested it to the nvi maintainers to validate it), but it seems correct.

mohd-akram avatar Jul 12 '24 14:07 mohd-akram

This has been fixed upstream - https://repo.or.cz/nvi.git/commitdiff/957906b0e3bcc0f795cf8c6b7313fcc4ec338784

mohd-akram avatar Dec 29 '24 12:12 mohd-akram