Neil, right now, the CurrentWord property is populated by comparing the characters to hard-coded list of (in)valid characters. I see near one of these hard-coded functions a comment saying that it should respect word.characters.filepattern. Since I have a need for CurrentWord to use the active file's word.characters , I'd like to make this a reality. However, I'm not sure what the best method is for achieving that goal.

In my mind, the functions isfilenamecharforsel() and iswordcharforsel() should be removed in favor of the following generic function:
static bool ischarinset(char c, const char *set, bool invert = true)
{
   if (invert)
       return !strchr(set, ch);
   else
       return strchr(set, ch);
}

Then, instead of passing those two functions around, a couple of (global) static strings are passed to provide the same functionality. Now that the valid word character set is passed as a parameter, SciTEBase::SelectionWord can get an expanded word.characters.filepattern and pass that instead of the (currently) hard-coded string.

Does this approach sound reasonable to you?

--
- Valik

_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to