aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-07-25 19:02:39 +0800
committerGitHub <noreply@github.com>2023-07-25 19:02:39 +0800
commitc0fa721adeabf1d93ad71e598782b52c43d8e8f7 (patch)
tree178af9fe18fbecf902606f25daccab6a0c2d666f /src
parent7668f89d5be6d463bf6ab0c2d3a0393e3ec26e7f (diff)
downloadrneovim-c0fa721adeabf1d93ad71e598782b52c43d8e8f7.tar.gz
rneovim-c0fa721adeabf1d93ad71e598782b52c43d8e8f7.tar.bz2
rneovim-c0fa721adeabf1d93ad71e598782b52c43d8e8f7.zip
fix(startup): make recovery mode work without --headless (#24477)
Diffstat (limited to 'src')
-rw-r--r--src/nvim/main.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c
index 567d364284..377b804661 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -305,6 +305,16 @@ int main(int argc, char **argv)
}
}
+ if (GARGCOUNT > 0) {
+ 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;
+ }
+
#ifdef MSWIN
// on windows we use CONIN special file, thus we don't know this yet.
bool has_term = true;
@@ -336,16 +346,6 @@ int main(int argc, char **argv)
ui_client_channel_id = rv;
}
- if (GARGCOUNT > 0) {
- 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) {