Lines Matching refs:wp
119 static int spell_mb_isword_class(int cl, win_T *wp);
159 win_T *wp, // current window in spell_check() argument
172 int use_camel_case = *wp->w_s->b_p_spo != NUL; in spell_check()
181 if (wp->w_s->b_langp.ga_len == 0) in spell_check()
203 if (spell_iswordp(mi.mi_fend, wp)) in spell_check()
224 } while (*mi.mi_fend != NUL && spell_iswordp(mi.mi_fend, wp) in spell_check()
227 if (capcol != NULL && *capcol == 0 && wp->w_s->b_cap_prog != NULL) in spell_check()
245 mi.mi_win = wp; in spell_check()
252 (void)spell_casefold(wp, ptr, (int)(mi.mi_fend - ptr), mi.mi_fword, in spell_check()
269 for (lpi = 0; lpi < wp->w_s->b_langp.ga_len; ++lpi) in spell_check()
271 mi.mi_lp = LANGP_ENTRY(wp->w_s->b_langp, lpi); in spell_check()
317 else if (!spell_iswordp_nmw(ptr, wp)) in spell_check()
319 if (capcol != NULL && wp->w_s->b_cap_prog != NULL) in spell_check()
325 regmatch.regprog = wp->w_s->b_cap_prog; in spell_check()
328 wp->w_s->b_cap_prog = regmatch.regprog; in spell_check()
342 && LANGP_ENTRY(wp->w_s->b_langp, 0)->lp_slang->sl_nobreak) in spell_check()
349 mi.mi_lp = LANGP_ENTRY(wp->w_s->b_langp, 0); in spell_check()
1244 no_spell_checking(win_T *wp) in no_spell_checking() argument
1246 if (!wp->w_p_spell || *wp->w_s->b_p_spl == NUL in no_spell_checking()
1247 || wp->w_s->b_langp.ga_len == 0) in no_spell_checking()
1265 win_T *wp, in spell_move_to() argument
1281 int has_syntax = syntax_present(wp); in spell_move_to()
1292 if (no_spell_checking(wp)) in spell_move_to()
1306 lnum = wp->w_cursor.lnum; in spell_move_to()
1311 line = ml_get_buf(wp->w_buffer, lnum, FALSE); in spell_move_to()
1330 else if (curline && wp == curwin) in spell_move_to()
1339 line = ml_get_buf(wp->w_buffer, lnum, FALSE); in spell_move_to()
1345 if (lnum < wp->w_buffer->b_ml.ml_line_count) in spell_move_to()
1347 ml_get_buf(wp->w_buffer, lnum + 1, FALSE), MAXWLEN); in spell_move_to()
1356 && lnum == wp->w_cursor.lnum in spell_move_to()
1358 && (colnr_T)(p - buf) >= wp->w_cursor.col) in spell_move_to()
1363 len = spell_check(wp, p, &attr, &capcol, FALSE); in spell_move_to()
1373 || lnum != wp->w_cursor.lnum in spell_move_to()
1374 || (lnum == wp->w_cursor.lnum in spell_move_to()
1378 > wp->w_cursor.col))) in spell_move_to()
1384 (void)syn_get_id(wp, lnum, (colnr_T)col, in spell_move_to()
1402 wp->w_cursor = found_pos; in spell_move_to()
1428 wp->w_cursor = found_pos; in spell_move_to()
1438 if (lnum == wp->w_cursor.lnum && wrapped) in spell_move_to()
1452 lnum = wp->w_buffer->b_ml.ml_line_count; in spell_move_to()
1461 if (lnum < wp->w_buffer->b_ml.ml_line_count) in spell_move_to()
1477 if (lnum == wp->w_cursor.lnum && !found_one) in spell_move_to()
1972 did_set_spelllang(win_T *wp) in did_set_spelllang() argument
1998 set_bufref(&bufref, wp->w_buffer); in did_set_spelllang()
2008 clear_midword(wp); in did_set_spelllang()
2012 spl_copy = vim_strsave(wp->w_s->b_p_spl); in did_set_spelllang()
2016 wp->w_s->b_cjk = 0; in did_set_spelllang()
2031 wp->w_s->b_cjk = 1; in did_set_spelllang()
2146 use_midword(slang, wp); in did_set_spelllang()
2232 use_midword(slang, wp); in did_set_spelllang()
2238 ga_clear(&wp->w_s->b_langp); in did_set_spelllang()
2239 wp->w_s->b_langp = ga; in did_set_spelllang()
2284 redraw_win_later(wp, NOT_VALID); in did_set_spelllang()
2296 clear_midword(win_T *wp) in clear_midword() argument
2298 CLEAR_FIELD(wp->w_s->b_spell_ismw); in clear_midword()
2299 VIM_CLEAR(wp->w_s->b_spell_ismw_mb); in clear_midword()
2307 use_midword(slang_T *lp, win_T *wp) in use_midword() argument
2323 wp->w_s->b_spell_ismw[c] = TRUE; in use_midword()
2324 else if (wp->w_s->b_spell_ismw_mb == NULL) in use_midword()
2326 wp->w_s->b_spell_ismw_mb = vim_strnsave(p, l); in use_midword()
2330 n = (int)STRLEN(wp->w_s->b_spell_ismw_mb); in use_midword()
2331 bp = vim_strnsave(wp->w_s->b_spell_ismw_mb, n + l); in use_midword()
2334 vim_free(wp->w_s->b_spell_ismw_mb); in use_midword()
2335 wp->w_s->b_spell_ismw_mb = bp; in use_midword()
2342 wp->w_s->b_spell_ismw[*p++] = TRUE; in use_midword()
2471 win_T *wp; in spell_reload() local
2480 FOR_ALL_WINDOWS(wp) in spell_reload()
2484 if (*wp->w_s->b_p_spl != NUL) in spell_reload()
2486 if (wp->w_p_spell) in spell_reload()
2488 (void)did_set_spelllang(wp); in spell_reload()
2637 win_T *wp) // buffer used in spell_iswordp() argument
2650 if (wp->w_s->b_spell_ismw[*p]) in spell_iswordp()
2656 if (c < 256 ? wp->w_s->b_spell_ismw[c] in spell_iswordp()
2657 : (wp->w_s->b_spell_ismw_mb != NULL in spell_iswordp()
2658 && vim_strchr(wp->w_s->b_spell_ismw_mb, c) != NULL)) in spell_iswordp()
2664 return spell_mb_isword_class(mb_get_class(s), wp); in spell_iswordp()
2668 return spelltab.st_isw[wp->w_s->b_spell_ismw[*p] ? p[1] : p[0]]; in spell_iswordp()
2676 spell_iswordp_nmw(char_u *p, win_T *wp) in spell_iswordp_nmw() argument
2684 return spell_mb_isword_class(mb_get_class(p), wp); in spell_iswordp_nmw()
2697 spell_mb_isword_class(int cl, win_T *wp) in spell_mb_isword_class() argument
2699 if (wp->w_s->b_cjk) in spell_mb_isword_class()
2710 spell_iswordp_w(int *p, win_T *wp) in spell_iswordp_w() argument
2714 if (*p < 256 ? wp->w_s->b_spell_ismw[*p] in spell_iswordp_w()
2715 : (wp->w_s->b_spell_ismw_mb != NULL in spell_iswordp_w()
2716 && vim_strchr(wp->w_s->b_spell_ismw_mb, *p) != NULL)) in spell_iswordp_w()
2724 return spell_mb_isword_class(utf_class(*s), wp); in spell_iswordp_w()
2727 dbcs_class((unsigned)*s >> 8, *s & 0xff), wp); in spell_iswordp_w()
2741 win_T *wp, in spell_casefold() argument
2776 if (p == str + len || !spell_iswordp(p, wp)) in spell_casefold()
4373 win_T *wp; in did_set_spell_option() local
4386 FOR_ALL_WINDOWS(wp) in did_set_spell_option()
4387 if (wp->w_buffer == curbuf && wp->w_p_spell) in did_set_spell_option()
4389 errmsg = did_set_spelllang(wp); in did_set_spell_option()