| 885 | } |
| 886 | |
| 887 | static void |
| 888 | directional_scroll(winid wid, int nlines) |
| 889 | { |
| 890 | int wh, ww, s_top, s_bottom; |
| 891 | boolean border = curses_window_has_border(wid); |
| 892 | WINDOW *win = curses_get_nhwin(wid); |
| 893 | |
| 894 | curses_set_wid_colors(wid, NULL); |
| 895 | curses_get_window_size(wid, &wh, &ww); |
| 896 | if (wh == 1) { |
| 897 | curses_clear_nhwin(wid); |
| 898 | return; |
| 899 | } |
| 900 | if (border) { |
| 901 | s_top = 1; |
| 902 | s_bottom = wh; |
| 903 | } else { |
| 904 | s_top = 0; |
| 905 | s_bottom = wh - 1; |
| 906 | } |
| 907 | scrollok(win, TRUE); |
| 908 | wsetscrreg(win, s_top, s_bottom); |
| 909 | wscrl(win, nlines); |
| 910 | scrollok(win, FALSE); |
| 911 | if (wid == MESSAGE_WIN) { |
| 912 | mx = border ? 1 : 0; |
| 913 | } |
| 914 | if (border) { |
| 915 | box(win, 0, 0); |
| 916 | } |
| 917 | wrefresh(win); |
| 918 | } |
| 919 | |
| 920 | |
| 921 | /* Add given line to message history */ |
no test coverage detected