Fix a few bugs.

- Moving lines after themselves didnt work.
- moving empty lines deleted them.
- "w" didnt set state to unmodified in generic buffers.
- in "hl" aligned the numbers (by digits)
This commit is contained in:
2026-09-11 22:35:06 +01:00
parent a8d51dc0b6
commit 3346bc9f83
11 changed files with 31 additions and 15 deletions
+2 -2
View File
@@ -416,8 +416,7 @@ void Function::register_posix(BEd &ctx) {
auto addr = std::get<buffer::Range>(addr_);
auto arg = std::get<buffer::Line>(arg_);
if (arg.buffername == addr.buffername
&& addr.start <= arg.number
&& addr.end < arg.number)
&& arg.number >= addr.start && arg.number < addr.end)
throw ed_error("Can't move lines within themselves.");
auto text = ctx.buffer(addr.buffername).copy(addr.start, addr.end);
ctx.mark(252, arg);
@@ -757,6 +756,7 @@ void Function::register_posix(BEd &ctx) {
vase::Shard::release(text);
throw;
}
buf.saved_hook();
if (!ctx.suppress_mode)
ctx.io.write(std::format("{}\n", text ? text->length + 1 : 0));
}