1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[plain] one level of indentation less

This commit is contained in:
Witold Filipczyk 2021-08-10 18:21:01 +02:00
parent d43028a0cf
commit b1317c3e46

View File

@ -857,24 +857,23 @@ fixup_tables(struct plain_renderer *renderer)
struct line *next_line = y < renderer->lineno - 1 ? &renderer->document->data[y + 1] : NULL; struct line *next_line = y < renderer->lineno - 1 ? &renderer->document->data[y + 1] : NULL;
for (x = 0; x < line->length; x++) { for (x = 0; x < line->length; x++) {
#ifdef CONFIG_UTF8
unicode_val_T ch = line->chars[x].data;
#else
unsigned char ch = line->chars[x].data;
#endif
if (ch == '+' || ch == '-' || ch == '|') {
int dir; int dir;
#ifdef CONFIG_UTF8 #ifdef CONFIG_UTF8
unicode_val_T prev_char = x > 0 ? line->chars[x - 1].data : ' '; unicode_val_T ch = line->chars[x].data;
unicode_val_T next_char = x < line->length - 1 ? line->chars[x + 1].data : ' '; unicode_val_T prev_char, next_char, up_char, down_char;
unicode_val_T up_char = (prev_line && x < prev_line->length) ? prev_line->chars[x].data : ' ';
unicode_val_T down_char = (next_line && x < next_line->length) ? next_line->chars[x].data : ' ';
#else #else
unsigned char prev_char = x > 0 ? line->chars[x - 1].data : ' '; unsigned char ch = line->chars[x].data;
unsigned char next_char = x < line->length - 1 ? line->chars[x + 1].data : ' '; unsigned char prev_char, next_char, up_char, down_char;
unsigned char up_char = (prev_line && x < prev_line->length) ? prev_line->chars[x].data : ' ';
unsigned char down_char = (next_line && x < next_line->length) ? next_line->chars[x].data : ' ';
#endif #endif
if (ch != '+' && ch != '-' && ch != '|') {
continue;
}
prev_char = x > 0 ? line->chars[x - 1].data : ' ';
next_char = x < line->length - 1 ? line->chars[x + 1].data : ' ';
up_char = (prev_line && x < prev_line->length) ? prev_line->chars[x].data : ' ';
down_char = (next_line && x < next_line->length) ? next_line->chars[x].data : ' ';
switch (ch) { switch (ch) {
case '+': case '+':
dir = 0; dir = 0;
@ -952,7 +951,6 @@ fixup_tables(struct plain_renderer *renderer)
} }
} }
} }
}
void void
render_plain_document(struct cache_entry *cached, struct document *document, render_plain_document(struct cache_entry *cached, struct document *document,