This commit is contained in:
Ilia Maslakov 2009-05-05 14:27:26 +00:00
parent 39b327825b
commit 279787d2fc
3 changed files with 14 additions and 11 deletions

View File

@ -269,13 +269,15 @@ book_mark_collapse_insert (GList *list, const int start_line, const int end_line
int sl = 0; int sl = 0;
int el = 0; int el = 0;
mc_log("book_mark_collapse_insert \n");
while (link) { while ( link ) {
newlink = g_list_previous (link); newlink = g_list_previous (link);
q = (struct collapsed_lines *) link->data; q = (struct collapsed_lines *) link->data;
sl = q->start_line; sl = q->start_line;
el = q->end_line; el = q->end_line;
if (((sl == start_line) || (el == end_line) || mc_log("link\n");
/*if (((sl == start_line) || (el == end_line) ||
(sl == end_line) || (el == start_line)) || (sl == end_line) || (el == start_line)) ||
((sl < start_line) && (el > start_line) && (el < end_line)) || ((sl < start_line) && (el > start_line) && (el < end_line)) ||
((sl > start_line) && (sl < end_line) && (el > end_line))) { ((sl > start_line) && (sl < end_line) && (el > end_line))) {
@ -283,6 +285,7 @@ book_mark_collapse_insert (GList *list, const int start_line, const int end_line
tmp = g_list_remove_link (list, link); tmp = g_list_remove_link (list, link);
g_list_free_1 (link); g_list_free_1 (link);
} }
*/
link = newlink; link = newlink;
} }
return list; return list;
@ -325,8 +328,8 @@ int book_mark_get_collapse_state (GList * list, const int line)
int state; int state;
int c = 0; int c = 0;
// mc_log("start_line: %ld, end_line: %ld, line: %ld [%i]\n", start_line, end_line, line, c);
c = book_mark_collapse_query (list, line, &start_line, &end_line, &state); c = book_mark_collapse_query (list, line, &start_line, &end_line, &state);
mc_log("start_line: %ld, end_line: %ld, line: %ld [%i]\n", start_line, end_line, line, c);
if ( c == 0 ) if ( c == 0 )
return C_LINES_DEFAULT; return C_LINES_DEFAULT;
if ( line == start_line ) { if ( line == start_line ) {

View File

@ -2689,7 +2689,7 @@ edit_execute_cmd (WEdit *edit, int command, int char_for_insertion)
} }
unsigned int end_line = start_line + lines_selected; unsigned int end_line = start_line + lines_selected;
mc_log("lines_selected:%ld\n", lines_selected); mc_log("lines_selected:%ld\n", lines_selected);
book_mark_collapse_insert (edit->collapsed, start_line, end_line, 1); edit->collapsed = book_mark_collapse_insert (edit->collapsed, start_line, end_line, 1);
} }
edit->force |= REDRAW_PAGE; edit->force |= REDRAW_PAGE;
break; break;

View File

@ -383,7 +383,7 @@ edit_draw_this_line (WEdit *edit, long b, long row, long start_col,
line_stat[0] = '|'; line_stat[0] = '|';
break; break;
case C_LINES_LAST: case C_LINES_LAST:
line_stat[0] = '\\'; line_stat[0] = '_';
break; break;
} }
} }
@ -614,7 +614,7 @@ render_edit_text (WEdit * edit, long start_row, long start_column, long end_row,
goto exit_render; goto exit_render;
cur_line = edit->start_line + row; cur_line = edit->start_line + row;
mc_log("REDRAW_PAGE cur_line:%i\n", cur_line); mc_log("REDRAW_PAGE cur_line:%i\n", cur_line);
collapse_state = book_mark_get_collapse_state(edit, cur_line); collapse_state = book_mark_get_collapse_state(edit->collapsed, cur_line);
if ( collapse_state != C_LINES_MIDDLE_C ) { if ( collapse_state != C_LINES_MIDDLE_C ) {
edit_draw_this_line (edit, b, row, start_column, end_column, collapse_state); edit_draw_this_line (edit, b, row, start_column, end_column, collapse_state);
} }
@ -633,7 +633,7 @@ render_edit_text (WEdit * edit, long start_row, long start_column, long end_row,
if (key_pending (edit)) if (key_pending (edit))
goto exit_render; goto exit_render;
cur_line = edit->start_line + row; cur_line = edit->start_line + row;
collapse_state = book_mark_get_collapse_state(edit, cur_line); collapse_state = book_mark_get_collapse_state(edit->collapsed, cur_line);
if ( collapse_state != C_LINES_MIDDLE_C ) { if ( collapse_state != C_LINES_MIDDLE_C ) {
edit_draw_this_line (edit, b, row, start_column, end_column, edit_draw_this_line (edit, b, row, start_column, end_column,
collapse_state); collapse_state);
@ -649,7 +649,7 @@ render_edit_text (WEdit * edit, long start_row, long start_column, long end_row,
if (key_pending (edit)) if (key_pending (edit))
goto exit_render; goto exit_render;
cur_line = edit->start_line + curs_row; cur_line = edit->start_line + curs_row;
collapse_state = book_mark_get_collapse_state(edit, cur_line); collapse_state = book_mark_get_collapse_state(edit->collapsed, cur_line);
if ( collapse_state != C_LINES_MIDDLE_C ) { if ( collapse_state != C_LINES_MIDDLE_C ) {
edit_draw_this_line (edit, b, curs_row, start_column, end_column, edit_draw_this_line (edit, b, curs_row, start_column, end_column,
collapse_state); collapse_state);
@ -663,7 +663,7 @@ render_edit_text (WEdit * edit, long start_row, long start_column, long end_row,
if (key_pending (edit)) if (key_pending (edit))
goto exit_render; goto exit_render;
cur_line = edit->start_line + row; cur_line = edit->start_line + row;
collapse_state = book_mark_get_collapse_state(edit, cur_line); collapse_state = book_mark_get_collapse_state(edit->collapsed, cur_line);
if ( collapse_state != C_LINES_MIDDLE_C ) { if ( collapse_state != C_LINES_MIDDLE_C ) {
edit_draw_this_line (edit, b, row, start_column, end_column, collapse_state); edit_draw_this_line (edit, b, row, start_column, end_column, collapse_state);
} }
@ -679,7 +679,7 @@ render_edit_text (WEdit * edit, long start_row, long start_column, long end_row,
if (key_pending (edit)) if (key_pending (edit))
goto exit_render; goto exit_render;
cur_line = edit->start_line + row; cur_line = edit->start_line + row;
collapse_state = book_mark_get_collapse_state(edit, cur_line); collapse_state = book_mark_get_collapse_state(edit->collapsed, cur_line);
if ( collapse_state != C_LINES_MIDDLE_C ) { if ( collapse_state != C_LINES_MIDDLE_C ) {
edit_draw_this_line (edit, b, row, start_column, end_column, collapse_state); edit_draw_this_line (edit, b, row, start_column, end_column, collapse_state);
} }
@ -693,7 +693,7 @@ render_edit_text (WEdit * edit, long start_row, long start_column, long end_row,
if (key_pending (edit)) if (key_pending (edit))
goto exit_render; goto exit_render;
cur_line = edit->start_line + row; cur_line = edit->start_line + row;
collapse_state = book_mark_get_collapse_state(edit, cur_line); collapse_state = book_mark_get_collapse_state(edit->collapsed, cur_line);
if ( collapse_state != C_LINES_MIDDLE_C ) { if ( collapse_state != C_LINES_MIDDLE_C ) {
edit_draw_this_line (edit, b, row, start_column, end_column, collapse_state); edit_draw_this_line (edit, b, row, start_column, end_column, collapse_state);
} }