File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,6 +173,8 @@ spell_check(
173173 int wrongcaplen = 0 ;
174174 int lpi ;
175175 int count_word = docount ;
176+ int use_camel_case = * wp -> w_s -> b_p_spo != NUL ;
177+ int camel_case = 0 ;
176178
177179 // A word never starts at a space or a control character. Return quickly
178180 // then, skipping over the character.
@@ -204,9 +206,27 @@ spell_check(
204206 mi .mi_fend = ptr ;
205207 if (spell_iswordp (mi .mi_fend , wp ))
206208 {
209+ int prev_upper ;
210+ int this_upper ;
211+
212+ if (use_camel_case )
213+ {
214+ c = PTR2CHAR (mi .mi_fend );
215+ this_upper = SPELL_ISUPPER (c );
216+ }
217+
207218 do
219+ {
208220 MB_PTR_ADV (mi .mi_fend );
209- while (* mi .mi_fend != NUL && spell_iswordp (mi .mi_fend , wp ));
221+ if (use_camel_case )
222+ {
223+ prev_upper = this_upper ;
224+ c = PTR2CHAR (mi .mi_fend );
225+ this_upper = SPELL_ISUPPER (c );
226+ camel_case = !prev_upper && this_upper ;
227+ }
228+ } while (* mi .mi_fend != NUL && spell_iswordp (mi .mi_fend , wp )
229+ && !camel_case );
210230
211231 if (capcol != NULL && * capcol == 0 && wp -> w_s -> b_cap_prog != NULL )
212232 {
@@ -237,6 +257,10 @@ spell_check(
237257 MAXWLEN + 1 );
238258 mi .mi_fwordlen = (int )STRLEN (mi .mi_fword );
239259
260+ if (camel_case )
261+ // Introduce a fake word end space into the folded word.
262+ mi .mi_fword [mi .mi_fwordlen - 1 ] = ' ' ;
263+
240264 // The word is bad unless we recognize it.
241265 mi .mi_result = SP_BAD ;
242266 mi .mi_result2 = SP_BAD ;
Original file line number Diff line number Diff line change @@ -754,6 +754,8 @@ static char *(features[]) =
754754
755755static int included_patches [] =
756756{ /* Add new patch number below this line */
757+ /**/
758+ 956 ,
757759/**/
758760 955 ,
759761/**/
You can’t perform that action at this time.
0 commit comments