• Home
  • History
  • Annotate
  • Raw
  • Download

Lines Matching refs:el

61 cv_action(EditLine *el, Int c)  in cv_action()  argument
64 if (el->el_chared.c_vcmd.action != NOP) { in cv_action()
66 if (c != (Int)el->el_chared.c_vcmd.action) in cv_action()
70 cv_undo(el); in cv_action()
71 cv_yank(el, el->el_line.buffer, in cv_action()
72 (int)(el->el_line.lastchar - el->el_line.buffer)); in cv_action()
73 el->el_chared.c_vcmd.action = NOP; in cv_action()
74 el->el_chared.c_vcmd.pos = 0; in cv_action()
76 el->el_line.lastchar = el->el_line.buffer; in cv_action()
77 el->el_line.cursor = el->el_line.buffer; in cv_action()
80 el->el_map.current = el->el_map.key; in cv_action()
84 el->el_chared.c_vcmd.pos = el->el_line.cursor; in cv_action()
85 el->el_chared.c_vcmd.action = c; in cv_action()
93 cv_paste(EditLine *el, Int c) in cv_paste() argument
95 c_kill_t *k = &el->el_chared.c_kill; in cv_paste()
101 (void) fprintf(el->el_errfile, "Paste: \"%.*s\"\n", (int)len, k->buf); in cv_paste()
104 cv_undo(el); in cv_paste()
106 if (!c && el->el_line.cursor < el->el_line.lastchar) in cv_paste()
107 el->el_line.cursor++; in cv_paste()
109 c_insert(el, (int)len); in cv_paste()
110 if (el->el_line.cursor + len > el->el_line.lastchar) in cv_paste()
112 (void) memcpy(el->el_line.cursor, k->buf, len * in cv_paste()
113 sizeof(*el->el_line.cursor)); in cv_paste()
125 vi_paste_next(EditLine *el, Int c __attribute__((__unused__))) in vi_paste_next() argument
128 return cv_paste(el, 0); in vi_paste_next()
138 vi_paste_prev(EditLine *el, Int c __attribute__((__unused__))) in vi_paste_prev() argument
141 return cv_paste(el, 1); in vi_paste_prev()
151 vi_prev_big_word(EditLine *el, Int c __attribute__((__unused__))) in vi_prev_big_word() argument
154 if (el->el_line.cursor == el->el_line.buffer) in vi_prev_big_word()
157 el->el_line.cursor = cv_prev_word(el->el_line.cursor, in vi_prev_big_word()
158 el->el_line.buffer, in vi_prev_big_word()
159 el->el_state.argument, in vi_prev_big_word()
162 if (el->el_chared.c_vcmd.action != NOP) { in vi_prev_big_word()
163 cv_delfini(el); in vi_prev_big_word()
176 vi_prev_word(EditLine *el, Int c __attribute__((__unused__))) in vi_prev_word() argument
179 if (el->el_line.cursor == el->el_line.buffer) in vi_prev_word()
182 el->el_line.cursor = cv_prev_word(el->el_line.cursor, in vi_prev_word()
183 el->el_line.buffer, in vi_prev_word()
184 el->el_state.argument, in vi_prev_word()
187 if (el->el_chared.c_vcmd.action != NOP) { in vi_prev_word()
188 cv_delfini(el); in vi_prev_word()
201 vi_next_big_word(EditLine *el, Int c __attribute__((__unused__))) in vi_next_big_word() argument
204 if (el->el_line.cursor >= el->el_line.lastchar - 1) in vi_next_big_word()
207 el->el_line.cursor = cv_next_word(el, el->el_line.cursor, in vi_next_big_word()
208 el->el_line.lastchar, el->el_state.argument, cv__isWord); in vi_next_big_word()
210 if (el->el_map.type == MAP_VI) in vi_next_big_word()
211 if (el->el_chared.c_vcmd.action != NOP) { in vi_next_big_word()
212 cv_delfini(el); in vi_next_big_word()
225 vi_next_word(EditLine *el, Int c __attribute__((__unused__))) in vi_next_word() argument
228 if (el->el_line.cursor >= el->el_line.lastchar - 1) in vi_next_word()
231 el->el_line.cursor = cv_next_word(el, el->el_line.cursor, in vi_next_word()
232 el->el_line.lastchar, el->el_state.argument, cv__isword); in vi_next_word()
234 if (el->el_map.type == MAP_VI) in vi_next_word()
235 if (el->el_chared.c_vcmd.action != NOP) { in vi_next_word()
236 cv_delfini(el); in vi_next_word()
248 vi_change_case(EditLine *el, Int c) in vi_change_case() argument
252 if (el->el_line.cursor >= el->el_line.lastchar) in vi_change_case()
254 cv_undo(el); in vi_change_case()
255 for (i = 0; i < el->el_state.argument; i++) { in vi_change_case()
257 c = *el->el_line.cursor; in vi_change_case()
259 *el->el_line.cursor = Tolower(c); in vi_change_case()
261 *el->el_line.cursor = Toupper(c); in vi_change_case()
263 if (++el->el_line.cursor >= el->el_line.lastchar) { in vi_change_case()
264 el->el_line.cursor--; in vi_change_case()
265 re_fastaddc(el); in vi_change_case()
268 re_fastaddc(el); in vi_change_case()
280 vi_change_meta(EditLine *el, Int c __attribute__((__unused__))) in vi_change_meta() argument
287 return cv_action(el, DELETE | INSERT); in vi_change_meta()
297 vi_insert_at_bol(EditLine *el, Int c __attribute__((__unused__))) in vi_insert_at_bol() argument
300 el->el_line.cursor = el->el_line.buffer; in vi_insert_at_bol()
301 cv_undo(el); in vi_insert_at_bol()
302 el->el_map.current = el->el_map.key; in vi_insert_at_bol()
313 vi_replace_char(EditLine *el, Int c __attribute__((__unused__))) in vi_replace_char() argument
316 if (el->el_line.cursor >= el->el_line.lastchar) in vi_replace_char()
319 el->el_map.current = el->el_map.key; in vi_replace_char()
320 el->el_state.inputmode = MODE_REPLACE_1; in vi_replace_char()
321 cv_undo(el); in vi_replace_char()
332 vi_replace_mode(EditLine *el, Int c __attribute__((__unused__))) in vi_replace_mode() argument
335 el->el_map.current = el->el_map.key; in vi_replace_mode()
336 el->el_state.inputmode = MODE_REPLACE; in vi_replace_mode()
337 cv_undo(el); in vi_replace_mode()
348 vi_substitute_char(EditLine *el, Int c __attribute__((__unused__))) in vi_substitute_char() argument
351 c_delafter(el, el->el_state.argument); in vi_substitute_char()
352 el->el_map.current = el->el_map.key; in vi_substitute_char()
363 vi_substitute_line(EditLine *el, Int c __attribute__((__unused__))) in vi_substitute_line() argument
366 cv_undo(el); in vi_substitute_line()
367 cv_yank(el, el->el_line.buffer, in vi_substitute_line()
368 (int)(el->el_line.lastchar - el->el_line.buffer)); in vi_substitute_line()
369 (void) em_kill_line(el, 0); in vi_substitute_line()
370 el->el_map.current = el->el_map.key; in vi_substitute_line()
381 vi_change_to_eol(EditLine *el, Int c __attribute__((__unused__))) in vi_change_to_eol() argument
384 cv_undo(el); in vi_change_to_eol()
385 cv_yank(el, el->el_line.cursor, in vi_change_to_eol()
386 (int)(el->el_line.lastchar - el->el_line.cursor)); in vi_change_to_eol()
387 (void) ed_kill_line(el, 0); in vi_change_to_eol()
388 el->el_map.current = el->el_map.key; in vi_change_to_eol()
399 vi_insert(EditLine *el, Int c __attribute__((__unused__))) in vi_insert() argument
402 el->el_map.current = el->el_map.key; in vi_insert()
403 cv_undo(el); in vi_insert()
414 vi_add(EditLine *el, Int c __attribute__((__unused__))) in vi_add() argument
418 el->el_map.current = el->el_map.key; in vi_add()
419 if (el->el_line.cursor < el->el_line.lastchar) { in vi_add()
420 el->el_line.cursor++; in vi_add()
421 if (el->el_line.cursor > el->el_line.lastchar) in vi_add()
422 el->el_line.cursor = el->el_line.lastchar; in vi_add()
427 cv_undo(el); in vi_add()
439 vi_add_at_eol(EditLine *el, Int c __attribute__((__unused__))) in vi_add_at_eol() argument
442 el->el_map.current = el->el_map.key; in vi_add_at_eol()
443 el->el_line.cursor = el->el_line.lastchar; in vi_add_at_eol()
444 cv_undo(el); in vi_add_at_eol()
455 vi_delete_meta(EditLine *el, Int c __attribute__((__unused__))) in vi_delete_meta() argument
458 return cv_action(el, DELETE); in vi_delete_meta()
468 vi_end_big_word(EditLine *el, Int c __attribute__((__unused__))) in vi_end_big_word() argument
471 if (el->el_line.cursor == el->el_line.lastchar) in vi_end_big_word()
474 el->el_line.cursor = cv__endword(el->el_line.cursor, in vi_end_big_word()
475 el->el_line.lastchar, el->el_state.argument, cv__isWord); in vi_end_big_word()
477 if (el->el_chared.c_vcmd.action != NOP) { in vi_end_big_word()
478 el->el_line.cursor++; in vi_end_big_word()
479 cv_delfini(el); in vi_end_big_word()
492 vi_end_word(EditLine *el, Int c __attribute__((__unused__))) in vi_end_word() argument
495 if (el->el_line.cursor == el->el_line.lastchar) in vi_end_word()
498 el->el_line.cursor = cv__endword(el->el_line.cursor, in vi_end_word()
499 el->el_line.lastchar, el->el_state.argument, cv__isword); in vi_end_word()
501 if (el->el_chared.c_vcmd.action != NOP) { in vi_end_word()
502 el->el_line.cursor++; in vi_end_word()
503 cv_delfini(el); in vi_end_word()
516 vi_undo(EditLine *el, Int c __attribute__((__unused__))) in vi_undo() argument
518 c_undo_t un = el->el_chared.c_undo; in vi_undo()
524 el->el_chared.c_undo.buf = el->el_line.buffer; in vi_undo()
525 el->el_chared.c_undo.len = el->el_line.lastchar - el->el_line.buffer; in vi_undo()
526 el->el_chared.c_undo.cursor = in vi_undo()
527 (int)(el->el_line.cursor - el->el_line.buffer); in vi_undo()
528 el->el_line.limit = un.buf + (el->el_line.limit - el->el_line.buffer); in vi_undo()
529 el->el_line.buffer = un.buf; in vi_undo()
530 el->el_line.cursor = un.buf + un.cursor; in vi_undo()
531 el->el_line.lastchar = un.buf + un.len; in vi_undo()
543 vi_command_mode(EditLine *el, Int c __attribute__((__unused__))) in vi_command_mode() argument
547 el->el_chared.c_vcmd.action = NOP; in vi_command_mode()
548 el->el_chared.c_vcmd.pos = 0; in vi_command_mode()
550 el->el_state.doingarg = 0; in vi_command_mode()
552 el->el_state.inputmode = MODE_INSERT; in vi_command_mode()
553 el->el_map.current = el->el_map.alt; in vi_command_mode()
555 if (el->el_line.cursor > el->el_line.buffer) in vi_command_mode()
556 el->el_line.cursor--; in vi_command_mode()
567 vi_zero(EditLine *el, Int c) in vi_zero() argument
570 if (el->el_state.doingarg) in vi_zero()
571 return ed_argument_digit(el, c); in vi_zero()
573 el->el_line.cursor = el->el_line.buffer; in vi_zero()
574 if (el->el_chared.c_vcmd.action != NOP) { in vi_zero()
575 cv_delfini(el); in vi_zero()
588 vi_delete_prev_char(EditLine *el, Int c __attribute__((__unused__))) in vi_delete_prev_char() argument
591 if (el->el_line.cursor <= el->el_line.buffer) in vi_delete_prev_char()
594 c_delbefore1(el); in vi_delete_prev_char()
595 el->el_line.cursor--; in vi_delete_prev_char()
606 vi_list_or_eof(EditLine *el, Int c) in vi_list_or_eof() argument
609 if (el->el_line.cursor == el->el_line.lastchar) { in vi_list_or_eof()
610 if (el->el_line.cursor == el->el_line.buffer) { in vi_list_or_eof()
611 terminal_writec(el, c); /* then do a EOF */ in vi_list_or_eof()
618 terminal_beep(el); in vi_list_or_eof()
623 re_goto_bottom(el); in vi_list_or_eof()
624 *el->el_line.lastchar = '\0'; /* just in case */ in vi_list_or_eof()
630 terminal_beep(el); in vi_list_or_eof()
643 vi_kill_line_prev(EditLine *el, Int c __attribute__((__unused__))) in vi_kill_line_prev() argument
647 cp = el->el_line.buffer; in vi_kill_line_prev()
648 kp = el->el_chared.c_kill.buf; in vi_kill_line_prev()
649 while (cp < el->el_line.cursor) in vi_kill_line_prev()
651 el->el_chared.c_kill.last = kp; in vi_kill_line_prev()
652 c_delbefore(el, (int)(el->el_line.cursor - el->el_line.buffer)); in vi_kill_line_prev()
653 el->el_line.cursor = el->el_line.buffer; /* zap! */ in vi_kill_line_prev()
664 vi_search_prev(EditLine *el, Int c __attribute__((__unused__))) in vi_search_prev() argument
667 return cv_search(el, ED_SEARCH_PREV_HISTORY); in vi_search_prev()
677 vi_search_next(EditLine *el, Int c __attribute__((__unused__))) in vi_search_next() argument
680 return cv_search(el, ED_SEARCH_NEXT_HISTORY); in vi_search_next()
690 vi_repeat_search_next(EditLine *el, Int c __attribute__((__unused__))) in vi_repeat_search_next() argument
693 if (el->el_search.patlen == 0) in vi_repeat_search_next()
696 return cv_repeat_srch(el, el->el_search.patdir); in vi_repeat_search_next()
706 vi_repeat_search_prev(EditLine *el, Int c __attribute__((__unused__))) in vi_repeat_search_prev() argument
709 if (el->el_search.patlen == 0) in vi_repeat_search_prev()
712 return (cv_repeat_srch(el, in vi_repeat_search_prev()
713 el->el_search.patdir == ED_SEARCH_PREV_HISTORY ? in vi_repeat_search_prev()
724 vi_next_char(EditLine *el, Int c __attribute__((__unused__))) in vi_next_char() argument
726 return cv_csearch(el, CHAR_FWD, -1, el->el_state.argument, 0); in vi_next_char()
736 vi_prev_char(EditLine *el, Int c __attribute__((__unused__))) in vi_prev_char() argument
738 return cv_csearch(el, CHAR_BACK, -1, el->el_state.argument, 0); in vi_prev_char()
748 vi_to_next_char(EditLine *el, Int c __attribute__((__unused__))) in vi_to_next_char() argument
750 return cv_csearch(el, CHAR_FWD, -1, el->el_state.argument, 1); in vi_to_next_char()
760 vi_to_prev_char(EditLine *el, Int c __attribute__((__unused__))) in vi_to_prev_char() argument
762 return cv_csearch(el, CHAR_BACK, -1, el->el_state.argument, 1); in vi_to_prev_char()
772 vi_repeat_next_char(EditLine *el, Int c __attribute__((__unused__))) in vi_repeat_next_char() argument
775 return cv_csearch(el, el->el_search.chadir, el->el_search.chacha, in vi_repeat_next_char()
776 el->el_state.argument, el->el_search.chatflg); in vi_repeat_next_char()
786 vi_repeat_prev_char(EditLine *el, Int c __attribute__((__unused__))) in vi_repeat_prev_char() argument
789 int dir = el->el_search.chadir; in vi_repeat_prev_char()
791 r = cv_csearch(el, -dir, el->el_search.chacha, in vi_repeat_prev_char()
792 el->el_state.argument, el->el_search.chatflg); in vi_repeat_prev_char()
793 el->el_search.chadir = dir; in vi_repeat_prev_char()
804 vi_match(EditLine *el, Int c __attribute__((__unused__))) in vi_match() argument
811 *el->el_line.lastchar = '\0'; /* just in case */ in vi_match()
813 i = Strcspn(el->el_line.cursor, match_chars); in vi_match()
814 o_ch = el->el_line.cursor[i]; in vi_match()
822 for (cp = &el->el_line.cursor[i]; count; ) { in vi_match()
824 if (cp < el->el_line.buffer || cp >= el->el_line.lastchar) in vi_match()
832 el->el_line.cursor = cp; in vi_match()
834 if (el->el_chared.c_vcmd.action != NOP) { in vi_match()
838 el->el_line.cursor++; in vi_match()
839 cv_delfini(el); in vi_match()
851 vi_undo_line(EditLine *el, Int c __attribute__((__unused__))) in vi_undo_line() argument
854 cv_undo(el); in vi_undo_line()
855 return hist_get(el); in vi_undo_line()
865 vi_to_column(EditLine *el, Int c __attribute__((__unused__))) in vi_to_column() argument
868 el->el_line.cursor = el->el_line.buffer; in vi_to_column()
869 el->el_state.argument--; in vi_to_column()
870 return ed_next_char(el, 0); in vi_to_column()
879 vi_yank_end(EditLine *el, Int c __attribute__((__unused__))) in vi_yank_end() argument
882 cv_yank(el, el->el_line.cursor, in vi_yank_end()
883 (int)(el->el_line.lastchar - el->el_line.cursor)); in vi_yank_end()
893 vi_yank(EditLine *el, Int c __attribute__((__unused__))) in vi_yank() argument
896 return cv_action(el, YANK); in vi_yank()
905 vi_comment_out(EditLine *el, Int c __attribute__((__unused__))) in vi_comment_out() argument
908 el->el_line.cursor = el->el_line.buffer; in vi_comment_out()
909 c_insert(el, 1); in vi_comment_out()
910 *el->el_line.cursor = '#'; in vi_comment_out()
911 re_refresh(el); in vi_comment_out()
912 return ed_newline(el, 0); in vi_comment_out()
927 vi_alias(EditLine *el __attribute__((__unused__)), Int c __attribute__((__unused__))) in vi_alias() argument
939 if (el_getc(el, &alias_name[1]) != 1) in vi_alias()
944 FUN(el,push)(el, ct_decode_string(alias_text, &el->el_scratch)); in vi_alias()
957 vi_to_history_line(EditLine *el, Int c __attribute__((__unused__))) in vi_to_history_line() argument
959 int sv_event_no = el->el_history.eventno; in vi_to_history_line()
963 if (el->el_history.eventno == 0) { in vi_to_history_line()
964 (void) Strncpy(el->el_history.buf, el->el_line.buffer, in vi_to_history_line()
966 el->el_history.last = el->el_history.buf + in vi_to_history_line()
967 (el->el_line.lastchar - el->el_line.buffer); in vi_to_history_line()
971 if (!el->el_state.doingarg) { in vi_to_history_line()
972 el->el_history.eventno = 0x7fffffff; in vi_to_history_line()
973 hist_get(el); in vi_to_history_line()
980 el->el_history.eventno = 1; in vi_to_history_line()
981 if (hist_get(el) == CC_ERROR) in vi_to_history_line()
983 el->el_history.eventno = 1 + el->el_history.ev.num in vi_to_history_line()
984 - el->el_state.argument; in vi_to_history_line()
985 if (el->el_history.eventno < 0) { in vi_to_history_line()
986 el->el_history.eventno = sv_event_no; in vi_to_history_line()
990 rval = hist_get(el); in vi_to_history_line()
992 el->el_history.eventno = sv_event_no; in vi_to_history_line()
1002 vi_histedit(EditLine *el, Int c __attribute__((__unused__))) in vi_histedit() argument
1013 if (el->el_state.doingarg) { in vi_histedit()
1014 if (vi_to_history_line(el, 0) == CC_ERROR) in vi_histedit()
1021 len = (size_t)(el->el_line.lastchar - el->el_line.buffer); in vi_histedit()
1029 Strncpy(line, el->el_line.buffer, len); in vi_histedit()
1051 len = (size_t)(el->el_line.lastchar - in vi_histedit()
1052 el->el_line.buffer); in vi_histedit()
1053 len = ct_mbstowcs(el->el_line.buffer, cp, len); in vi_histedit()
1054 if (len > 0 && el->el_line.buffer[len -1] == '\n') in vi_histedit()
1059 el->el_line.cursor = el->el_line.buffer; in vi_histedit()
1060 el->el_line.lastchar = el->el_line.buffer + len; in vi_histedit()
1069 return ed_newline(el, 0); in vi_histedit()
1086 vi_history_word(EditLine *el, Int c __attribute__((__unused__))) in vi_history_word() argument
1088 const Char *wp = HIST_FIRST(el); in vi_history_word()
1107 } while ((!el->el_state.doingarg || --el->el_state.argument > 0) in vi_history_word()
1110 if (wsp == 0 || (el->el_state.doingarg && el->el_state.argument != 0)) in vi_history_word()
1113 cv_undo(el); in vi_history_word()
1115 if (el->el_line.cursor < el->el_line.lastchar) in vi_history_word()
1116 el->el_line.cursor++; in vi_history_word()
1117 c_insert(el, len + 1); in vi_history_word()
1118 cp = el->el_line.cursor; in vi_history_word()
1119 lim = el->el_line.limit; in vi_history_word()
1124 el->el_line.cursor = cp; in vi_history_word()
1126 el->el_map.current = el->el_map.key; in vi_history_word()
1136 vi_redo(EditLine *el, Int c __attribute__((__unused__))) in vi_redo() argument
1138 c_redo_t *r = &el->el_chared.c_redo; in vi_redo()
1140 if (!el->el_state.doingarg && r->count) { in vi_redo()
1141 el->el_state.doingarg = 1; in vi_redo()
1142 el->el_state.argument = r->count; in vi_redo()
1145 el->el_chared.c_vcmd.pos = el->el_line.cursor; in vi_redo()
1146 el->el_chared.c_vcmd.action = r->action; in vi_redo()
1152 FUN(el,push)(el, r->buf); in vi_redo()
1155 el->el_state.thiscmd = r->cmd; in vi_redo()
1156 el->el_state.thisch = r->ch; in vi_redo()
1157 return (*el->el_map.func[r->cmd])(el, r->ch); in vi_redo()