More detail for Motif version, and change button labels on help browser to be more...
[nedit.git] / doc / faq-txt.awk
blob848f58ea419d31b52c8b65e4e72ed615fa51c9eb
2 function wrap(line, prefix)
5 wrapMargin = 75;
7 if (length(line) < wrapMargin) {
8 print prefix line;
9 } else {
11 count = split(line, words);
13 indent = match(line, /[^ ]/)
15 indentStr = substr( \
16 " ", \
17 1, indent - 1);
19 result = "";
20 for (w = 1; w <= count; w++) {
21 if (length(result) + length(words[w]) > wrapMargin - indent) {
22 # print a new line
23 print prefix indentStr result;
24 result = words[w];
25 } else {
26 if (w == 1)
27 result = words[w]
28 else
29 result = result " " words[w];
32 print prefix indentStr result;
39 BEGIN { prefixed = 0; pre = 0 }
40 /^PREFIXED$/ {prefixed = 1; next }
41 /^NOT_PREFIXED$/ {prefixed = 0; next }
42 /^PRE$/ {pre = 1; next }
43 /^NOT_PRE$/ {pre = 0; next }
45 if (pre) {
46 if (prefixed) print "> " $0;
47 else print $0;
48 } else {
49 if (prefixed) wrap($0, "> ");
50 else wrap($0, "")