MCPcopy Create free account
hub / github.com/Rezonality/zep / GetSyntaxAt

Method GetSyntaxAt

src/syntax.cpp:36–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36SyntaxResult 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
65void ZepSyntax::Wait() const
66{

Callers 3

DisplayLineBackgroundMethod · 0.45
DisplayLineMethod · 0.45
NotifyMethod · 0.45

Calls 2

IndexMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected