| 427 |
break; |
break; |
| 428 |
case KEY_F2: // For test only |
case KEY_F2: // For test only |
| 429 |
EDITOR_DATA *p_editor_data; |
EDITOR_DATA *p_editor_data; |
| 430 |
// size_t data_new_len = strlen(p_data) + LINE_BUFFER_LEN; |
size_t data_new_len = strlen(p_data) + LINE_BUFFER_LEN; |
| 431 |
|
|
| 432 |
// char *p_data_new = malloc(data_new_len); |
char *p_data_new = malloc(data_new_len); |
| 433 |
// if (p_data_new == NULL) |
if (p_data_new == NULL) |
| 434 |
// { |
{ |
| 435 |
// break; |
break; |
| 436 |
// } |
} |
| 437 |
p_editor_data = editor_data_load(p_data); |
p_editor_data = editor_data_load(p_data); |
| 438 |
if (p_editor_data == NULL) |
if (p_editor_data == NULL) |
| 439 |
{ |
{ |
| 440 |
// free(p_data_new); |
free(p_data_new); |
| 441 |
break; |
break; |
| 442 |
} |
} |
| 443 |
|
|
| 444 |
editor_display(p_editor_data); |
editor_display(p_editor_data); |
| 445 |
// editor_data_save(p_editor_data, p_data_new, data_new_len); |
editor_data_save(p_editor_data, p_data_new, data_new_len); |
| 446 |
editor_data_cleanup(p_editor_data); |
editor_data_cleanup(p_editor_data); |
| 447 |
p_editor_data = NULL; |
p_editor_data = NULL; |
| 448 |
// free(p_data_new); |
free(p_data_new); |
| 449 |
// p_data_new = NULL; |
p_data_new = NULL; |
| 450 |
|
|
| 451 |
// Refresh after display editor |
// Refresh after display editor |
| 452 |
line_current -= (screen_current_row - screen_begin_row); |
line_current -= (screen_current_row - screen_begin_row); |