Lines Matching refs:mip
128 static void find_word(matchinf_T *mip, int mode);
129 static void find_prefix(matchinf_T *mip, int mode);
130 static int fold_more(matchinf_T *mip);
400 find_word(matchinf_T *mip, int mode) in find_word() argument
415 slang_T *slang = mip->mi_lp->lp_slang; in find_word()
426 ptr = mip->mi_word; in find_word()
433 wlen += mip->mi_compoff; in find_word()
438 ptr = mip->mi_fword; in find_word()
439 flen = mip->mi_fwordlen; // available case-folded bytes in find_word()
446 wlen = mip->mi_prefixlen; in find_word()
447 flen -= mip->mi_prefixlen; in find_word()
452 wlen = mip->mi_compoff; in find_word()
453 flen -= mip->mi_compoff; in find_word()
469 if (flen <= 0 && *mip->mi_fend != NUL) in find_word()
470 flen = fold_more(mip); in find_word()
538 if (flen <= 0 && *mip->mi_fend != NUL) in find_word()
539 flen = fold_more(mip); in find_word()
560 if (spell_iswordp(ptr + wlen, mip->mi_win)) in find_word()
577 p = mip->mi_word; in find_word()
582 wlen = (int)(p - mip->mi_word); in find_word()
602 if (mip->mi_cend != mip->mi_word + wlen) in find_word()
606 mip->mi_cend = mip->mi_word + wlen; in find_word()
607 mip->mi_capflags = captype(mip->mi_word, mip->mi_cend); in find_word()
610 if (mip->mi_capflags == WF_KEEPCAP in find_word()
611 || !spell_valid_case(mip->mi_capflags, flags)) in find_word()
620 c = valid_word_prefix(mip->mi_prefcnt, mip->mi_prefarridx, in find_word()
622 mip->mi_word + mip->mi_cprefixlen, slang, in find_word()
640 mip->mi_result = SP_OK; in find_word()
654 || wlen - mip->mi_compoff < slang->sl_compminlen) in find_word()
660 && mb_charlen_len(mip->mi_word + mip->mi_compoff, in find_word()
661 wlen - mip->mi_compoff) < slang->sl_compminlen) in find_word()
666 if (!word_ends && mip->mi_complen + mip->mi_compextra + 2 in find_word()
673 if (mip->mi_complen > 0 && (flags & WF_NOCOMPBEF)) in find_word()
679 if (!byte_in_str(mip->mi_complen == 0 in find_word()
696 if (has_mbyte && STRNCMP(ptr, mip->mi_word, in find_word()
697 mip->mi_compoff) != 0) in find_word()
700 p = mip->mi_word; in find_word()
701 for (s = ptr; s < ptr + mip->mi_compoff; MB_PTR_ADV(s)) in find_word()
705 p = mip->mi_word + mip->mi_compoff; in find_word()
706 capflags = captype(p, mip->mi_word + wlen); in find_word()
717 MB_PTR_BACK(mip->mi_word, p); in find_word()
718 if (spell_iswordp_nmw(p, mip->mi_win) in find_word()
729 mip->mi_compflags[mip->mi_complen] = ((unsigned)flags >> 24); in find_word()
730 mip->mi_compflags[mip->mi_complen + 1] = NUL; in find_word()
738 if (ptr == mip->mi_word) in find_word()
739 (void)spell_casefold(mip->mi_win, in find_word()
744 if (!can_compound(slang, fword, mip->mi_compflags)) in find_word()
748 && !match_compoundrule(slang, mip->mi_compflags)) in find_word()
762 int save_result = mip->mi_result; in find_word()
763 char_u *save_end = mip->mi_end; in find_word()
764 langp_T *save_lp = mip->mi_lp; in find_word()
773 mip->mi_result = SP_BAD; in find_word()
776 mip->mi_compoff = endlen[endidxcnt]; in find_word()
783 p = mip->mi_fword; in find_word()
788 mip->mi_compoff = (int)(p - mip->mi_fword); in find_word()
792 c = mip->mi_compoff; in find_word()
794 ++mip->mi_complen; in find_word()
796 ++mip->mi_compextra; in find_word()
800 for (lpi = 0; lpi < mip->mi_win->w_s->b_langp.ga_len; ++lpi) in find_word()
804 mip->mi_lp = LANGP_ENTRY(mip->mi_win->w_s->b_langp, lpi); in find_word()
805 if (mip->mi_lp->lp_slang->sl_fidxs == NULL in find_word()
806 || !mip->mi_lp->lp_slang->sl_nobreak) in find_word()
810 find_word(mip, FIND_COMPOUND); in find_word()
815 if (!slang->sl_nobreak || mip->mi_result == SP_BAD) in find_word()
818 mip->mi_compoff = wlen; in find_word()
819 find_word(mip, FIND_KEEPCOMPOUND); in find_word()
824 if (!slang->sl_nobreak || mip->mi_result == SP_BAD) in find_word()
827 mip->mi_compoff = c; in find_word()
828 find_prefix(mip, FIND_COMPOUND); in find_word()
836 --mip->mi_complen; in find_word()
838 --mip->mi_compextra; in find_word()
839 mip->mi_lp = save_lp; in find_word()
843 nobreak_result = mip->mi_result; in find_word()
844 mip->mi_result = save_result; in find_word()
845 mip->mi_end = save_end; in find_word()
849 if (mip->mi_result == SP_OK) in find_word()
860 if ((mip->mi_lp->lp_region & (flags >> 16)) != 0) in find_word()
875 if (mip->mi_result2 > res) in find_word()
877 mip->mi_result2 = res; in find_word()
878 mip->mi_end2 = mip->mi_word + wlen; in find_word()
880 else if (mip->mi_result2 == res in find_word()
881 && mip->mi_end2 < mip->mi_word + wlen) in find_word()
882 mip->mi_end2 = mip->mi_word + wlen; in find_word()
884 else if (mip->mi_result > res) in find_word()
886 mip->mi_result = res; in find_word()
887 mip->mi_end = mip->mi_word + wlen; in find_word()
889 else if (mip->mi_result == res && mip->mi_end < mip->mi_word + wlen) in find_word()
890 mip->mi_end = mip->mi_word + wlen; in find_word()
892 if (mip->mi_result == SP_OK) in find_word()
896 if (mip->mi_result == SP_OK) in find_word()
1084 find_prefix(matchinf_T *mip, int mode) in find_prefix() argument
1093 slang_T *slang = mip->mi_lp->lp_slang; in find_prefix()
1103 ptr = mip->mi_fword; in find_prefix()
1104 flen = mip->mi_fwordlen; // available case-folded bytes in find_prefix()
1108 ptr += mip->mi_compoff; in find_prefix()
1109 flen -= mip->mi_compoff; in find_prefix()
1121 if (flen == 0 && *mip->mi_fend != NUL) in find_prefix()
1122 flen = fold_more(mip); in find_prefix()
1134 mip->mi_prefarridx = arridx; in find_prefix()
1135 mip->mi_prefcnt = len; in find_prefix()
1141 mip->mi_prefcnt -= len; in find_prefix()
1144 mip->mi_prefixlen = wlen; in find_prefix()
1147 mip->mi_prefixlen += mip->mi_compoff; in find_prefix()
1152 mip->mi_cprefixlen = nofold_len(mip->mi_fword, in find_prefix()
1153 mip->mi_prefixlen, mip->mi_word); in find_prefix()
1156 mip->mi_cprefixlen = mip->mi_prefixlen; in find_prefix()
1157 find_word(mip, FIND_PREFIX); in find_prefix()
1203 fold_more(matchinf_T *mip) in fold_more() argument
1208 p = mip->mi_fend; in fold_more()
1210 MB_PTR_ADV(mip->mi_fend); in fold_more()
1211 while (*mip->mi_fend != NUL && spell_iswordp(mip->mi_fend, mip->mi_win)); in fold_more()
1214 if (*mip->mi_fend != NUL) in fold_more()
1215 MB_PTR_ADV(mip->mi_fend); in fold_more()
1217 (void)spell_casefold(mip->mi_win, p, (int)(mip->mi_fend - p), in fold_more()
1218 mip->mi_fword + mip->mi_fwordlen, in fold_more()
1219 MAXWLEN - mip->mi_fwordlen); in fold_more()
1220 flen = (int)STRLEN(mip->mi_fword + mip->mi_fwordlen); in fold_more()
1221 mip->mi_fwordlen += flen; in fold_more()