mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -05:00
Remove broken and unused format to add an indent function to a line.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4982 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
9dcea776a1
commit
fd6bd4d829
@ -81,22 +81,6 @@ static void format_expand_code(const char **format, GString *out, int *flags)
|
||||
else if (**format == '-')
|
||||
set = FALSE;
|
||||
else switch (**format) {
|
||||
case 'i':
|
||||
/* indent function */
|
||||
(*format)++;
|
||||
if (**format == '=')
|
||||
(*format)++;
|
||||
|
||||
g_string_append_c(out, 4);
|
||||
g_string_append_c(out, FORMAT_STYLE_INDENT_FUNC);
|
||||
while (**format != ']' && **format != '\0' &&
|
||||
**format != ',') {
|
||||
g_string_append_c(out, **format);
|
||||
(*format)++;
|
||||
}
|
||||
g_string_append_c(out, ',');
|
||||
(*format)--;
|
||||
break;
|
||||
case 's':
|
||||
case 'S':
|
||||
*flags |= !set ? PRINT_FLAG_UNSET_LINE_START :
|
||||
@ -1029,18 +1013,6 @@ void format_send_to_gui(TEXT_DEST_REC *dest, const char *text)
|
||||
case FORMAT_STYLE_INDENT:
|
||||
flags |= GUI_PRINT_FLAG_INDENT;
|
||||
break;
|
||||
case FORMAT_STYLE_INDENT_FUNC: {
|
||||
const char *start = ptr;
|
||||
while (*ptr != ',' && *ptr != '\0')
|
||||
ptr++;
|
||||
if (*ptr != '\0') *ptr++ = '\0';
|
||||
ptr--;
|
||||
signal_emit_id(signal_gui_print_text, 6,
|
||||
dest->window, NULL, NULL,
|
||||
GINT_TO_POINTER(GUI_PRINT_FLAG_INDENT_FUNC),
|
||||
start, dest);
|
||||
break;
|
||||
}
|
||||
case FORMAT_STYLE_DEFAULTS:
|
||||
fgcolor = theme->default_color;
|
||||
bgcolor = -1;
|
||||
|
@ -10,7 +10,6 @@
|
||||
#define GUI_PRINT_FLAG_BLINK 0x0008
|
||||
#define GUI_PRINT_FLAG_MIRC_COLOR 0x0010
|
||||
#define GUI_PRINT_FLAG_INDENT 0x0020
|
||||
#define GUI_PRINT_FLAG_INDENT_FUNC 0x0040
|
||||
#define GUI_PRINT_FLAG_NEWLINE 0x0080
|
||||
#define GUI_PRINT_FLAG_CLRTOEOL 0x0100
|
||||
#define GUI_PRINT_FLAG_MONOSPACE 0x0200
|
||||
@ -129,7 +128,6 @@ void format_send_to_gui(TEXT_DEST_REC *dest, const char *text);
|
||||
#define FORMAT_STYLE_BOLD (0x03 + FORMAT_STYLE_SPECIAL)
|
||||
#define FORMAT_STYLE_REVERSE (0x04 + FORMAT_STYLE_SPECIAL)
|
||||
#define FORMAT_STYLE_INDENT (0x05 + FORMAT_STYLE_SPECIAL)
|
||||
#define FORMAT_STYLE_INDENT_FUNC (0x06 + FORMAT_STYLE_SPECIAL)
|
||||
#define FORMAT_STYLE_DEFAULTS (0x07 + FORMAT_STYLE_SPECIAL)
|
||||
#define FORMAT_STYLE_CLRTOEOL (0x08 + FORMAT_STYLE_SPECIAL)
|
||||
#define FORMAT_STYLE_MONOSPACE (0x09 + FORMAT_STYLE_SPECIAL)
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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 */
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user