diff --git a/src/buffer/katetextline.h b/src/buffer/katetextline.h --- a/src/buffer/katetextline.h +++ b/src/buffer/katetextline.h @@ -414,12 +414,12 @@ */ short attribute(int pos) const { - for (int i = 0; i < m_attributesList.size(); ++i) { - if (pos >= m_attributesList[i].offset && pos < (m_attributesList[i].offset + m_attributesList[i].length)) { - return m_attributesList[i].attributeValue; + for (const auto attr : m_attributesList) + { + if (pos >= attr.offset && pos < (attr.offset + attr.length)) { + return attr.attributeValue; } - - if (pos < m_attributesList[i].offset) { + if (pos < attr.offset) { break; } }