Re: Detecting words
Andrew Truckle <[email protected]> Sat, 18 Jan 2025 08:44:44 -0800 (PST)
| Newsgroups | gmane.comp.lib.scintilla.devel |
|---|---|
| Message-ID | <[email protected]> |
Alright, I think for now I am going to keep things simple. I'll just check for xsl: and at that point show a function list. Not complicate it with any other stuff. On Saturday, 18 January 2025 at 15:44:04 UTC Mitchell wrote: > Hi, > > > On Jan 18, 2025, at 10:31 AM, Andrew Truckle <[email protected]> wrote: > > > > Hi Matt > > > > I have not investigated that. Bu I now realise that even that is not > sufficient. For example: > > > > <xsl:variable name="happy" ^ > > > > If I have typed the above and the cursor is now where the ^ is. At the > point I need to detect: > > 1. That the command is xsl:variable > > 2. That the name parameter has already been applied. > > 3. Display the Select value in the drop-list. > > > > My original idea will not work anyway. It would only work if I am on the > first parameter. So this is where I am getting confused. Whilst I can > display a function list, or a parameter list, I need to know the context. I > am not sure how to programatically work that out. Originally I though that > I could possibly use reg ex to find the function for the current text. eg: > search backword for xsl: and extract the text afterwards, in this case > "variable". This would give me the function for showing the parameter list. > But I don't know how. > > If you know your tags will only span one line, you could use > SCI_GETCURLINE and manually parse the returned string up to the returned > position, splitting on spaces for example. Otherwise you’re getting into > very complex territory that probably involves iterating backwards, looking > for a ‘<‘ not in a string and then parsing the result. > > Cheers, > Mitchell -- 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/c986cfcc-9fc6-4dea-b10f-57ff99f9583en%40googlegroups.com.