/[weechat]/weechat/src/gui/gui-action.c
ViewVC logotype

Diff of /weechat/src/gui/gui-action.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by kolter, Sun Nov 13 16:59:40 2005 UTC revision 1.6 by flashcode, Sun Nov 20 18:13:24 2005 UTC
# Line 1050  gui_action_switch_server (t_gui_window * Line 1050  gui_action_switch_server (t_gui_window *
1050  }  }
1051    
1052  /*  /*
1053     * gui_action_scroll_previous_highlight: scroll to previous highlight
1054     */
1055    
1056    void
1057    gui_action_scroll_previous_highlight (t_gui_window *window)
1058    {
1059        t_gui_line *ptr_line;
1060        
1061        if (!window->buffer->dcc)
1062        {
1063            if (window->buffer->lines)
1064            {
1065                ptr_line = (window->start_line) ?
1066                    window->start_line->prev_line : window->buffer->last_line->prev_line;
1067                while (ptr_line)
1068                {
1069                    if (ptr_line->line_with_highlight)
1070                    {
1071                        window->start_line = ptr_line;
1072                        window->start_line_pos = 0;
1073                        window->first_line_displayed =
1074                            (window->start_line == window->buffer->lines);
1075                        gui_draw_buffer_chat (window->buffer, 1);
1076                        gui_draw_buffer_status (window->buffer, 0);
1077                        return;
1078                    }
1079                    ptr_line = ptr_line->prev_line;
1080                }
1081            }
1082        }
1083    }
1084    
1085    /*
1086     * gui_action_scroll_next_highlight: scroll to next highlight
1087     */
1088    
1089    void
1090    gui_action_scroll_next_highlight (t_gui_window *window)
1091    {
1092        t_gui_line *ptr_line;
1093        
1094        if (!window->buffer->dcc)
1095        {
1096            if (window->buffer->lines)
1097            {
1098                ptr_line = (window->start_line) ?
1099                    window->start_line->next_line : window->buffer->lines->next_line;
1100                while (ptr_line)
1101                {
1102                    if (ptr_line->line_with_highlight)
1103                    {
1104                        window->start_line = ptr_line;
1105                        window->start_line_pos = 0;
1106                        window->first_line_displayed =
1107                            (window->start_line == window->buffer->lines);
1108                        gui_draw_buffer_chat (window->buffer, 1);
1109                        gui_draw_buffer_status (window->buffer, 0);
1110                        return;
1111                    }
1112                    ptr_line = ptr_line->next_line;
1113                }
1114            }
1115        }
1116    }
1117    
1118    /*
1119     * gui_action_scroll_unread: scroll to first unread line of buffer
1120     */
1121    
1122    void
1123    gui_action_scroll_unread (t_gui_window *window)
1124    {
1125        if (!window->buffer->dcc &&
1126            window->buffer->last_read_line &&
1127            window->buffer->last_read_line != window->buffer->last_line)
1128        {
1129            window->start_line = window->buffer->last_read_line->next_line;
1130            window->start_line_pos = 0;
1131            window->first_line_displayed =
1132                (window->start_line == window->buffer->lines);
1133            gui_draw_buffer_chat (window->buffer, 1);
1134            gui_draw_buffer_status (window->buffer, 0);
1135        }
1136    }
1137    
1138    /*
1139   * gui_action_hotlist_clear: clear hotlist   * gui_action_hotlist_clear: clear hotlist
1140   */   */
1141    

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26