summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-11-16 10:05:21 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-11-16 10:05:21 +0000
commitc2e2d606e681edadd24c2eb1d492f0a6a8323d15 (patch)
tree490753db76826801629347989dd6a26fb45d8f18
parent4322da78aad1bbd4bc6a59937c29473c3f794ae1 (diff)
downloadirssi-c2e2d606e681edadd24c2eb1d492f0a6a8323d15.zip
Removed /SET term_scroll_fast - looks like il/dl commands work fine with
scrolling region at least in xterm and linux console, so it looks nice and is fast. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2028 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r--src/fe-text/term-curses.c7
-rw-r--r--src/fe-text/term-terminfo.c7
-rw-r--r--src/fe-text/term.c2
-rw-r--r--src/fe-text/term.h3
-rw-r--r--src/fe-text/terminfo-core.c51
-rw-r--r--src/fe-text/terminfo-core.h4
6 files changed, 18 insertions, 56 deletions
diff --git a/src/fe-text/term-curses.c b/src/fe-text/term-curses.c
index 41139b97..6f71ac29 100644
--- a/src/fe-text/term-curses.c
+++ b/src/fe-text/term-curses.c
@@ -193,13 +193,6 @@ void term_force_colors(int set)
/* don't do anything with curses */
}
-/* Setup scrolling - if fast is TRUE, we'll use the fastest method to
- scroll, if it's FALSE, we'll use the one that looks cleanest. */
-void term_setup_scroll(int fast)
-{
- /* don't do anything with curses */
-}
-
/* Clear screen */
void term_clear(void)
{
diff --git a/src/fe-text/term-terminfo.c b/src/fe-text/term-terminfo.c
index a0fb1422..e110085f 100644
--- a/src/fe-text/term-terminfo.c
+++ b/src/fe-text/term-terminfo.c
@@ -170,13 +170,6 @@ void term_force_colors(int set)
terminfo_setup_colors(current_term, set);
}
-/* Setup scrolling - if fast is TRUE, we'll use the fastest method to
- scroll, if it's FALSE, we'll use the one that looks cleanest. */
-void term_setup_scroll(int fast)
-{
- terminfo_setup_scroll(current_term, fast);
-}
-
/* Clear screen */
void term_clear(void)
{
diff --git a/src/fe-text/term.c b/src/fe-text/term.c
index f2847661..f4f830ac 100644
--- a/src/fe-text/term.c
+++ b/src/fe-text/term.c
@@ -92,7 +92,6 @@ static void read_settings(void)
{
int old_colors = term_use_colors;
- term_setup_scroll(settings_get_bool("term_scroll_fast"));
if (settings_get_bool("term_force_colors")) {
if (!term_use_colors) {
term_force_colors(TRUE);
@@ -117,7 +116,6 @@ void term_common_init(void)
#endif
settings_add_bool("lookandfeel", "colors", TRUE);
settings_add_bool("lookandfeel", "term_force_colors", FALSE);
- settings_add_bool("lookandfeel", "term_scroll_fast", FALSE);
term_use_colors = term_has_colors() && settings_get_bool("colors");
read_settings();
diff --git a/src/fe-text/term.h b/src/fe-text/term.h
index 255329d6..74e51f31 100644
--- a/src/fe-text/term.h
+++ b/src/fe-text/term.h
@@ -40,9 +40,6 @@ void term_resize_dirty(void);
int term_has_colors(void);
/* Force the colors on any way you can */
void term_force_colors(int set);
-/* Setup scrolling - if fast is TRUE, we'll use the fastest method to
- scroll, if it's FALSE, we'll use the one that looks cleanest. */
-void term_setup_scroll(int fast);
/* Clear screen */
void term_clear(void);
diff --git a/src/fe-text/terminfo-core.c b/src/fe-text/terminfo-core.c
index 79151fa0..21a7b0a6 100644
--- a/src/fe-text/terminfo-core.c
+++ b/src/fe-text/terminfo-core.c
@@ -161,7 +161,7 @@ static void _set_cursor_visible(TERM_REC *term, int set)
#define scroll_region_setup(term, y1, y2) \
if ((term)->TI_csr != NULL) \
tput(tparm((term)->TI_csr, y1, y2)); \
- else \
+ else if ((term)->TI_wind != NULL) \
tput(tparm((term)->TI_wind, y1, y2, 0, (term)->width-1));
/* Scroll (change_scroll_region+parm_rindex+parm_index / csr+rin+indn) */
@@ -209,6 +209,11 @@ static void _scroll_region_1(TERM_REC *term, int y1, int y2, int count)
/* Scroll (parm_insert_line+parm_delete_line / il+dl) */
static void _scroll_line(TERM_REC *term, int y1, int y2, int count)
{
+ /* setup the scrolling region to wanted area -
+ this might not necessarily work with il/dl, but at least it
+ looks better if it does */
+ scroll_region_setup(term, y1, y2);
+
if (count > 0) {
term->move(term, 0, y1);
tput(tparm(term->TI_dl, count, count));
@@ -220,6 +225,9 @@ static void _scroll_line(TERM_REC *term, int y1, int y2, int count)
term->move(term, 0, y1);
tput(tparm(term->TI_il, -count, -count));
}
+
+ /* reset the scrolling region to full screen */
+ scroll_region_setup(term, 0, term->height-1);
}
/* Scroll (insert_line+delete_line / il1+dl1) */
@@ -484,36 +492,6 @@ void terminfo_cont(TERM_REC *term)
terminfo_input_init(term);
}
-/* Setup scrolling - if fast is TRUE, we'll use the fastest method to
- scroll, if it's FALSE, we'll use the one that looks cleanest. */
-void terminfo_setup_scroll(TERM_REC *term, int fast)
-{
- int region_1;
-
- if ((term->TI_csr || term->TI_wind) && term->TI_rin && term->TI_indn) {
- /* this is excellent - if only terminals supported it.. */
- term->scroll = _scroll_region;
- return;
- }
-
- region_1 = (term->TI_csr || term->TI_wind) && term->TI_ri && term->TI_ind;
- if (!fast && region_1) {
- /* we prefer pretty */
- term->scroll = _scroll_region_1;
- } else if (term->TI_il && term->TI_dl) {
- /* either we prefer fast, or can't do pretty */
- term->scroll = _scroll_line;
- } else if (region_1) {
- /* we prefer fast, but can't do it */
- term->scroll = _scroll_region_1;
- }
-
- if (term->scroll == NULL && (term->TI_il1 && term->TI_dl1)) {
- /* the final slowest and ugliest method we can use */
- term->scroll = _scroll_line_1;
- }
-}
-
void terminfo_stop(TERM_REC *term)
{
/* reset colors */
@@ -573,8 +551,15 @@ static int term_setup(TERM_REC *term)
_set_cursor_visible : _ignore_parm;
/* Scrolling */
- terminfo_setup_scroll(term, FALSE);
- if (term->scroll == NULL) {
+ if ((term->TI_csr || term->TI_wind) && term->TI_rin && term->TI_indn)
+ term->scroll = _scroll_region;
+ else if (term->TI_il && term->TI_dl)
+ term->scroll = _scroll_line;
+ else if ((term->TI_csr || term->TI_wind) && term->TI_ri && term->TI_ind)
+ term->scroll = _scroll_region_1;
+ else if (term->scroll == NULL && (term->TI_il1 && term->TI_dl1))
+ term->scroll = _scroll_line_1;
+ else if (term->scroll == NULL) {
fprintf(term->out, "Terminal doesn't support scrolling\n");
return 0;
}
diff --git a/src/fe-text/terminfo-core.h b/src/fe-text/terminfo-core.h
index 5c823854..93afa78b 100644
--- a/src/fe-text/terminfo-core.h
+++ b/src/fe-text/terminfo-core.h
@@ -93,10 +93,6 @@ void terminfo_core_deinit(TERM_REC *term);
terminal capabilities don't contain color codes */
void terminfo_setup_colors(TERM_REC *term, int force);
-/* Setup scrolling - if fast is TRUE, we'll use the fastest method to
- scroll, if it's FALSE, we'll use the one that looks cleanest. */
-void terminfo_setup_scroll(TERM_REC *term, int fast);
-
/* Terminal was resized - ask the width/height from terminfo again */
void terminfo_resize(TERM_REC *term);