From fe5f05f037ce0f4c2431b319e86cb080c3cc4658 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 12 Sep 2021 10:33:18 +0200 Subject: [PATCH] files: give the user time to absorb a warning about someone else editing That is: pause a little to jolt the user, and then leave the message on the status bar. This fixes https://savannah.gnu.org/bugs/?61147. Bug existed since version 4.8, commit 416386ed. --- src/files.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/files.c b/src/files.c index 000c4b5b..60b5f53f 100644 --- a/src/files.c +++ b/src/files.c @@ -245,9 +245,11 @@ char *do_lockfile(const char *filename, bool ask_the_user) free(secondcopy); free(namecopy); - if (!ask_the_user && stat(lockfilename, &fileinfo) != -1) - warn_and_briefly_pause(_("Someone else is also editing this file")); - else if (stat(lockfilename, &fileinfo) != -1) { + if (!ask_the_user && stat(lockfilename, &fileinfo) != -1) { + blank_bottombars(); + statusline(ALERT, _("Someone else is also editing this file")); + napms(1200); + } else if (stat(lockfilename, &fileinfo) != -1) { char *lockbuf, *question, *pidstring, *postedname, *promptstr; static char lockprog[11], lockuser[17]; int lockfd, lockpid, choice;