diff options
| author | Bram Moolenaar <Bram@vim.org> | 2017-08-11 16:24:50 +0200 |
|---|---|---|
| committer | Bram Moolenaar <Bram@vim.org> | 2017-08-11 16:24:50 +0200 |
| commit | e41e3b41f991bd610f889dea57676526704fea5f (patch) | |
| tree | bfe0901e8daf63928bae6458eb9b4c319c027c05 /src/terminal.c | |
| parent | f1237f18143d9fe5b2a6ce981dee415736858789 (diff) | |
| download | vim-git-e41e3b41f991bd610f889dea57676526704fea5f.tar.gz | |
patch 8.0.0898: can't use the alternate screen in a terminal windowv8.0.0898
Problem: Can't use the alternate screen in a terminal window.
Solution: Initialze the alternate screen. (Yasuhiro Matsumoto, closes
#1957) Add term_getaltscreen().
Diffstat (limited to 'src/terminal.c')
| -rw-r--r-- | src/terminal.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/terminal.c b/src/terminal.c index b1cb61fc0..e22f7bcf7 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -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); } /* @@ -1939,6 +1949,19 @@ term_get_buf(typval_T *argvars) } /* + * "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 */ void |
