diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2011-05-16 15:33:44 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2011-05-16 15:33:44 +0200 |
commit | e3e20f2b60972bcaa845d1000fe615498dd2cef5 (patch) | |
tree | f6ee65eeaa3d5a9b0f9694c10b7ad538870d0da0 /src/gui/curses/gui-curses-chat.c | |
parent | bd1db541f782c8ec9a5545bb9ba7f49870c43574 (diff) | |
download | weechat-e3e20f2b60972bcaa845d1000fe615498dd2cef5.zip |
core: add horizontal scrolling for buffers with free content (command /window scroll_horiz) (task #11112)
Diffstat (limited to 'src/gui/curses/gui-curses-chat.c')
-rw-r--r-- | src/gui/curses/gui-curses-chat.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c index 819c3a985..34740ed13 100644 --- a/src/gui/curses/gui-curses-chat.c +++ b/src/gui/curses/gui-curses-chat.c @@ -255,7 +255,7 @@ gui_chat_display_word_raw (struct t_gui_window *window, const char *string, int max_chars_on_screen, int display) { char *next_char, *output, utf_char[16]; - int chars_displayed, size_on_screen; + int chars_displayed, display_char, size_on_screen; if (display) wmove (GUI_WINDOW_OBJECTS(window)->win_chat, @@ -279,6 +279,9 @@ gui_chat_display_word_raw (struct t_gui_window *window, const char *string, if (!gui_chat_utf_char_valid (utf_char)) snprintf (utf_char, sizeof (utf_char), " "); + display_char = (window->buffer->type != GUI_BUFFER_TYPE_FREE) + || (chars_displayed >= window->scroll->start_col); + size_on_screen = utf8_strlen_screen (utf_char); if (max_chars_on_screen > 0) { @@ -286,7 +289,7 @@ gui_chat_display_word_raw (struct t_gui_window *window, const char *string, return chars_displayed; chars_displayed += size_on_screen; } - if (size_on_screen > 0) + if (display_char && (size_on_screen > 0)) { output = string_iconv_from_internal (NULL, utf_char); wprintw (GUI_WINDOW_OBJECTS(window)->win_chat, |