0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.0.0898: can't use the alternate screen in a terminal window

Problem:    Can't use the alternate screen in a terminal window.
Solution:   Initialze the alternate screen. (Yasuhiro Matsumoto, closes
            #1957)  Add term_getaltscreen().
This commit is contained in:
Bram Moolenaar
2017-08-11 16:24:50 +02:00
parent f1237f1814
commit e41e3b41f9
6 changed files with 42 additions and 0 deletions

View File

@@ -146,6 +146,8 @@ struct terminal_S {
VTermPos tl_cursor_pos;
int tl_cursor_visible;
int tl_using_altscreen;
};
#define TMODE_ONCE 1 /* CTRL-\ CTRL-N used */
@@ -1316,6 +1318,11 @@ handle_settermprop(
out_flush();
break;
case VTERM_PROP_ALTSCREEN:
/* TODO: do anything else? */
term->tl_using_altscreen = value->boolean;
break;
default:
break;
}
@@ -1865,6 +1872,9 @@ create_vterm(term_T *term, int rows, int cols)
/* Required to initialize most things. */
vterm_screen_reset(screen, 1 /* hard */);
/* Allow using alternate screen. */
vterm_screen_enable_altscreen(screen, 1);
}
/*
@@ -1938,6 +1948,19 @@ term_get_buf(typval_T *argvars)
return buf;
}
/*
* "term_getaltscreen(buf)" function
*/
void
f_term_getaltscreen(typval_T *argvars, typval_T *rettv)
{
buf_T *buf = term_get_buf(argvars);
if (buf == NULL)
return;
rettv->vval.v_number = buf->b_term->tl_using_altscreen;
}
/*
* "term_getattr(attr, name)" function
*/