Preserve selections across reloads
This commit is contained in:
parent
73ddf18dc3
commit
cf7b64ba67
|
@ -173,12 +173,8 @@ void Client::reload_buffer()
|
||||||
{
|
{
|
||||||
auto& buffer = context().buffer();
|
auto& buffer = context().buffer();
|
||||||
kak_assert(buffer.flags() & Buffer::Flags::File);
|
kak_assert(buffer.flags() & Buffer::Flags::File);
|
||||||
CharCoord view_pos = context().window().position();
|
|
||||||
ByteCoord cursor_pos = context().selections().main().cursor();
|
|
||||||
Buffer* buf = create_buffer_from_file(buffer.name());
|
Buffer* buf = create_buffer_from_file(buffer.name());
|
||||||
kak_assert(buf == &buffer);
|
kak_assert(buf == &buffer);
|
||||||
context().selections_write_only() = SelectionList{buffer, buffer.clamp(cursor_pos)};
|
|
||||||
context().window().set_position(view_pos);
|
|
||||||
context().print_status({ "'" + buffer.display_name() + "' reloaded",
|
context().print_status({ "'" + buffer.display_name() + "' reloaded",
|
||||||
get_face("Information") });
|
get_face("Information") });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user