[Github-comments] [geany-plugins] Improve detection of English contractions and other use of single quotes (#322)

Colomban Wendling notifications at xxxxx
Sun Jan 3 21:26:56 UTC 2016


>  
>  	g_return_val_if_fail(sc_speller_dict != NULL, 0);
>  	g_return_val_if_fail(doc != NULL, 0);
>  	g_return_val_if_fail(line != NULL, 0);
>  
> +	/* add ' (single quote) temporarily to wordchars
> +	 * to be able to check for "doesn't", "isn't" and similar */
> +	wordchars_len = scintilla_send_message(doc->editor->sci, SCI_GETWORDCHARS, 0, 0);
> +	wordchars_orig = g_malloc0(wordchars_len + 1);
> +	scintilla_send_message(doc->editor->sci, SCI_GETWORDCHARS, 0, (sptr_t)wordchars_orig);
> +	if (! strchr(wordchars_orig, '\''))
> +	{
> +		GString *wordchars_new = g_string_new(wordchars_orig);

whether the code is "hot" (called often), so basically whether optimizing this is worth the (trivial) added subtlety.

---
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/322/files#r48697465
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20160103/32b2aa44/attachment.html>


More information about the Github-comments mailing list