Skip to content

Commit

Permalink
:sp[lit] and :vs[plit] should only create new file when file name…
Browse files Browse the repository at this point in the history
… specified (#8733)

Fixes #8730
  • Loading branch information
bcho authored Nov 22, 2023
1 parent 86676db commit 6097424
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/cmd_line/commands/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,15 @@ function getLegacyArgs(args: IFileCommandArguments): LegacyArgs {
return {
file: args.file,
position: FilePosition.NewWindowHorizontalSplit,
createFileIfNotExists: true,
// only to create if file arg is specified
createFileIfNotExists: args.file !== undefined,
};
} else if (args.name === 'vsplit') {
return {
file: args.file,
position: FilePosition.NewWindowVerticalSplit,
createFileIfNotExists: true,
// only to create if file arg is specified
createFileIfNotExists: args.file !== undefined,
};
} else {
throw new Error(`Unexpected FileCommand.arguments.name: ${args.name}`);
Expand Down

0 comments on commit 6097424

Please sign in to comment.