three ranges (will be needed for floating panes); move the visible ranges checks outside of tty_draw_line and rewrite it to fix issues with partially-obscured wide characters. With Michael Grant.