• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/ksh-20/ksh/src/cmd/ksh93/edit/

Lines Matching refs:ep

124 #define	editb		(*ep->ed)
146 #define location ep->_location
185 register Emacs_t *ep = ed->e_emacs;
191 if(!ep)
193 ep = ed->e_emacs = newof(0,Emacs_t,1,0);
194 ep->ed = ed;
195 ep->prevdirection = 1;
199 ep->screen = Screen;
200 ep->lastdraw = FINAL;
208 ed_setup(ep->ed,fd,reedit);
233 ep->in_mult = hloff; /* save pos in last command */
238 if(ep->ed->e_multiline)
241 draw(ep,FINAL);
242 ed_flush(ep->ed);
254 ep->mark = 0;
256 draw(ep,reedit?REFRESH:FIRST);
259 if (ep->CntrlO)
262 ed_ungetchar(ep->ed,cntl('N'));
273 ed_ungetchar(ep->ed,cntl('Y'));
277 ep->CntrlO = 0;
278 while ((c = ed_getchar(ep->ed,0)) != (-1))
290 draw(ep,APPEND);
322 c = ed_getchar(ep->ed,2);
325 show_info(ep,fmtident(e_version));
328 ep->mark = i;
331 xcommands(ep,count);
334 ed_flush(ep->ed);
343 if(cur>0 && ep->ed->sh->nextprompt)
345 if(ep->ed->e_tabcount==0)
347 ep->ed->e_tabcount=1;
348 ed_ungetchar(ep->ed,ESC);
351 else if(ep->ed->e_tabcount==1)
353 ed_ungetchar(ep->ed,'=');
356 ep->ed->e_tabcount = 0;
363 ed_ungetchar(ep->ed,c); /* save character for next line */
370 draw(ep,APPEND);
380 ep->mark = i;
386 draw(ep,UPDATE);
424 ep->mark = i;
430 if (ep->mark > eol )
431 ep->mark = eol;
432 if (ep->mark == i)
434 if (ep->mark > i)
436 adjust = ep->mark - i;
437 ed_ungetchar(ep->ed,cntl('D'));
440 adjust = i - ep->mark;
441 ed_ungetchar(ep->ed,usrerase);
444 ep->mark = i;
492 c = ed_getchar(ep->ed,1);
516 draw(ep,UPDATE);
559 ep->mark = count;
560 ed_ungetchar(ep->ed,cntl('W'));
565 ep->mark = i;
576 draw(ep,UPDATE);
579 if (ep->terminal == PAPER)
581 putchar(ep->ed,'\n');
582 putstring(ep,Prompt);
584 c = ed_getchar(ep->ed,0);
587 ed_ungetchar(ep->ed,c);
590 if (ep->terminal == PAPER)
591 ep->terminal = CRT;
594 ep->terminal = PAPER;
595 putchar(ep->ed,'\n');
596 putstring(ep,Prompt);
601 if(!ep->ed->e_nocrnl)
602 ed_crlf(ep->ed);
603 draw(ep,REFRESH);
604 ep->ed->e_nocrnl = 0;
608 adjust = escape(ep,out,oadjust);
611 search(ep,out,count);
615 if(ep->ed->hlist)
617 if(ep->ed->hoff == 0)
622 ep->ed->hoff--;
650 ep->CntrlO = 1;
655 if(ep->ed->hlist)
657 if(ep->ed->hoff >= ep->ed->hmax)
662 ep->ed->hoff++;
664 ed_histlist(ep->ed,*ep->ed->hlist!=0);
665 draw(ep,REFRESH);
679 location.hist_line = ep->in_mult;
692 draw(ep,UPDATE);
700 draw(ep,UPDATE);
714 draw(ep,FINAL);
725 ed_crlf(ep->ed);
736 static void show_info(Emacs_t *ep,const char *str)
751 draw(ep,UPDATE);
752 c = ed_getchar(ep->ed,0);
754 ed_ungetchar(ep->ed,c);
758 draw(ep,UPDATE);
761 static void putstring(Emacs_t* ep,register char *sp)
765 putchar(ep->ed,c);
769 static int escape(register Emacs_t* ep,register genchar *out,int count)
775 while ((i=ed_getchar(ep->ed,0)),isdigit(i))
783 ed_ungetchar(ep->ed,i) ;
795 show_info(ep,fmtident(e_version));
798 ep->mark = cur;
808 ed_ungetchar(ep->ed,cntl('Y'));
809 ed_ungetchar(ep->ed,cntl('W'));
845 draw(ep,UPDATE);
853 ed_ungetchar(ep->ed,cntl('C'));
860 ed_ungetchar(ep->ed,cntl('D'));
890 ed_ungetchar(ep->ed,usrerase);
899 ed_ungetchar(ep->ed,cntl('N'));
901 if (ep->in_mult)
904 location.hist_line = ep->in_mult - 1;
918 ed_ungetchar(ep->ed,cntl('P'));
929 ed_ungetchar(ep->ed,'\n');
930 ed_ungetchar(ep->ed,(out[0]=='#')?cntl('D'):'#');
931 ed_ungetchar(ep->ed,cntl('A'));
950 ep->mark = cur;
958 draw(ep,UPDATE);
965 if(!ep->ed->hlist)
971 ed_ungetchar(ep->ed,'\n');
976 if(ep->ed->hlist)
978 value += ep->ed->hoff;
979 if(value > ep->ed->nhlist)
983 value = histlines - ep->ed->hlist[value-1]->index;
984 ed_histlist(ep->ed,0);
985 ed_ungetchar(ep->ed,cntl('P'));
993 ep->mark = cur;
994 if(ed_expand(ep->ed,(char*)out,&cur,&eol,i,count) < 0)
996 if(ep->ed->e_tabcount==1)
998 ep->ed->e_tabcount=2;
999 ed_ungetchar(ep->ed,cntl('\t'));
1006 draw(ep,REFRESH);
1008 ep->ed->e_tabcount=0;
1011 i=ed_getchar(ep->ed,0);
1012 ed_ungetchar(ep->ed,i);
1014 ed_ungetchar(ep->ed,ESC);
1019 if(i=='\\' && cur>ep->mark && (out[cur-1]=='/' || out[cur-1]==' '))
1020 ep->ed->e_tabcount=0;
1021 draw(ep,UPDATE);
1028 int c = ed_getchar(ep->ed,1);
1054 draw(ep,UPDATE);
1060 draw(ep,REFRESH);
1064 switch(i=ed_getchar(ep->ed,1))
1068 if(!ep->ed->hlist && cur>0 && eol==cur && (cur<(SEARCHSIZE-2) || ep->prevdirection == -2))
1070 if(cur>0 && eol==cur && (cur<(SEARCHSIZE-2) || ep->prevdirection == -2))
1073 if(ep->lastdraw==APPEND && ep->prevdirection != -2)
1081 ep->prevdirection = -2;
1085 ed_ungetchar(ep->ed,'\r');
1086 ed_ungetchar(ep->ed,cntl('R'));
1091 ed_ungetchar(ep->ed,cntl('P'));
1094 ed_ungetchar(ep->ed,cntl('N'));
1097 ed_ungetchar(ep->ed,cntl('F'));
1100 ed_ungetchar(ep->ed,cntl('B'));
1103 ed_ungetchar(ep->ed,cntl('A'));
1106 ed_ungetchar(ep->ed,cntl('E'));
1109 ed_ungetchar(ep->ed,i);
1115 if(ed_macro(ep->ed,i))
1124 draw(ep,UPDATE);
1140 static void xcommands(register Emacs_t *ep,int count)
1142 register int i = ed_getchar(ep->ed,0);
1147 if (ep->mark > eol)
1148 ep->mark = eol;
1149 i = ep->mark;
1150 ep->mark = cur;
1152 draw(ep,UPDATE);
1158 if(ed_fulledit(ep->ed)==-1)
1165 ed_ungetchar(ep->ed,'\n');
1195 show_info(ep,hbuf);
1216 show_info(ep,debugbuf);
1229 static void search(Emacs_t* ep,genchar *out,int direction)
1245 draw(ep,UPDATE);
1246 while ((i = ed_getchar(ep->ed,1))&&(i != '\r')&&(i != '\n'))
1254 draw(ep,UPDATE);
1260 if(i == ep->ed->e_intr)
1272 draw(ep,APPEND);
1273 i = ed_getchar(ep->ed,1);
1279 draw(ep,APPEND);
1283 if(ep->prevdirection == -2 && i!=2 || direction!=1)
1284 ep->prevdirection = -1;
1287 ep->prevdirection = -ep->prevdirection;
1298 ep->prevdirection = direction;
1301 direction = ep->prevdirection ;
1340 static void draw(register Emacs_t *ep,Draw_t option)
1360 ep->lastdraw = option;
1364 ep->overflow = NORMAL;
1365 ep->cursor = ep->screen;
1366 ep->offset = 0;
1367 ep->cr_ok = crallowed;
1370 ep->scvalid = 1;
1373 *ep->cursor = '\0';
1374 putstring(ep,Prompt); /* start with prompt */
1384 ep->scvalid = 0; /* Screen is out of date, APPEND will not work */
1401 if(ep->ed->hlist)
1402 ed_histlist(ep->ed,0);
1411 n = ed_histgen(ep->ed,(char*)drawbuff);
1415 if(ep->ed->hlist)
1417 ed_histlist(ep->ed,n);
1418 putstring(ep,Prompt);
1419 ed_setcursor(ep->ed,ep->screen,0,ep->cursor-ep->screen, 0);
1427 if ((option == APPEND)&&(ep->scvalid)&&(*logcursor == '\0')&&
1428 print(i)&&((ep->cursor-ep->screen)<(w_size-1)))
1430 putchar(ep->ed,i);
1431 *ep->cursor++ = i;
1432 *ep->cursor = '\0';
1437 ncursor = nptr + ed_virt_to_phys(ep->ed,sptr,nptr,cur,0,0);
1451 if ((ep->offset && i<=ep->offset)||(i >= (ep->offset+w_size)))
1454 ep->offset = i - (w_size>>1);
1455 if (--ep->offset < 0)
1456 ep->offset = 0;
1465 nptr = &nscreen[ep->offset];
1466 sptr = ep->screen;
1489 setcursor(ep,sptr-ep->screen,*nptr);
1498 ep->cursor++;
1502 if(ep->ed->e_multiline && option == REFRESH && ep->ed->e_nocrnl==0)
1503 ed_setcursor(ep->ed, ep->screen, ep->cursor-ep->screen, ep->ed->e_peol, -1);
1512 if (nscend >= &nscreen[ep->offset+w_size])
1514 if (ep->offset > 0)
1521 if (ep->offset > 0)
1527 if (longline != ep->overflow)
1529 setcursor(ep,w_size,longline);
1530 ep->overflow = longline;
1532 i = (ncursor-nscreen) - ep->offset;
1533 setcursor(ep,i,0);
1534 if(option==FINAL && ep->ed->e_multiline)
1535 setcursor(ep,nscend+1-nscreen,0);
1536 ep->scvalid = 1;
1546 static void setcursor(register Emacs_t *ep,register int newp,int c)
1548 register int oldp = ep->cursor - ep->screen;
1549 newp = ed_setcursor(ep->ed, ep->screen, oldp, newp, 0);
1552 putchar(ep->ed,c);
1555 ep->cursor = ep->screen+newp;