edlin by 51b

char*t[9],s[20][99];i,j,m,n,l;p(i,s){printf("%8d:%c%s\n",i,i-n?32:42,s);}I(){for(;p(n,gets(s[i])),s[i][0]-94;t[n++]=s[i++],l++)for(j=l;j>n;)t[j--]=t[j-1];}d(){for(j=n;j<l;)t[j++]=t[j+1];l--;}S(){for(j=m;!index(t[j],102);j++);p(j,t[j]);n=j;}T(){for(j=m;j<l;j++)index(t[j],102)?p(j,t[j]),puts("O.K.? n"),gets(s[i]):0;puts("Not found");}L(){for(j=1;j<l;)p(j++,t[j]);}main(){puts("New file");for(l=n=1;gets(s[i]);i++){printf("*%s\n",s[i]);m=s[i][0]-48,j=s[i][1],m-57?m-60?m-65?j%5?j%7?S():T():(n=m,j?j%7?d():I():(p(n,t[n]),t[n]=gets(s[i++]),p(n,t[n]))):(puts("Abort edit (Y/N)? y"),gets(s[i])):L():I();}}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page