Mercurial > ~mikael > mcabber > hg
comparison mcabber/mcabber/screen.c @ 1954:256cfc706ae5
Update readmark support
Fix two small issues with readmarks.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Mon, 14 Mar 2011 14:25:21 +0100 |
parents | aec86670047b |
children | fad27c72a229 |
comparison
equal
deleted
inserted
replaced
1953:9f443617e96b | 1954:256cfc706ae5 |
---|---|
1172 | 1172 |
1173 if (CHAT_WIN_HEIGHT > 1) { | 1173 if (CHAT_WIN_HEIGHT > 1) { |
1174 // Do we have a read mark? | 1174 // Do we have a read mark? |
1175 for (n = 0; n < CHAT_WIN_HEIGHT; n++) { | 1175 for (n = 0; n < CHAT_WIN_HEIGHT; n++) { |
1176 line = *(lines+n); | 1176 line = *(lines+n); |
1177 if (line && line->flags & HBB_PREFIX_READMARK) { | 1177 if (line) { |
1178 // If this is not the last line, we'll display a mark | 1178 if (line->flags & HBB_PREFIX_READMARK) { |
1179 if (n+1 < CHAT_WIN_HEIGHT && *(lines+n+1)) | 1179 // If this is not the last line, we'll display a mark |
1180 readmark = TRUE; | 1180 if (n+1 < CHAT_WIN_HEIGHT && *(lines+n+1)) { |
1181 readmark = TRUE; | |
1182 skipline = TRUE; | |
1183 mark_offset = -1; | |
1184 } | |
1185 } | |
1186 } else if (readmark) { | |
1187 // There will be empty lines, so we don't need to skip the first line | |
1188 skipline = FALSE; | |
1189 mark_offset = 0; | |
1181 } | 1190 } |
1182 } | 1191 } |
1183 } | |
1184 | |
1185 // Skip first line if there's a mark | |
1186 if (readmark) { | |
1187 skipline = TRUE; | |
1188 mark_offset = -1; | |
1189 } | 1192 } |
1190 | 1193 |
1191 // Display the lines | 1194 // Display the lines |
1192 for (n = 0 ; n < CHAT_WIN_HEIGHT; n++) { | 1195 for (n = 0 ; n < CHAT_WIN_HEIGHT; n++) { |
1193 int winy = n + mark_offset; | 1196 int winy = n + mark_offset; |
1470 | 1473 |
1471 if (!dont_show) { | 1474 if (!dont_show) { |
1472 if (win_entry->bd->lock) | 1475 if (win_entry->bd->lock) |
1473 setmsgflg = TRUE; | 1476 setmsgflg = TRUE; |
1474 // If this is an outgoing message, update readmark | 1477 // If this is an outgoing message, update readmark |
1475 if (!special && (prefix_flags & HBB_PREFIX_OUT)) | 1478 if (!special && (prefix_flags & (HBB_PREFIX_OUT|HBB_PREFIX_HLIGHT_OUT))) |
1476 hbuf_set_readmark(win_entry->bd->hbuf, FALSE); | 1479 hbuf_set_readmark(win_entry->bd->hbuf, FALSE); |
1477 // Show and refresh the window | 1480 // Show and refresh the window |
1478 top_panel(win_entry->panel); | 1481 top_panel(win_entry->panel); |
1479 scr_update_window(win_entry); | 1482 scr_update_window(win_entry); |
1480 top_panel(inputPanel); | 1483 top_panel(inputPanel); |