Try to improve ga behaviour
This commit is contained in:
parent
42966317b8
commit
92cb3a035f
|
@ -98,9 +98,7 @@ Buffer& BufferManager::get_buffer(StringView name)
|
|||
|
||||
void BufferManager::set_last_used_buffer(Buffer& buffer)
|
||||
{
|
||||
auto it = m_buffers.begin();
|
||||
while (*it != &buffer and it != m_buffers.end())
|
||||
++it;
|
||||
auto it = find(m_buffers, &buffer);
|
||||
kak_assert(it != m_buffers.end());
|
||||
m_buffers.erase(it);
|
||||
m_buffers.emplace(m_buffers.begin(), &buffer);
|
||||
|
|
|
@ -198,8 +198,10 @@ void goto_commands(Context& context, NormalParams params)
|
|||
auto it = buffer_manager.begin();
|
||||
if (it->get() == &buffer and ++it == buffer_manager.end())
|
||||
break;
|
||||
Buffer& target = **it;
|
||||
BufferManager::instance().set_last_used_buffer(buffer);
|
||||
context.push_jump();
|
||||
context.change_buffer(**it);
|
||||
context.change_buffer(target);
|
||||
break;
|
||||
}
|
||||
case 'f':
|
||||
|
|
Loading…
Reference in New Issue
Block a user