Make posix line mode the default always.

This commit is contained in:
2026-09-13 13:15:07 +01:00
parent 3346bc9f83
commit d246559292
5 changed files with 46 additions and 48 deletions
+9 -9
View File
@@ -144,17 +144,17 @@ void Function::register_posix(BEd &ctx) {
vase::Shard *s = nullptr;
if (std::holds_alternative<std::filesystem::path>(arg)) {
auto path = std::get<std::filesystem::path>(arg);
s = vase::Shard::from_file(path, true);
s = vase::Shard::from_file(path);
buf.set_filename(path);
} else if (std::holds_alternative<ShellArg>(arg)) {
auto cmd = std::get<ShellArg>(arg).cmd;
ctx.escape_command(cmd, buf.filename().string());
s = vase::Shard::from_command(cmd.c_str(), true);
s = vase::Shard::from_command(cmd.c_str());
} else {
auto path = buf.filename();
if (path.empty())
throw ed_error("Need filename.");
s = vase::Shard::from_file(path, true);
s = vase::Shard::from_file(path);
};
try {
buf.load(ctx, s);
@@ -190,17 +190,17 @@ void Function::register_posix(BEd &ctx) {
vase::Shard *s = nullptr;
if (std::holds_alternative<std::filesystem::path>(arg)) {
auto path = std::get<std::filesystem::path>(arg);
s = vase::Shard::from_file(path, true);
s = vase::Shard::from_file(path);
buf.set_filename(path);
} else if (std::holds_alternative<ShellArg>(arg)) {
auto cmd = std::get<ShellArg>(arg).cmd;
ctx.escape_command(cmd, buf.filename().string());
s = vase::Shard::from_command(cmd.c_str(), true);
s = vase::Shard::from_command(cmd.c_str());
} else {
auto path = buf.filename();
if (path.empty())
throw ed_error("Need filename.");
s = vase::Shard::from_file(path, true);
s = vase::Shard::from_file(path);
};
try {
buf.load(ctx, s);
@@ -588,18 +588,18 @@ void Function::register_posix(BEd &ctx) {
vase::Shard *s = nullptr;
if (std::holds_alternative<std::filesystem::path>(arg)) {
auto path = std::get<std::filesystem::path>(arg);
s = vase::Shard::from_file(path, true);
s = vase::Shard::from_file(path);
if (buf.filename().empty())
buf.set_filename(path);
} else if (std::holds_alternative<ShellArg>(arg)) {
auto cmd = std::get<ShellArg>(arg).cmd;
ctx.escape_command(cmd, buf.filename().string());
s = vase::Shard::from_command(cmd.c_str(), true);
s = vase::Shard::from_command(cmd.c_str());
} else {
auto path = buf.filename();
if (path.empty())
throw ed_error("Need filename.");
s = vase::Shard::from_file(path, true);
s = vase::Shard::from_file(path);
};
try {
buf.append(ctx, s, addr.number);