Buffer size reverted from debug value to current standard. Comments updated.
Some checks failed
CI Code / Linux (arch) (pull_request) Successful in 12m42s
CI Code / Check coding style (pull_request) Failing after 4m59s
CI Code / Check spelling (pull_request) Failing after 6m38s
CI Code / Linux (ubuntu) (pull_request) Successful in 15m23s
CI Code / Linux (debian) (pull_request) Successful in 18m2s
Some checks failed
CI Code / Linux (arch) (pull_request) Successful in 12m42s
CI Code / Check coding style (pull_request) Failing after 4m59s
CI Code / Check spelling (pull_request) Failing after 6m38s
CI Code / Linux (ubuntu) (pull_request) Successful in 15m23s
CI Code / Linux (debian) (pull_request) Successful in 18m2s
This commit is contained in:
@@ -98,7 +98,7 @@ _buffer_add(ProfBuff buffer, const char* show_char, int pad_indent, GDateTime* t
|
||||
buffer->lines += e->_lines;
|
||||
|
||||
// With 10% margin to ensure overflow prevention
|
||||
while (buffer->lines >= 190 && g_slist_length(buffer->entries) > 1) {
|
||||
while (buffer->lines >= PAD_SIZE - (PAD_SIZE / 10) && g_slist_length(buffer->entries) > 1) {
|
||||
log_debug("DELETING");
|
||||
// Delete message from the opposite size to free buffer
|
||||
GSList* buffer_entry_to_delete = append ? buffer->entries : g_slist_last(buffer->entries);
|
||||
|
||||
@@ -750,7 +750,8 @@ win_page_down(ProfWin* window, int scroll_size)
|
||||
win_update_virtual(window);
|
||||
}
|
||||
|
||||
// switch off page if no messages left to read
|
||||
/*switch off page if no messages left to read
|
||||
TODO: update buffer end handling to check meassages just after last entry*/
|
||||
if (*scroll_state == WIN_SCROLL_REACHED_BOTTOM) {
|
||||
window->layout->paged = 0;
|
||||
window->layout->unread_msg = 0;
|
||||
@@ -1703,22 +1704,11 @@ static void
|
||||
_win_printf(ProfWin* window, const char* show_char, int pad_indent, GDateTime* timestamp, int flags, theme_item_t theme_item, const char* const display_from, const char* const from_jid, const char* const message_id, const char* const message, ...)
|
||||
{
|
||||
|
||||
/* Test code start
|
||||
TODO:
|
||||
- TOLERABLE check window->layout->paged handling for reliability (if buffer size is less than window size [SCROLLING] not set)
|
||||
- make a propper condition check for differernt cases
|
||||
- DONE add a user notification in header when new messages arrive while scrolling history
|
||||
- DONE handle SCROLLED state properly in case of incominf messages (currently it is cleared before new message is printed)
|
||||
|
||||
Description: this code prevents printing and buffer when user is viewing message history [SCROLLING]
|
||||
|
||||
#warning "TEST CODE: temporary/test code present in window.c:1709 - remove before release"*/
|
||||
|
||||
/* Prevent printing and buffer update when user is viewing message history [SCROLLING]*/
|
||||
if ((window->layout->paged) && wins_is_current(window)) {
|
||||
window->layout->unread_msg++;
|
||||
return;
|
||||
}
|
||||
/* Test code end */
|
||||
|
||||
if (timestamp == NULL) {
|
||||
timestamp = g_date_time_new_now_local();
|
||||
|
||||
Reference in New Issue
Block a user