When adding a TRACE() I see that that case is only called incidentally and /<tab> works for me as is. However, it still doesn't work when in command-mode (e.g. ":%s/<tab>/ /g" still requires ^V escape).
So either I'm not clear on which case this is trying to solve or it doesn't work as advertised. martijn@ On Tue, 2021-04-13 at 08:23 -0600, Todd C.Miller wrote: > Otherwise you can't search for a tab unless you ^V escape it. > > From nvi2: > https://github.com/lichray/nvi2/commit/0ef1c824648bcfe9f831a9607cb465b18e313d1d > > Index: vi/v_txt.c > =================================================================== > RCS file: /cvs/src/usr.bin/vi/vi/v_txt.c,v > retrieving revision 1.34 > diff -u -p -u -r1.34 v_txt.c > --- vi/v_txt.c 30 Apr 2020 10:40:21 -0000 1.34 > +++ vi/v_txt.c 13 Apr 2021 14:18:23 -0000 > @@ -1214,7 +1214,8 @@ leftmargin: tp->lb[tp->cno - 1] = ' '; > hexcnt = 1; > goto insq_ch; > case K_TAB: > - if (quote != Q_VTHIS && O_ISSET(sp, O_EXPANDTAB)) { > + if (sp->showmode != SM_COMMAND && quote != Q_VTHIS && > + O_ISSET(sp, O_EXPANDTAB)) { > if (txt_dent(sp, tp, O_TABSTOP, 1)) > goto err; > goto ebuf_chk; >
