00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046 #include "compat.h"
00047
00048
00049
00050 #include "sys.h"
00051 #include "el.h"
00052
00053
00054
00055
00056
00057 el_protected ElAction_t
00058
00059 ed_end_of_file(EditLine_t* el, int ) {
00060 re_goto_bottom(el);
00061 *el->fLine.fLastChar = '\0';
00062 return CC_EOF;
00063 }
00064
00065
00066
00067
00068
00069
00070 el_protected ElAction_t
00071 ed_insert(EditLine_t* el, int c) {
00072 int i;
00073
00074 if (c == '\0') {
00075 return CC_ERROR;
00076 }
00077
00078 if (el->fLine.fLastChar + el->fState.fArgument >=
00079 el->fLine.fLimit) {
00080
00081 if (!ch_enlargebufs(el, (size_t) el->fState.fArgument)) {
00082 return CC_ERROR;
00083 }
00084 }
00085
00086 if (el->fState.fArgument == 1) {
00087 if (el->fState.fInputMode != MODE_INSERT) {
00088 el->fCharEd.fUndo.fBuf[el->fCharEd.fUndo.fISize++] =
00089 *el->fLine.fCursor;
00090 el->fCharEd.fUndo.fBuf[el->fCharEd.fUndo.fISize] =
00091 '\0';
00092 c_delafter(el, 1);
00093 }
00094 c_insert(el, 1);
00095
00096
00097 el->fLine.fBufColor[el->fLine.fCursor - el->fLine.fBuffer] = -1;
00098
00099 *el->fLine.fCursor++ = c;
00100
00101 el->fState.fDoingArg = 0;
00102 re_fastaddc(el);
00103
00104 } else {
00105 if (el->fState.fInputMode != MODE_INSERT) {
00106 for (i = 0; i < el->fState.fArgument; i++) {
00107 el->fCharEd.fUndo.fBuf[el->fCharEd.fUndo.fISize++] =
00108 el->fLine.fCursor[i];
00109 }
00110
00111 el->fCharEd.fUndo.fBuf[el->fCharEd.fUndo.fISize] =
00112 '\0';
00113 c_delafter(el, el->fState.fArgument);
00114 }
00115 c_insert(el, el->fState.fArgument);
00116
00117 while (el->fState.fArgument--) {
00118
00119 el->fLine.fBufColor[el->fLine.fCursor - el->fLine.fBuffer] = -1;
00120
00121 *el->fLine.fCursor++ = c;
00122 }
00123 re_refresh(el);
00124 }
00125
00126
00127
00128
00129
00130
00131 return CC_NORM;
00132 }
00133
00134
00135
00136
00137
00138
00139 el_protected ElAction_t
00140
00141 ed_delete_prev_word(EditLine_t* el, int ) {
00142 char* cp, * p, * kp;
00143
00144 if (el->fLine.fCursor == el->fLine.fBuffer) {
00145 return CC_ERROR;
00146 }
00147
00148 cp = c__prev_word(el->fLine.fCursor, el->fLine.fBuffer,
00149 el->fState.fArgument, ce__isword);
00150
00151 for (p = cp, kp = el->fCharEd.fKill.fBuf; p < el->fLine.fCursor; p++) {
00152 *kp++ = *p;
00153 }
00154 el->fCharEd.fKill.fLast = kp;
00155
00156 c_delbefore(el, el->fLine.fCursor - cp);
00157 el->fLine.fCursor = cp;
00158
00159 if (el->fLine.fCursor < el->fLine.fBuffer) {
00160 el->fLine.fCursor = el->fLine.fBuffer;
00161 }
00162 return CC_REFRESH;
00163 }
00164
00165
00166
00167
00168
00169
00170 el_protected ElAction_t
00171
00172 ed_delete_next_char(EditLine_t* el, int ) {
00173 #ifdef notdef
00174 # define EL el->fLine
00175 (void) fprintf(el->el_errlfile,
00176 "\nD(b: %x(%s) c: %x(%s) last: %x(%s) limit: %x(%s)\n",
00177 EL.fBuffer, EL.fBuffer, EL.fCursor, EL.fCursor, EL.fLastChar,
00178 EL.fLastChar, EL.fLimit, EL.fLimit);
00179 #endif
00180
00181 if (el->fLine.fCursor == el->fLine.fLastChar) {
00182
00183 if (el->fMap.fType == MAP_VI) {
00184 if (el->fLine.fCursor == el->fLine.fBuffer) {
00185
00186 #ifdef KSHVI
00187 return CC_ERROR;
00188 #else
00189 term_overwrite(el, STReof, 0, 4);
00190
00191 term__flush();
00192 return CC_EOF;
00193 #endif
00194 } else {
00195 #ifdef KSHVI
00196 el->fLine.fCursor--;
00197 #else
00198 return CC_ERROR;
00199 #endif
00200 }
00201 } else {
00202 if (el->fLine.fCursor != el->fLine.fBuffer) {
00203 el->fLine.fCursor--;
00204 } else {
00205 return CC_ERROR;
00206 }
00207 }
00208 }
00209 c_delafter(el, el->fState.fArgument);
00210
00211 if (el->fLine.fCursor >= el->fLine.fLastChar &&
00212 el->fLine.fCursor > el->fLine.fBuffer) {
00213
00214 el->fLine.fCursor = el->fLine.fLastChar - 1;
00215 }
00216 return CC_REFRESH;
00217 }
00218
00219
00220
00221
00222
00223
00224 el_protected ElAction_t
00225
00226 ed_kill_line(EditLine_t* el, int ) {
00227 char* kp, * cp;
00228
00229 cp = el->fLine.fCursor;
00230 kp = el->fCharEd.fKill.fBuf;
00231
00232 while (cp < el->fLine.fLastChar)
00233 *kp++ = *cp++;
00234 el->fCharEd.fKill.fLast = kp;
00235
00236 el->fLine.fLastChar = el->fLine.fCursor;
00237 return CC_REFRESH;
00238 }
00239
00240
00241
00242
00243
00244
00245 el_protected ElAction_t
00246
00247 ed_move_to_end(EditLine_t* el, int ) {
00248 el->fLine.fCursor = el->fLine.fLastChar;
00249
00250 if (el->fMap.fType == MAP_VI) {
00251 #ifdef VI_MOVE
00252 el->fLine.fCursor--;
00253 #endif
00254
00255 if (el->fCharEd.fVCmd.fAction & DELETE) {
00256 cv_delfini(el);
00257 return CC_REFRESH;
00258 }
00259 }
00260 return CC_CURSOR;
00261 }
00262
00263
00264
00265
00266
00267
00268 el_protected ElAction_t
00269
00270 ed_move_to_beg(EditLine_t* el, int ) {
00271 el->fLine.fCursor = el->fLine.fBuffer;
00272
00273 if (el->fMap.fType == MAP_VI) {
00274
00275 while (isspace((unsigned char) *el->fLine.fCursor))
00276 el->fLine.fCursor++;
00277
00278 if (el->fCharEd.fVCmd.fAction & DELETE) {
00279 cv_delfini(el);
00280 return CC_REFRESH;
00281 }
00282 }
00283 return CC_CURSOR;
00284 }
00285
00286
00287
00288
00289
00290
00291 el_protected ElAction_t
00292 ed_transpose_chars(EditLine_t* el, int c) {
00293 if (el->fLine.fCursor < el->fLine.fLastChar) {
00294 if (el->fLine.fLastChar <= &el->fLine.fBuffer[1]) {
00295 return CC_ERROR;
00296 } else {
00297 el->fLine.fCursor++;
00298 }
00299 }
00300
00301 if (el->fLine.fCursor > &el->fLine.fBuffer[1]) {
00302
00303 c = el->fLine.fCursor[-2];
00304 el->fLine.fCursor[-2] = el->fLine.fCursor[-1];
00305 el->fLine.fCursor[-1] = c;
00306 return CC_REFRESH;
00307 } else {
00308 return CC_ERROR;
00309 }
00310 }
00311
00312
00313
00314
00315
00316
00317 el_protected ElAction_t
00318
00319 ed_next_char(EditLine_t* el, int ) {
00320 if (el->fLine.fCursor >= el->fLine.fLastChar) {
00321 return CC_ERROR;
00322 }
00323
00324 el->fLine.fCursor += el->fState.fArgument;
00325
00326 if (el->fLine.fCursor > el->fLine.fLastChar) {
00327 el->fLine.fCursor = el->fLine.fLastChar;
00328 }
00329
00330 if (el->fMap.fType == MAP_VI) {
00331 if (el->fCharEd.fVCmd.fAction & DELETE) {
00332 cv_delfini(el);
00333 return CC_REFRESH;
00334 }
00335 }
00336 return CC_CURSOR;
00337 }
00338
00339
00340
00341
00342
00343
00344 el_protected ElAction_t
00345
00346 ed_prev_word(EditLine_t* el, int ) {
00347 if (el->fLine.fCursor == el->fLine.fBuffer) {
00348 return CC_ERROR;
00349 }
00350
00351 el->fLine.fCursor = c__prev_word(el->fLine.fCursor,
00352 el->fLine.fBuffer,
00353 el->fState.fArgument,
00354 ce__isword);
00355
00356 if (el->fMap.fType == MAP_VI) {
00357 if (el->fCharEd.fVCmd.fAction & DELETE) {
00358 cv_delfini(el);
00359 return CC_REFRESH;
00360 }
00361 }
00362 return CC_CURSOR;
00363 }
00364
00365
00366
00367
00368
00369
00370 el_protected ElAction_t
00371
00372 ed_prev_char(EditLine_t* el, int ) {
00373 if (el->fLine.fCursor > el->fLine.fBuffer) {
00374 el->fLine.fCursor -= el->fState.fArgument;
00375
00376 if (el->fLine.fCursor < el->fLine.fBuffer) {
00377 el->fLine.fCursor = el->fLine.fBuffer;
00378 }
00379
00380 if (el->fMap.fType == MAP_VI) {
00381 if (el->fCharEd.fVCmd.fAction & DELETE) {
00382 cv_delfini(el);
00383 return CC_REFRESH;
00384 }
00385 }
00386 return CC_CURSOR;
00387 } else {
00388 return CC_ERROR;
00389 }
00390 }
00391
00392
00393
00394
00395
00396
00397 el_protected ElAction_t
00398 ed_quoted_insert(EditLine_t* el, int c) {
00399 int num;
00400 char tc;
00401
00402 tty_quotemode(el);
00403 num = el_getc(el, &tc);
00404 c = (unsigned char) tc;
00405 tty_noquotemode(el);
00406
00407 if (num == 1) {
00408 return ed_insert(el, c);
00409 } else {
00410 return ed_end_of_file(el, 0);
00411 }
00412 }
00413
00414
00415
00416
00417
00418 el_protected ElAction_t
00419 ed_digit(EditLine_t* el, int c) {
00420 if (!isdigit(c)) {
00421 return CC_ERROR;
00422 }
00423
00424 if (el->fState.fDoingArg) {
00425
00426 if (el->fState.fLastCmd == EM_UNIVERSAL_ARGUMENT) {
00427 el->fState.fArgument = c - '0';
00428 } else {
00429 if (el->fState.fArgument > 1000000) {
00430 return CC_ERROR;
00431 }
00432 el->fState.fArgument =
00433 (el->fState.fArgument * 10) + (c - '0');
00434 }
00435 return CC_ARGHACK;
00436 } else {
00437 if (el->fLine.fLastChar + 1 >= el->fLine.fLimit) {
00438 if (!ch_enlargebufs(el, 1)) {
00439 return CC_ERROR;
00440 }
00441 }
00442
00443 if (el->fState.fInputMode != MODE_INSERT) {
00444 el->fCharEd.fUndo.fBuf[el->fCharEd.fUndo.fISize++] =
00445 *el->fLine.fCursor;
00446 el->fCharEd.fUndo.fBuf[el->fCharEd.fUndo.fISize] =
00447 '\0';
00448 c_delafter(el, 1);
00449 }
00450 c_insert(el, 1);
00451
00452
00453 el->fLine.fBufColor[el->fLine.fCursor - el->fLine.fBuffer] = -1;
00454
00455 *el->fLine.fCursor++ = c;
00456
00457 el->fState.fDoingArg = 0;
00458 re_fastaddc(el);
00459 }
00460 return CC_NORM;
00461 }
00462
00463
00464
00465
00466
00467
00468 el_protected ElAction_t
00469 ed_argument_digit(EditLine_t* el, int c) {
00470 if (!isdigit(c)) {
00471 return CC_ERROR;
00472 }
00473
00474 if (el->fState.fDoingArg) {
00475 if (el->fState.fArgument > 1000000) {
00476 return CC_ERROR;
00477 }
00478 el->fState.fArgument = (el->fState.fArgument * 10) +
00479 (c - '0');
00480 } else {
00481 el->fState.fArgument = c - '0';
00482 el->fState.fDoingArg = 1;
00483 }
00484 return CC_ARGHACK;
00485 }
00486
00487
00488
00489
00490
00491
00492 el_protected ElAction_t
00493
00494 ed_unassigned(EditLine_t* el, int ) {
00495 term_beep(el);
00496 term__flush();
00497 return CC_NORM;
00498 }
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509 el_protected ElAction_t
00510
00511 ed_tty_sigint(EditLine_t* , int ) {
00512 return CC_NORM;
00513 }
00514
00515
00516
00517
00518
00519
00520 el_protected ElAction_t
00521
00522 ed_tty_dsusp(EditLine_t* , int ) {
00523 return CC_NORM;
00524 }
00525
00526
00527
00528
00529
00530
00531 el_protected ElAction_t
00532
00533 ed_tty_flush_output(EditLine_t* , int ) {
00534 return CC_NORM;
00535 }
00536
00537
00538
00539
00540
00541
00542 el_protected ElAction_t
00543
00544 ed_tty_sigquit(EditLine_t* , int ) {
00545 return CC_NORM;
00546 }
00547
00548
00549
00550
00551
00552
00553 el_protected ElAction_t
00554
00555 ed_tty_sigtstp(EditLine_t* , int ) {
00556 return CC_NORM;
00557 }
00558
00559
00560
00561
00562
00563
00564 el_protected ElAction_t
00565
00566 ed_tty_stop_output(EditLine_t* , int ) {
00567 return CC_NORM;
00568 }
00569
00570
00571
00572
00573
00574
00575 el_protected ElAction_t
00576
00577 ed_tty_start_output(EditLine_t* , int ) {
00578 return CC_NORM;
00579 }
00580
00581
00582
00583
00584
00585
00586 el_protected ElAction_t
00587
00588 ed_newline(EditLine_t* el, int ) {
00589 re_goto_bottom(el);
00590
00591
00592
00593
00594
00595 *el->fLine.fLastChar = '\0';
00596
00597 if (el->fMap.fType == MAP_VI) {
00598 el->fCharEd.fVCmd.fIns = el->fLine.fBuffer;
00599 }
00600 return CC_NEWLINE;
00601 }
00602
00603
00604
00605
00606
00607
00608 el_protected ElAction_t
00609
00610 ed_delete_prev_char(EditLine_t* el, int ) {
00611 if (el->fLine.fCursor <= el->fLine.fBuffer) {
00612 return CC_ERROR;
00613 }
00614
00615 c_delbefore(el, el->fState.fArgument);
00616 el->fLine.fCursor -= el->fState.fArgument;
00617
00618 if (el->fLine.fCursor < el->fLine.fBuffer) {
00619 el->fLine.fCursor = el->fLine.fBuffer;
00620 }
00621 return CC_REFRESH;
00622 }
00623
00624
00625
00626
00627
00628
00629 el_protected ElAction_t
00630
00631 ed_clear_screen(EditLine_t* el, int ) {
00632 term_clear_screen(el);
00633 re_clear_display(el);
00634 return CC_REFRESH;
00635 }
00636
00637
00638
00639
00640
00641
00642 el_protected ElAction_t
00643
00644 ed_redisplay(EditLine_t* , int ) {
00645 return CC_REDISPLAY;
00646 }
00647
00648
00649
00650
00651
00652
00653 el_protected ElAction_t
00654
00655 ed_start_over(EditLine_t* el, int ) {
00656 ch_reset(el);
00657 return CC_REFRESH;
00658 }
00659
00660
00661
00662
00663
00664
00665 el_protected ElAction_t
00666
00667 ed_sequence_lead_in(EditLine_t* , int ) {
00668 return CC_NORM;
00669 }
00670
00671
00672
00673
00674
00675
00676 el_protected ElAction_t
00677
00678 ed_prev_history(EditLine_t* el, int ) {
00679 char beep = 0;
00680
00681 el->fCharEd.fUndo.fAction = NOP;
00682 *el->fLine.fLastChar = '\0';
00683
00684 if (el->fHistory.fEventNo == 0) {
00685
00686 (void) strncpy(el->fHistory.fBuf, el->fLine.fBuffer,
00687 EL_BUFSIZ);
00688 el->fHistory.fLast = el->fHistory.fBuf +
00689 (el->fLine.fLastChar - el->fLine.fBuffer);
00690 }
00691 el->fHistory.fEventNo += el->fState.fArgument;
00692
00693 if (hist_get(el) == CC_ERROR) {
00694 beep = 1;
00695
00696 (void) hist_get(el);
00697 }
00698 re_refresh(el);
00699
00700 if (beep) {
00701 return CC_ERROR;
00702 } else {
00703 return CC_NORM;
00704 }
00705 }
00706
00707
00708
00709
00710
00711
00712 el_protected ElAction_t
00713
00714 ed_next_history(EditLine_t* el, int ) {
00715 el->fCharEd.fUndo.fAction = NOP;
00716 *el->fLine.fLastChar = '\0';
00717
00718 if (el->fHistory.fEventNo == 0 && el->fState.fArgument == 1) {
00719
00720
00721 el->fLine.fCursor = el->fLine.fBuffer;
00722 return ed_kill_line(el, 0);
00723 } else {
00724 el->fHistory.fEventNo -= el->fState.fArgument;
00725
00726 if (el->fHistory.fEventNo < 0) {
00727 el->fHistory.fEventNo = 0;
00728 return CC_ERROR;
00729 }
00730 }
00731 return hist_get(el);
00732 }
00733
00734
00735
00736
00737
00738
00739 el_protected ElAction_t
00740
00741 ed_search_prev_history(EditLine_t* el, int ) {
00742 const char* hp;
00743 int h;
00744 ElBool_t found = 0;
00745
00746 el->fCharEd.fVCmd.fAction = NOP;
00747 el->fCharEd.fUndo.fAction = NOP;
00748 *el->fLine.fLastChar = '\0';
00749
00750 if (el->fHistory.fEventNo < 0) {
00751 #ifdef DEBUG_EDIT
00752 (void) fprintf(el->fErrFile,
00753 "e_prev_search_hist(): eventno < 0;\n");
00754 #endif
00755 el->fHistory.fEventNo = 0;
00756 return CC_ERROR;
00757 }
00758
00759 if (el->fHistory.fEventNo == 0) {
00760 (void) strncpy(el->fHistory.fBuf, el->fLine.fBuffer,
00761 EL_BUFSIZ);
00762 el->fHistory.fLast = el->fHistory.fBuf +
00763 (el->fLine.fLastChar - el->fLine.fBuffer);
00764 }
00765
00766 if (el->fHistory.fRef == NULL) {
00767 return CC_ERROR;
00768 }
00769
00770 hp = HIST_FIRST(el);
00771
00772 if (hp == NULL) {
00773 return CC_ERROR;
00774 }
00775
00776 c_setpat(el);
00777
00778 for (h = 1; h <= el->fHistory.fEventNo; h++) {
00779 hp = HIST_NEXT(el);
00780 }
00781
00782 while (hp != NULL) {
00783 #ifdef SDEBUG
00784 (void) fprintf(el->fErrFile, "Comparing with \"%s\"\n", hp);
00785 #endif
00786
00787 if ((strncmp(hp, el->fLine.fBuffer, (size_t)
00788 (el->fLine.fLastChar - el->fLine.fBuffer)) ||
00789 hp[el->fLine.fLastChar - el->fLine.fBuffer]) &&
00790 c_hmatch(el, hp)) {
00791 found++;
00792 break;
00793 }
00794 h++;
00795 hp = HIST_NEXT(el);
00796 }
00797
00798 if (!found) {
00799 #ifdef SDEBUG
00800 (void) fprintf(el->fErrFile, "not found\n");
00801 #endif
00802 return CC_ERROR;
00803 }
00804 el->fHistory.fEventNo = h;
00805
00806 return hist_get(el);
00807 }
00808
00809
00810
00811
00812
00813
00814 el_protected ElAction_t
00815
00816 ed_search_next_history(EditLine_t* el, int ) {
00817 const char* hp;
00818 int h;
00819 ElBool_t found = 0;
00820
00821 el->fCharEd.fVCmd.fAction = NOP;
00822 el->fCharEd.fUndo.fAction = NOP;
00823 *el->fLine.fLastChar = '\0';
00824
00825 if (el->fHistory.fEventNo == 0) {
00826 return CC_ERROR;
00827 }
00828
00829 if (el->fHistory.fRef == NULL) {
00830 return CC_ERROR;
00831 }
00832
00833 hp = HIST_FIRST(el);
00834
00835 if (hp == NULL) {
00836 return CC_ERROR;
00837 }
00838
00839 c_setpat(el);
00840
00841 for (h = 1; h < el->fHistory.fEventNo && hp; h++) {
00842 #ifdef SDEBUG
00843 (void) fprintf(el->fErrFile, "Comparing with \"%s\"\n", hp);
00844 #endif
00845
00846 if ((strncmp(hp, el->fLine.fBuffer, (size_t)
00847 (el->fLine.fLastChar - el->fLine.fBuffer)) ||
00848 hp[el->fLine.fLastChar - el->fLine.fBuffer]) &&
00849 c_hmatch(el, hp)) {
00850 found = h;
00851 }
00852 hp = HIST_NEXT(el);
00853 }
00854
00855 if (!found) {
00856 if (!c_hmatch(el, el->fHistory.fBuf)) {
00857 #ifdef SDEBUG
00858 (void) fprintf(el->fErrFile, "not found\n");
00859 #endif
00860 return CC_ERROR;
00861 }
00862 }
00863 el->fHistory.fEventNo = found;
00864
00865 return hist_get(el);
00866 }
00867
00868
00869
00870
00871
00872
00873 el_protected ElAction_t
00874
00875 ed_prev_line(EditLine_t* el, int ) {
00876 char* ptr;
00877 int nchars = c_hpos(el);
00878
00879
00880
00881
00882 if (*(ptr = el->fLine.fCursor) == '\n') {
00883 ptr--;
00884 }
00885
00886 for ( ; ptr >= el->fLine.fBuffer; ptr--) {
00887 if (*ptr == '\n' && --el->fState.fArgument <= 0) {
00888 break;
00889 }
00890 }
00891
00892 if (el->fState.fArgument > 0) {
00893 return CC_ERROR;
00894 }
00895
00896
00897
00898
00899 for (ptr--; ptr >= el->fLine.fBuffer && *ptr != '\n'; ptr--) {
00900 continue;
00901 }
00902
00903
00904
00905
00906 for (ptr++;
00907 nchars-- > 0 && ptr < el->fLine.fLastChar && *ptr != '\n';
00908 ptr++) {
00909 continue;
00910 }
00911
00912 el->fLine.fCursor = ptr;
00913 return CC_CURSOR;
00914 }
00915
00916
00917
00918
00919
00920
00921 el_protected ElAction_t
00922
00923 ed_next_line(EditLine_t* el, int ) {
00924 char* ptr;
00925 int nchars = c_hpos(el);
00926
00927
00928
00929
00930 for (ptr = el->fLine.fCursor; ptr < el->fLine.fLastChar; ptr++) {
00931 if (*ptr == '\n' && --el->fState.fArgument <= 0) {
00932 break;
00933 }
00934 }
00935
00936 if (el->fState.fArgument > 0) {
00937 return CC_ERROR;
00938 }
00939
00940
00941
00942
00943 for (ptr++;
00944 nchars-- > 0 && ptr < el->fLine.fLastChar && *ptr != '\n';
00945 ptr++) {
00946 continue;
00947 }
00948
00949 el->fLine.fCursor = ptr;
00950 return CC_CURSOR;
00951 }
00952
00953
00954
00955
00956
00957
00958 el_protected ElAction_t
00959
00960 ed_command(EditLine_t* el, int ) {
00961 char tmpbuf[EL_BUFSIZ];
00962 int tmplen;
00963
00964 el->fLine.fBuffer[0] = '\0';
00965 el->fLine.fLastChar = el->fLine.fBuffer;
00966 el->fLine.fCursor = el->fLine.fBuffer;
00967
00968 c_insert(el, 3);
00969
00970
00971 el->fLine.fBufColor[el->fLine.fCursor - el->fLine.fBuffer] = -1;
00972
00973 *el->fLine.fCursor++ = '\n';
00974
00975
00976 el->fLine.fBufColor[el->fLine.fCursor - el->fLine.fBuffer] = -1;
00977
00978 *el->fLine.fCursor++ = ':';
00979
00980
00981 el->fLine.fBufColor[el->fLine.fCursor - el->fLine.fBuffer] = -1;
00982
00983 *el->fLine.fCursor++ = ' ';
00984
00985 re_refresh(el);
00986
00987 tmplen = c_gets(el, tmpbuf);
00988 tmpbuf[tmplen] = '\0';
00989
00990 el->fLine.fBuffer[0] = '\0';
00991 el->fLine.fLastChar = el->fLine.fBuffer;
00992 el->fLine.fCursor = el->fLine.fBuffer;
00993
00994 if (parse_line(el, tmpbuf) == -1) {
00995 return CC_ERROR;
00996 } else {
00997 return CC_REFRESH;
00998 }
00999 }
01000
01001
01002
01003
01004
01005
01006 el_protected ElAction_t
01007
01008 ed_replay_hist(EditLine_t* el, int ) {
01009 static const char newline[] = "\n";
01010
01011 if (el->fState.fReplayHist < 0) {
01012
01013 el->fState.fReplayHist = el->fHistory.fEventNo - 1;
01014 }
01015
01016 el_push(el, newline);
01017
01018
01019 return ed_newline(el, '\n');
01020 }