| 34 | } |
| 35 | |
| 36 | SyntaxResult ZepSyntax::GetSyntaxAt(const GlyphIterator& offset) const |
| 37 | { |
| 38 | Zep::SyntaxResult result; |
| 39 | |
| 40 | Wait(); |
| 41 | |
| 42 | if (m_processedChar < offset.Index() || (long)m_syntax.size() <= offset.Index()) |
| 43 | { |
| 44 | return result; |
| 45 | } |
| 46 | |
| 47 | result.background = m_syntax[offset.Index()].background; |
| 48 | result.foreground = m_syntax[offset.Index()].foreground; |
| 49 | result.underline = m_syntax[offset.Index()].underline; |
| 50 | |
| 51 | bool found = false; |
| 52 | for (auto& adorn : m_adornments) |
| 53 | { |
| 54 | auto adornResult = adorn->GetSyntaxAt(offset, found); |
| 55 | if (found) |
| 56 | { |
| 57 | result = adornResult; |
| 58 | break; |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | return result; |
| 63 | } |
| 64 | |
| 65 | void ZepSyntax::Wait() const |
| 66 | { |
no test coverage detected