From 7b5cbfd6d624e19ac296089b3d675b20bda429a4 Mon Sep 17 00:00:00 2001 From: Alison Winters Date: Sun, 4 Apr 2021 08:30:16 -0700 Subject: vi: allow writing to another file if this one is readonly Version 2. Same change but rebased after Ron's improvements. Fixes bug where if you open a read only file, you can't save it as a different filename. function old new delta colon 3160 3162 +2 Signed-off-by: Alison Winters Signed-off-by: Denys Vlasenko --- editors/vi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editors/vi.c b/editors/vi.c index fb46dc381..31b5d3e8a 100644 --- a/editors/vi.c +++ b/editors/vi.c @@ -2938,7 +2938,7 @@ static void colon(char *buf) fn = args; } # if ENABLE_FEATURE_VI_READONLY - if (readonly_mode && !useforce) { + else if (readonly_mode && !useforce) { status_line_bold("'%s' is read only", fn); goto ret; } -- cgit v1.2.3