From 99fb5f2144fc30337ec2ece3d1f59ba92ebed5fb Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Tue, 6 Apr 2021 13:44:36 +0100 Subject: vi: issue a warning on failure to find a character When a search for a character within a line fails issue a warning. function old new delta ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0) Total: 0 bytes Signed-off-by: Ron Yorston Signed-off-by: Denys Vlasenko --- editors/vi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'editors') diff --git a/editors/vi.c b/editors/vi.c index 4fda6aebf..96e6af318 100644 --- a/editors/vi.c +++ b/editors/vi.c @@ -1809,8 +1809,10 @@ static void dot_to_char(int cmd) do { do { q += dir; - if ((dir == FORWARD ? q > end - 1 : q < text) || *q == '\n') + if ((dir == FORWARD ? q > end - 1 : q < text) || *q == '\n') { + indicate_error(); return; + } } while (*q != last_search_char); } while (--cmdcnt > 0); -- cgit v1.2.3