[Geany-devel] Use of Scintilla word boundaries for word searches

Colomban Wendling lists.ban at xxxxx
Fri Aug 19 16:10:42 UTC 2011


Hi,

I'm trying to address bug 3386129 [1], and I'd like comments & reviews
about my fix, because the whole thing don't look obvious at all...

We already have 2 ways of determining what a "word" is: a manual one
using GEANY_WORDCHARS or a caller-given list of wordchars, and one that
uses Scintilla's word boundaries.

The former seems to make more sense when the caller code knows the kind
of characters it wants (e.g. tags lookups), but the latter is better
when getting the word to search for.
Currently the latter is only used to select the current word, and the
second everywhere else we want to get the current word.

Actually if we do a whole word search we *need* to get what Scintilla
sees as a "word" since we leave the search to it (see bug report for a
example of what's going wrong otherwise).

So in the attached patch, I added a alternative way to get the the
current word (that uses the same algorithm as the word selection) and
tries to use it whenever the word was fetched for a search.

I'd appreciate reviews & comments :)

Cheers,
Colomban


[1]
https://sourceforge.net/tracker/?func=detail&atid=787791&aid=3386129&group_id=153444
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0000-Use-Scintilla-s-word-boundaries-for-word-searches.patch
Type: text/x-patch
Size: 7358 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20110819/5adaf880/attachment.bin>


More information about the Devel mailing list