main.c: fix hang issue with recoverymode (#12496) (#12520)

In the case of recoverymode, the headlessmode was true, causing the UI
to hang without starting. Fix this problem by setting headlessmode to
true for List swap files only.

Co-authored-by: erw7 <erw7.github@gmail.com>
This commit is contained in:
James McCoy 2020-06-23 06:15:32 -04:00 committed by GitHub
parent ce3db4648a
commit e4629f203f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -285,6 +285,12 @@ int main(int argc, char **argv)
fname = get_fname(&params, cwd);
}
// Recovery mode without a file name: List swap files.
// In this case, no UI is needed.
if (recoverymode && fname == NULL) {
headless_mode = true;
}
TIME_MSG("expanding arguments");
if (params.diff_mode && params.window_count == -1)
@ -958,7 +964,6 @@ static void command_line_scan(mparm_T *parmp)
case 'r': // "-r" recovery mode
case 'L': { // "-L" recovery mode
recoverymode = 1;
headless_mode = true;
break;
}
case 's': {