summaryrefslogtreecommitdiff
path: root/src/fe-text
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-03-03 18:22:09 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-03-03 18:22:09 +0000
commitfcd8810b6ca21551ca3ca9c99a5b18e38c4baca4 (patch)
tree6811e74d1cf64c17937317837cfd4a2ac958d6eb /src/fe-text
parent88094fa9f28476241c1fb39ca937defe37b60e4f (diff)
downloadirssi-fcd8810b6ca21551ca3ca9c99a5b18e38c4baca4.zip
Removed all beep handling from text printing. If you want to beep just
send "beep" signal. /LAST -clear crashed if window contained only lastlog lines. Some other minor cleanups. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1312 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text')
-rw-r--r--src/fe-text/gui-printtext.c8
-rw-r--r--src/fe-text/gui-windows.c26
2 files changed, 20 insertions, 14 deletions
diff --git a/src/fe-text/gui-printtext.c b/src/fe-text/gui-printtext.c
index 9fbf14b1..6f6dd829 100644
--- a/src/fe-text/gui-printtext.c
+++ b/src/fe-text/gui-printtext.c
@@ -184,6 +184,12 @@ void gui_window_line_remove(WINDOW_REC *window, LINE_REC *line, int redraw)
gui = WINDOW_GUI(window);
+ if (gui->lines->next == NULL) {
+ /* last line in window */
+ gui_window_clear(window);
+ return;
+ }
+
screenchange = g_list_find(gui->startline, line) != NULL;
if (screenchange) gui->ypos -= gui_window_get_linecount(gui, line);
@@ -363,8 +369,6 @@ static void line_add_colors(GUI_WINDOW_REC *gui, int fg, int bg, int flags)
buffer[pos++] = 0;
buffer[pos++] = LINE_CMD_INDENT;
}
- if (flags & PRINTFLAG_BEEP)
- signal_emit("beep", 0);
linebuf_add(gui, (char *) buffer, pos);
diff --git a/src/fe-text/gui-windows.c b/src/fe-text/gui-windows.c
index f791cc9a..d206f62e 100644
--- a/src/fe-text/gui-windows.c
+++ b/src/fe-text/gui-windows.c
@@ -270,7 +270,8 @@ static LINE_CACHE_REC *gui_window_line_cache(GUI_WINDOW_REC *gui,
LINE_CACHE_REC *rec;
LINE_CACHE_SUB_REC *sub;
GSList *lines;
- unsigned char *ptr, *last_space_ptr;
+ unsigned char cmd;
+ char *ptr, *last_space_ptr;
int xpos, pos, indent_pos, last_space, last_color, color;
g_return_val_if_fail(line->text != NULL, NULL);
@@ -282,25 +283,28 @@ static LINE_CACHE_REC *gui_window_line_cache(GUI_WINDOW_REC *gui,
last_space = last_color = 0; last_space_ptr = NULL; sub = NULL;
rec->count = 1; lines = NULL;
- for (ptr = (unsigned char *) line->text;;) {
+ for (ptr = line->text;;) {
if (*ptr == '\0') {
/* command */
ptr++;
- if (*ptr == LINE_CMD_EOL || *ptr == LINE_CMD_FORMAT)
+ cmd = *ptr;
+ ptr++;
+
+ if (cmd == LINE_CMD_EOL || cmd == LINE_CMD_FORMAT)
break;
- if (*ptr == LINE_CMD_CONTINUE) {
- unsigned char *tmp;
+ if (cmd == LINE_CMD_CONTINUE) {
+ char *tmp;
- memcpy(&tmp, ptr+1, sizeof(char *));
+ memcpy(&tmp, ptr, sizeof(char *));
ptr = tmp;
continue;
}
- if ((*ptr & 0x80) == 0) {
+ if ((cmd & 0x80) == 0) {
/* set color */
- color = (color & ATTR_UNDERLINE) | *ptr;
- } else switch (*ptr) {
+ color = (color & ATTR_UNDERLINE) | cmd;
+ } else switch (cmd) {
case LINE_CMD_UNDERLINE:
color ^= ATTR_UNDERLINE;
break;
@@ -320,8 +324,6 @@ static LINE_CACHE_REC *gui_window_line_cache(GUI_WINDOW_REC *gui,
if (xpos < COLS-5) indent_pos = xpos;
break;
}
-
- ptr++;
continue;
}
@@ -347,7 +349,7 @@ static LINE_CACHE_REC *gui_window_line_cache(GUI_WINDOW_REC *gui,
sub->continues = TRUE;
}
- sub->start = (char *) ptr;
+ sub->start = ptr;
sub->indent = xpos;
sub->color = color;