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') if (edit_get_byte (edit, edit->curs1) != '\n')
edit_delete (edit); edit_delete (edit);
} }
#ifdef HAVE_CHARSET
if ( char_for_insertion > 255 && utf8_display == 0 ) { if ( char_for_insertion > 255 && utf8_display == 0 ) {
unsigned char str[6 + 1]; unsigned char str[6 + 1];
int res = g_unichar_to_utf8 (char_for_insertion, str); 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++; i++;
} }
} else { } else {
#endif
edit_insert (edit, char_for_insertion); edit_insert (edit, char_for_insertion);
#ifdef HAVE_CHARSET
} }
#endif
if (option_auto_para_formatting) { if (option_auto_para_formatting) {
format_paragraph (edit, 0); format_paragraph (edit, 0);
edit->force |= REDRAW_PAGE; edit->force |= REDRAW_PAGE;

View File

@ -484,6 +484,9 @@ edit_draw_this_line (WEdit *edit, long b, long row, long start_col,
col += 2; col += 2;
break; break;
} }
#ifndef HAVE_CHARSET
int utf8_display = 0;
#endif
if (!edit->utf8) { if (!edit->utf8) {
if ( ( utf8_display && g_unichar_isprint (c) ) || if ( ( utf8_display && g_unichar_isprint (c) ) ||
( utf8_display == 0 && is_printable (c) ) ) { ( utf8_display == 0 && is_printable (c) ) ) {