Skip to content

Commit

Permalink
main.c: fix hang issue with recoverymode (neovim#12496) (neovim#12520)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jamessan and erw7 committed Jun 23, 2020
1 parent ce3db46 commit e4629f2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/nvim/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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': {
Expand Down

0 comments on commit e4629f2

Please sign in to comment.