Detecting words
Andrew Truckle <[email protected]> Fri, 17 Jan 2025 11:43:52 -0800 (PST)
| Newsgroups | gmane.comp.lib.scintilla.devel |
|---|---|
| Message-ID | <[email protected]> |
I am trying in OnCharAdded:
const auto pos = m_edit.GetCurrentPos();
const auto wordStart = m_edit.WordStartPosition(pos, true);
const auto prevWordStart = m_edit.WordStartPosition(wordStart - 1, true);
// Calculate the length of the text range
const auto rangeLength = pos - prevWordStart;
std::string text(rangeLength, '\0'); // Pre-allocate space for the text
Scintilla::TextRangeFull tr{ prevWordStart, pos, text.data() };
m_edit.GetTextRangeFull(&tr);
I can correct text the string for "xsl:". That is good. But if I then want
to test again the function names, eg I now have:
"<xsl:apply-templates "
So they just hit the space. If I run this code now the word retried is not
"apply-templates" but "templates". What is the right way to handle this? I
was hoping the show the parameter list for apply-templates. But because it
only gave me "templates" it fails.
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/scintilla-interest/7ee8460a-e13d-48e4-893c-19e2568b8cf7n%40googlegroups.com.