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:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user