From bab5ef4d27add2bf11b57c555b2dc93892ec0e64 Mon Sep 17 00:00:00 2001 From: millert Date: Tue, 13 Apr 2021 15:34:41 +0000 Subject: [PATCH] Ignore expandtab setting when in command mode. Fixes things like searching for a literal tab character when expandtab is enabled. From nvi2 (leres). OK martijn@ --- usr.bin/vi/vi/v_txt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/vi/vi/v_txt.c b/usr.bin/vi/vi/v_txt.c index 31ea4cba57c..d2745aeddb2 100644 --- a/usr.bin/vi/vi/v_txt.c +++ b/usr.bin/vi/vi/v_txt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_txt.c,v 1.34 2020/04/30 10:40:21 millert Exp $ */ +/* $OpenBSD: v_txt.c,v 1.35 2021/04/13 15:34:41 millert Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -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; -- 2.20.1