From: Art Cancro Date: Tue, 21 Mar 2000 03:23:27 +0000 (+0000) Subject: * Experimental new linebreak mode X-Git-Tag: v7.86~7242 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=e071fd4f8d0cbf180af464142e1752c9ddbb9243;p=citadel.git * Experimental new linebreak mode --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index f80f95c8e..557fa1ea1 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,7 @@ $Log$ + Revision 570.2 2000/03/21 03:23:24 ajc + * Experimental new linebreak mode + Revision 570.1 2000/03/20 14:43:19 ajc * "Brown paper bag" fix for SMTP bug (incoming long fields crash logger) @@ -1771,3 +1774,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/messages.c b/citadel/messages.c index cbfe2b249..7e22f0032 100644 --- a/citadel/messages.c +++ b/citadel/messages.c @@ -213,18 +213,18 @@ void citedit(FILE *fp) add_word(textlist,"\n"); add_newline(textlist); add_word(textlist,""); - } } + } else { wordbuf[strlen(wordbuf)+1] = 0; wordbuf[strlen(wordbuf)] = a; - } + } if (strlen(wordbuf)+3 > screenwidth) { add_word(textlist,wordbuf); strcpy(wordbuf,""); - } - prev = a; } + prev = a; + } /* get text */ finished = 0; @@ -236,18 +236,28 @@ void citedit(FILE *fp) if (a==10) a=13; if (a==9) a=32; if (a==127) a=8; + + + /******* new ***********/ + if ((a>32)&&(a<127)&&(prev==13)) { + add_word(textlist,"\n"); + printf(" "); + } + /***********************/ + if ((a==32)&&(prev==13)) { add_word(textlist,"\n"); add_newline(textlist); - } + } + if (a==8) { if (strlen(wordbuf)>0) { wordbuf[strlen(wordbuf)-1] = 0; putc(8,stdout); putc(32,stdout); putc(8,stdout); - } } + } else if (a==13) { printf("\n"); if (strlen(wordbuf)==0) finished = 1; @@ -258,16 +268,16 @@ void citedit(FILE *fp) add_word(textlist,wordbuf); strcpy(wordbuf,&wordbuf[b+1]); b=0; - } + } add_word(textlist,wordbuf); strcpy(wordbuf,""); - } } + } else { putc(a,stdout); wordbuf[strlen(wordbuf)+1] = 0; wordbuf[strlen(wordbuf)] = a; - } + } if ((strlen(wordbuf)+3) > screenwidth) { last_space = (-1); for (b=0; bnext; free(textlist); textlist=ptr; - } } +} int read_message(long int num, char pagin) /* Read a message from the server */ diff --git a/citadel/messages/entermsg b/citadel/messages/entermsg index c9473abf7..09a3a9016 100644 --- a/citadel/messages/entermsg +++ b/citadel/messages/entermsg @@ -1 +1,3 @@ -Entering message -- end by hitting return twice. +Entering message. Word wrap will give you soft linebreaks. Pressing the +'enter' key will give you a hard linebreak and an indent. Press 'enter' twice +when finished.