BufferManager: protect complete_buffername from regex_error
This commit is contained in:
parent
217b3d2bce
commit
4cdddb7e6d
|
@ -66,13 +66,17 @@ CandidateList BufferManager::complete_buffername(const String& prefix,
|
||||||
// no prefix completion found, check regex matching
|
// no prefix completion found, check regex matching
|
||||||
if (result.empty())
|
if (result.empty())
|
||||||
{
|
{
|
||||||
Regex ex(real_prefix.begin(), real_prefix.end());
|
try
|
||||||
for (auto& buffer : m_buffers)
|
|
||||||
{
|
{
|
||||||
const String& name = buffer->name();
|
Regex ex(real_prefix.begin(), real_prefix.end());
|
||||||
if (boost::regex_search(name.begin(), name.end(), ex))
|
for (auto& buffer : m_buffers)
|
||||||
result.push_back(name);
|
{
|
||||||
|
const String& name = buffer->name();
|
||||||
|
if (boost::regex_search(name.begin(), name.end(), ex))
|
||||||
|
result.push_back(name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
catch (boost::regex_error& err) {}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user