1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-12-27 21:53:21 +03:00

Fix crash in Context::main_sel_register_value

This commit is contained in:
Maxime Coste 2014-06-23 13:16:51 +01:00
parent 352228c3b0
commit b934c8ede5

View File

@ -231,7 +231,7 @@ StringView Context::main_sel_register_value(StringView reg) const
{
auto strings = RegisterManager::instance()[reg].values(*this);
size_t index = m_selections ? (*m_selections).main_index() : 0;
if (strings.size() < index)
if (strings.size() <= index)
index = strings.size() - 1;
return strings[index];
}