int wrongcaplen = 0;
int lpi;
int count_word = docount;
+ int use_camel_case = *wp->w_s->b_p_spo != NUL;
+ int camel_case = 0;
// A word never starts at a space or a control character. Return quickly
// then, skipping over the character.
mi.mi_fend = ptr;
if (spell_iswordp(mi.mi_fend, wp))
{
+ int prev_upper;
+ int this_upper;
+
+ if (use_camel_case)
+ {
+ c = PTR2CHAR(mi.mi_fend);
+ this_upper = SPELL_ISUPPER(c);
+ }
+
do
+ {
MB_PTR_ADV(mi.mi_fend);
- while (*mi.mi_fend != NUL && spell_iswordp(mi.mi_fend, wp));
+ if (use_camel_case)
+ {
+ prev_upper = this_upper;
+ c = PTR2CHAR(mi.mi_fend);
+ this_upper = SPELL_ISUPPER(c);
+ camel_case = !prev_upper && this_upper;
+ }
+ } while (*mi.mi_fend != NUL && spell_iswordp(mi.mi_fend, wp)
+ && !camel_case);
if (capcol != NULL && *capcol == 0 && wp->w_s->b_cap_prog != NULL)
{
MAXWLEN + 1);
mi.mi_fwordlen = (int)STRLEN(mi.mi_fword);
+ if (camel_case)
+ // Introduce a fake word end space into the folded word.
+ mi.mi_fword[mi.mi_fwordlen - 1] = ' ';
+
// The word is bad unless we recognize it.
mi.mi_result = SP_BAD;
mi.mi_result2 = SP_BAD;