fix: build without charsets

This commit is contained in:
Ilia Maslakov 2009-04-20 19:10:33 +00:00
parent 17c4e67cb2
commit 83c10b2f6e
2 changed files with 9 additions and 2 deletions

View File

@ -2385,6 +2385,7 @@ edit_execute_cmd (WEdit *edit, int command, int char_for_insertion)
if (edit_get_byte (edit, edit->curs1) != '\n')
edit_delete (edit);
}
#ifdef HAVE_CHARSET
if ( char_for_insertion > 255 && utf8_display == 0 ) {
unsigned char str[6 + 1];
int res = g_unichar_to_utf8 (char_for_insertion, str);
@ -2401,8 +2402,11 @@ edit_execute_cmd (WEdit *edit, int command, int char_for_insertion)
i++;
}
} else {
#endif
edit_insert (edit, char_for_insertion);
#ifdef HAVE_CHARSET
}
#endif
if (option_auto_para_formatting) {
format_paragraph (edit, 0);
edit->force |= REDRAW_PAGE;

View File

@ -484,16 +484,19 @@ edit_draw_this_line (WEdit *edit, long b, long row, long start_col,
col += 2;
break;
}
#ifndef HAVE_CHARSET
int utf8_display = 0;
#endif
if (!edit->utf8) {
if ( ( utf8_display && g_unichar_isprint (c) ) ||
( utf8_display == 0 && is_printable (c) ) ) {
p->ch = c;
p++;
} else {
} else {
p->ch = '.';
p->style = MOD_ABNORMAL;
p++;
}
}
} else {
if ( g_unichar_isprint (c) ) {
p->ch = c;