Lines Matching refs:typebuf

421 	typebuf.tb_off += typebuf.tb_maplen;  in flush_buffers()
422 typebuf.tb_len -= typebuf.tb_maplen; in flush_buffers()
424 if (typebuf.tb_len == 0) in flush_buffers()
435 while (inchar(typebuf.tb_buf, typebuf.tb_buflen - 1, 10L) != 0) in flush_buffers()
437 typebuf.tb_off = MAXMAPLEN; in flush_buffers()
438 typebuf.tb_len = 0; in flush_buffers()
445 typebuf.tb_maplen = 0; in flush_buffers()
446 typebuf.tb_silent = 0; in flush_buffers()
448 typebuf.tb_no_abbr_cnt = 0; in flush_buffers()
449 if (++typebuf.tb_change_cnt == 0) in flush_buffers()
450 typebuf.tb_change_cnt = 1; in flush_buffers()
922 if (typebuf.tb_buf == NULL) in init_typebuf()
924 typebuf.tb_buf = typebuf_init; in init_typebuf()
925 typebuf.tb_noremap = noremapbuf_init; in init_typebuf()
926 typebuf.tb_buflen = TYPELEN_INIT; in init_typebuf()
927 typebuf.tb_len = 0; in init_typebuf()
928 typebuf.tb_off = MAXMAPLEN + 4; in init_typebuf()
929 typebuf.tb_change_cnt = 1; in init_typebuf()
978 if (++typebuf.tb_change_cnt == 0) in ins_typebuf()
979 typebuf.tb_change_cnt = 1; in ins_typebuf()
984 if (offset == 0 && addlen <= typebuf.tb_off) in ins_typebuf()
989 typebuf.tb_off -= addlen; in ins_typebuf()
990 mch_memmove(typebuf.tb_buf + typebuf.tb_off, str, (size_t)addlen); in ins_typebuf()
992 else if (typebuf.tb_len == 0 && typebuf.tb_buflen in ins_typebuf()
999 typebuf.tb_off = (typebuf.tb_buflen - addlen - 3 * (MAXMAPLEN + 4)) / 2; in ins_typebuf()
1000 mch_memmove(typebuf.tb_buf + typebuf.tb_off, str, (size_t)addlen); in ins_typebuf()
1014 if (typebuf.tb_len > 2147483647 - extra) in ins_typebuf()
1021 newlen = typebuf.tb_len + extra; in ins_typebuf()
1031 typebuf.tb_buflen = newlen; in ins_typebuf()
1034 mch_memmove(s1 + newoff, typebuf.tb_buf + typebuf.tb_off, in ins_typebuf()
1041 typebuf.tb_buf + typebuf.tb_off + offset, in ins_typebuf()
1042 (size_t)(typebuf.tb_len - offset + 1)); in ins_typebuf()
1043 if (typebuf.tb_buf != typebuf_init) in ins_typebuf()
1044 vim_free(typebuf.tb_buf); in ins_typebuf()
1045 typebuf.tb_buf = s1; in ins_typebuf()
1047 mch_memmove(s2 + newoff, typebuf.tb_noremap + typebuf.tb_off, in ins_typebuf()
1050 typebuf.tb_noremap + typebuf.tb_off + offset, in ins_typebuf()
1051 (size_t)(typebuf.tb_len - offset)); in ins_typebuf()
1052 if (typebuf.tb_noremap != noremapbuf_init) in ins_typebuf()
1053 vim_free(typebuf.tb_noremap); in ins_typebuf()
1054 typebuf.tb_noremap = s2; in ins_typebuf()
1056 typebuf.tb_off = newoff; in ins_typebuf()
1058 typebuf.tb_len += addlen; in ins_typebuf()
1083 typebuf.tb_noremap[typebuf.tb_off + i + offset] = in ins_typebuf()
1089 if (nottyped || typebuf.tb_maplen > offset) in ins_typebuf()
1090 typebuf.tb_maplen += addlen; in ins_typebuf()
1091 if (silent || typebuf.tb_silent > offset) in ins_typebuf()
1093 typebuf.tb_silent += addlen; in ins_typebuf()
1096 if (typebuf.tb_no_abbr_cnt && offset == 0) // and not used for abbrev.s in ins_typebuf()
1097 typebuf.tb_no_abbr_cnt += addlen; in ins_typebuf()
1148 return (tb_change_cnt != 0 && (typebuf.tb_change_cnt != tb_change_cnt in typebuf_changed()
1162 return typebuf.tb_maplen == 0; in typebuf_typed()
1171 return typebuf.tb_maplen; in typebuf_maplen()
1185 typebuf.tb_len -= len; in del_typebuf()
1190 if (offset == 0 && typebuf.tb_buflen - (typebuf.tb_off + len) in del_typebuf()
1192 typebuf.tb_off += len; in del_typebuf()
1198 i = typebuf.tb_off + offset; in del_typebuf()
1202 if (typebuf.tb_off > MAXMAPLEN) in del_typebuf()
1204 mch_memmove(typebuf.tb_buf + MAXMAPLEN, in del_typebuf()
1205 typebuf.tb_buf + typebuf.tb_off, (size_t)offset); in del_typebuf()
1206 mch_memmove(typebuf.tb_noremap + MAXMAPLEN, in del_typebuf()
1207 typebuf.tb_noremap + typebuf.tb_off, (size_t)offset); in del_typebuf()
1208 typebuf.tb_off = MAXMAPLEN; in del_typebuf()
1211 mch_memmove(typebuf.tb_buf + typebuf.tb_off + offset, in del_typebuf()
1212 typebuf.tb_buf + i + len, in del_typebuf()
1213 (size_t)(typebuf.tb_len - offset + 1)); in del_typebuf()
1215 mch_memmove(typebuf.tb_noremap + typebuf.tb_off + offset, in del_typebuf()
1216 typebuf.tb_noremap + i + len, in del_typebuf()
1217 (size_t)(typebuf.tb_len - offset)); in del_typebuf()
1220 if (typebuf.tb_maplen > offset) // adjust tb_maplen in del_typebuf()
1222 if (typebuf.tb_maplen < offset + len) in del_typebuf()
1223 typebuf.tb_maplen = offset; in del_typebuf()
1225 typebuf.tb_maplen -= len; in del_typebuf()
1227 if (typebuf.tb_silent > offset) // adjust tb_silent in del_typebuf()
1229 if (typebuf.tb_silent < offset + len) in del_typebuf()
1230 typebuf.tb_silent = offset; in del_typebuf()
1232 typebuf.tb_silent -= len; in del_typebuf()
1234 if (typebuf.tb_no_abbr_cnt > offset) // adjust tb_no_abbr_cnt in del_typebuf()
1236 if (typebuf.tb_no_abbr_cnt < offset + len) in del_typebuf()
1237 typebuf.tb_no_abbr_cnt = offset; in del_typebuf()
1239 typebuf.tb_no_abbr_cnt -= len; in del_typebuf()
1247 if (++typebuf.tb_change_cnt == 0) in del_typebuf()
1248 typebuf.tb_change_cnt = 1; in del_typebuf()
1331 typebuf.tb_buf = alloc(TYPELEN_INIT); in alloc_typebuf()
1332 typebuf.tb_noremap = alloc(TYPELEN_INIT); in alloc_typebuf()
1333 if (typebuf.tb_buf == NULL || typebuf.tb_noremap == NULL) in alloc_typebuf()
1338 typebuf.tb_buflen = TYPELEN_INIT; in alloc_typebuf()
1339 typebuf.tb_off = MAXMAPLEN + 4; // can insert without realloc in alloc_typebuf()
1340 typebuf.tb_len = 0; in alloc_typebuf()
1341 typebuf.tb_maplen = 0; in alloc_typebuf()
1342 typebuf.tb_silent = 0; in alloc_typebuf()
1343 typebuf.tb_no_abbr_cnt = 0; in alloc_typebuf()
1344 if (++typebuf.tb_change_cnt == 0) in alloc_typebuf()
1345 typebuf.tb_change_cnt = 1; in alloc_typebuf()
1358 if (typebuf.tb_buf == typebuf_init) in free_typebuf()
1361 VIM_CLEAR(typebuf.tb_buf); in free_typebuf()
1362 if (typebuf.tb_noremap == noremapbuf_init) in free_typebuf()
1365 VIM_CLEAR(typebuf.tb_noremap); in free_typebuf()
1378 saved_typebuf[curscript] = typebuf; in save_typebuf()
1399 tp->save_typebuf = typebuf; in save_typeahead()
1402 typebuf = tp->save_typebuf; in save_typeahead()
1428 typebuf = tp->save_typebuf; in restore_typeahead()
1529 typebuf = saved_typebuf[curscript]; in closescript()
1995 if (c == NUL && typebuf.tb_len > 0) in vpeekc_any()
2300 char_u *p = typebuf.tb_buf + typebuf.tb_off; in at_ctrl_x_key()
2303 if (typebuf.tb_len > 3 in at_ctrl_x_key()
2326 if (offset + 3 >= typebuf.tb_len) in check_simplify_modifier()
2328 tp = typebuf.tb_buf + typebuf.tb_off + offset; in check_simplify_modifier()
2411 tb_c1 = typebuf.tb_buf[typebuf.tb_off]; in handle_mapping()
2414 && (typebuf.tb_maplen == 0 in handle_mapping()
2416 && (typebuf.tb_noremap[typebuf.tb_off] in handle_mapping()
2427 if (gui.in_use && tb_c1 == CSI && typebuf.tb_len >= 2 in handle_mapping()
2428 && typebuf.tb_buf[typebuf.tb_off + 1] == KS_MODIFIER) in handle_mapping()
2473 && typebuf.tb_maplen == 0) in handle_mapping()
2474 && ((mp->m_mode & LANGMAP) == 0 || typebuf.tb_maplen == 0)) in handle_mapping()
2481 for (mlen = 1; mlen < typebuf.tb_len; ++mlen) in handle_mapping()
2484 c2 = typebuf.tb_buf[typebuf.tb_off + mlen]; in handle_mapping()
2494 typebuf.tb_buf[typebuf.tb_off + mlen]) in handle_mapping()
2515 if (mlen == keylen || (mlen == typebuf.tb_len in handle_mapping()
2516 && typebuf.tb_len < keylen)) in handle_mapping()
2523 s = typebuf.tb_noremap + typebuf.tb_off; in handle_mapping()
2538 if (keylen > typebuf.tb_len) in handle_mapping()
2576 for (mlen = 0; mlen < typebuf.tb_len && p_pt[mlen]; ++mlen) in handle_mapping()
2577 if (p_pt[mlen] != typebuf.tb_buf[typebuf.tb_off + mlen]) in handle_mapping()
2582 if (mlen > typebuf.tb_maplen) in handle_mapping()
2583 gotchars(typebuf.tb_buf + typebuf.tb_off + typebuf.tb_maplen, in handle_mapping()
2584 mlen - typebuf.tb_maplen); in handle_mapping()
2602 if (mlen == typebuf.tb_len) in handle_mapping()
2623 && (typebuf.tb_maplen == 0 in handle_mapping()
2624 || (p_remap && typebuf.tb_noremap[ in handle_mapping()
2625 typebuf.tb_off] == RM_YES)) in handle_mapping()
2644 if (keylen < 0 && typebuf.tb_len == typebuf.tb_maplen) in handle_mapping()
2653 if (typebuf.tb_maplen == 0 && (typebuf.tb_buf[ in handle_mapping()
2654 typebuf.tb_off] & 0xff) == CSI) in handle_mapping()
2658 for (s = typebuf.tb_buf + typebuf.tb_off + 1; in handle_mapping()
2659 s < typebuf.tb_buf + typebuf.tb_off + typebuf.tb_len in handle_mapping()
2666 (int)(s + 1 - (typebuf.tb_buf + typebuf.tb_off)), 0); in handle_mapping()
2691 if (typebuf.tb_len >= 2 in handle_mapping()
2692 && typebuf.tb_buf[typebuf.tb_off] == K_SPECIAL in handle_mapping()
2693 && typebuf.tb_buf[typebuf.tb_off + 1] == KS_MENU) in handle_mapping()
2736 if (keylen >= 0 && keylen <= typebuf.tb_len) in handle_mapping()
2752 if (keylen > typebuf.tb_maplen) in handle_mapping()
2753 gotchars(typebuf.tb_buf + typebuf.tb_off + typebuf.tb_maplen, in handle_mapping()
2754 keylen - typebuf.tb_maplen); in handle_mapping()
2756 cmd_silent = (typebuf.tb_silent > 0); in handle_mapping()
2947 if (advance && typebuf.tb_maplen == 0) in vgetorpeek()
2971 if (typebuf.tb_no_abbr_cnt == 0) in vgetorpeek()
2972 typebuf.tb_no_abbr_cnt = 1; // no abbreviations now in vgetorpeek()
2994 if (typebuf.tb_maplen) in vgetorpeek()
3001 c = inchar(typebuf.tb_buf, typebuf.tb_buflen - 1, 0L); in vgetorpeek()
3010 if ((c || typebuf.tb_maplen) in vgetorpeek()
3021 *typebuf.tb_buf = c; in vgetorpeek()
3022 gotchars(typebuf.tb_buf, 1); in vgetorpeek()
3028 else if (typebuf.tb_len > 0) in vgetorpeek()
3050 c = typebuf.tb_buf[typebuf.tb_off]; in vgetorpeek()
3053 cmd_silent = (typebuf.tb_silent > 0); in vgetorpeek()
3054 if (typebuf.tb_maplen > 0) in vgetorpeek()
3060 gotchars(typebuf.tb_buf in vgetorpeek()
3061 + typebuf.tb_off, 1); in vgetorpeek()
3063 KeyNoremap = typebuf.tb_noremap[ in vgetorpeek()
3064 typebuf.tb_off]; in vgetorpeek()
3090 && typebuf.tb_len == 1 in vgetorpeek()
3091 && typebuf.tb_buf[typebuf.tb_off] == ESC in vgetorpeek()
3094 && typebuf.tb_maplen == 0 in vgetorpeek()
3098 && (c = inchar(typebuf.tb_buf + typebuf.tb_off in vgetorpeek()
3099 + typebuf.tb_len, 3, 25L)) == 0) in vgetorpeek()
3194 typebuf.tb_noremap[typebuf.tb_off + n] = RM_YES; in vgetorpeek()
3195 typebuf.tb_len += c; in vgetorpeek()
3198 if (typebuf.tb_len >= typebuf.tb_maplen + MAXMAPLEN) in vgetorpeek()
3213 if (typebuf.tb_len > 0) in vgetorpeek()
3275 if (typebuf.tb_len > 0 && advance && !exmode_active) in vgetorpeek()
3282 && ptr2cells(typebuf.tb_buf + typebuf.tb_off in vgetorpeek()
3283 + typebuf.tb_len - 1) == 1) in vgetorpeek()
3285 edit_putchar(typebuf.tb_buf[typebuf.tb_off in vgetorpeek()
3286 + typebuf.tb_len - 1], FALSE); in vgetorpeek()
3297 if (typebuf.tb_len > SHOWCMD_COLS) in vgetorpeek()
3298 showcmd_idx = typebuf.tb_len - SHOWCMD_COLS; in vgetorpeek()
3299 while (showcmd_idx < typebuf.tb_len) in vgetorpeek()
3301 typebuf.tb_buf[typebuf.tb_off + showcmd_idx++]); in vgetorpeek()
3312 && ptr2cells(typebuf.tb_buf + typebuf.tb_off in vgetorpeek()
3313 + typebuf.tb_len - 1) == 1) in vgetorpeek()
3315 putcmdline(typebuf.tb_buf[typebuf.tb_off in vgetorpeek()
3316 + typebuf.tb_len - 1], FALSE); in vgetorpeek()
3324 if (typebuf.tb_len == 0) in vgetorpeek()
3331 if (typebuf.tb_len == 0 in vgetorpeek()
3344 wait_tb_len = typebuf.tb_len; in vgetorpeek()
3345 c = inchar(typebuf.tb_buf + typebuf.tb_off + typebuf.tb_len, in vgetorpeek()
3346 typebuf.tb_buflen - typebuf.tb_off - typebuf.tb_len - 1, in vgetorpeek()
3377 while (typebuf.tb_buf[typebuf.tb_off in vgetorpeek()
3378 + typebuf.tb_len] != NUL) in vgetorpeek()
3379 typebuf.tb_noremap[typebuf.tb_off in vgetorpeek()
3380 + typebuf.tb_len++] = RM_YES; in vgetorpeek()
3402 if (typebuf.tb_len && !KeyTyped) in vgetorpeek()
3409 if (typebuf.tb_len && !KeyTyped) in vgetorpeek()
3469 int tb_change_cnt = typebuf.tb_change_cnt; in inchar()
3577 if (len > 0 && ++typebuf.tb_change_cnt == 0) in inchar()
3578 typebuf.tb_change_cnt = 1; in inchar()