diff options
Diffstat (limited to 'src/fe-text')
-rw-r--r-- | src/fe-text/textbuffer-view.c | 39 | ||||
-rw-r--r-- | src/fe-text/textbuffer.c | 5 | ||||
-rw-r--r-- | src/fe-text/textbuffer.h | 1 |
3 files changed, 0 insertions, 45 deletions
diff --git a/src/fe-text/textbuffer-view.c b/src/fe-text/textbuffer-view.c index 135c5323..bea2fc38 100644 --- a/src/fe-text/textbuffer-view.c +++ b/src/fe-text/textbuffer-view.c @@ -204,11 +204,6 @@ view_update_line_cache(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line) /* set indentation position here - don't do it if we're too close to right border */ if (xpos < view->width-5) indent_pos = xpos; - } else if (cmd == LINE_CMD_INDENT_FUNC) { - memcpy(&indent_func, ptr, sizeof(INDENT_FUNC)); - ptr += sizeof(INDENT_FUNC); - if (indent_func == NULL) - indent_func = view->default_indent_func; } else update_cmd_color(cmd, &color); continue; @@ -427,8 +422,6 @@ static int view_line_draw(TEXT_BUFFER_VIEW_REC *view, LINE_REC *line, memcpy(&tmp, text+1, sizeof(unsigned char *)); text = tmp; continue; - } else if (*text == LINE_CMD_INDENT_FUNC) { - text += sizeof(INDENT_FUNC); } else { update_cmd_color(*text, &color); term_set_color(view->window, color); @@ -609,10 +602,6 @@ void textbuffer_view_set_default_indent(TEXT_BUFFER_VIEW_REC *view, static void view_unregister_indent_func(TEXT_BUFFER_VIEW_REC *view, INDENT_FUNC indent_func) { - INDENT_FUNC func; - LINE_REC *line; - const unsigned char *text, *tmp; - if (view->default_indent_func == indent_func) view->default_indent_func = NULL; @@ -620,34 +609,6 @@ static void view_unregister_indent_func(TEXT_BUFFER_VIEW_REC *view, to the indent function */ view_reset_cache(view); view->cache = textbuffer_cache_get(view->siblings, view->width); - - /* remove all references to the indent function from buffer */ - line = view->buffer->first_line; - while (line != NULL) { - text = line->text; - - for (text = line->text;; text++) { - if (*text != '\0') - continue; - - text++; - if (*text == LINE_CMD_EOL) - break; - - if (*text == LINE_CMD_INDENT_FUNC) { - text++; - memcpy(&func, text, sizeof(INDENT_FUNC)); - if (func == indent_func) - memset(&func, 0, sizeof(INDENT_FUNC)); - text += sizeof(INDENT_FUNC); - } else if (*text == LINE_CMD_CONTINUE) { - memcpy(&tmp, text+1, sizeof(char *)); - text = tmp-1; - } - } - - line = line->next; - } } void textbuffer_views_unregister_indent_func(INDENT_FUNC indent_func) diff --git a/src/fe-text/textbuffer.c b/src/fe-text/textbuffer.c index a8fed004..f078e90e 100644 --- a/src/fe-text/textbuffer.c +++ b/src/fe-text/textbuffer.c @@ -138,8 +138,6 @@ static void text_chunk_line_free(TEXT_BUFFER_REC *buffer, LINE_REC *line) break; text = tmp-1; - } else if (cmd == LINE_CMD_INDENT_FUNC) { - text += sizeof(int (*) ()); } } } @@ -446,9 +444,6 @@ void textbuffer_line2text(LINE_REC *line, int coloring, GString *str) g_string_sprintfa(str, "\004%c", FORMAT_STYLE_INDENT); break; - case LINE_CMD_INDENT_FUNC: - ptr += sizeof(void *); - break; } } } diff --git a/src/fe-text/textbuffer.h b/src/fe-text/textbuffer.h index e3b8f1f4..e5d78487 100644 --- a/src/fe-text/textbuffer.h +++ b/src/fe-text/textbuffer.h @@ -15,7 +15,6 @@ enum { LINE_CMD_UNDERLINE, /* enable/disable underlining */ LINE_CMD_REVERSE, /* enable/disable reversed text */ LINE_CMD_INDENT, /* if line is split, indent it at this position */ - LINE_CMD_INDENT_FUNC, /* if line is split, use the specified indentation function */ LINE_CMD_BLINK, /* enable/disable blink */ LINE_CMD_BOLD, /* enable/disable bold */ }; |