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)
|
void BufferManager::set_last_used_buffer(Buffer& buffer)
|
||||||
{
|
{
|
||||||
auto it = m_buffers.begin();
|
auto it = find(m_buffers, &buffer);
|
||||||
while (*it != &buffer and it != m_buffers.end())
|
|
||||||
++it;
|
|
||||||
kak_assert(it != m_buffers.end());
|
kak_assert(it != m_buffers.end());
|
||||||
m_buffers.erase(it);
|
m_buffers.erase(it);
|
||||||
m_buffers.emplace(m_buffers.begin(), &buffer);
|
m_buffers.emplace(m_buffers.begin(), &buffer);
|
||||||
|
|
|
@ -198,8 +198,10 @@ void goto_commands(Context& context, NormalParams params)
|
||||||
auto it = buffer_manager.begin();
|
auto it = buffer_manager.begin();
|
||||||
if (it->get() == &buffer and ++it == buffer_manager.end())
|
if (it->get() == &buffer and ++it == buffer_manager.end())
|
||||||
break;
|
break;
|
||||||
|
Buffer& target = **it;
|
||||||
|
BufferManager::instance().set_last_used_buffer(buffer);
|
||||||
context.push_jump();
|
context.push_jump();
|
||||||
context.change_buffer(**it);
|
context.change_buffer(target);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'f':
|
case 'f':
|
||||||
|
|
Loading…
Reference in New Issue
Block a user