Problem: Terminal window options are named inconsistently.
Solution: prefix terminal window options with "termwin". Keep the old names
for now as an alias.
-*options.txt* For Vim version 8.0. Last change: 2018 Apr 18
+*options.txt* For Vim version 8.0. Last change: 2018 Apr 21
VIM REFERENCE MANUAL by Bram Moolenaar
a S Argument list status as in default title. ({current} of {max})
Empty if the argument file count is zero or one.
{ NF Evaluate expression between '%{' and '}' and substitute result.
- Note that there is no '%' before the closing '}'.
+ Note that there is no '%' before the closing '}'. The
+ expression cannot contain a '}' character, call a function to
+ work around that.
( - Start of item group. Can be used for setting the width and
alignment of a section. Must be followed by %) somewhere.
) - End of item group. No width fields allowed.
call <SID>BinOptionL("crb")
endif
if has("terminal")
- call append("$", "termsize\tsize of a terminal window")
+ call append("$", "termwinsize\tsize of a terminal window")
call append("$", "\t(local to window)")
- call <SID>OptionL("tms")
- call append("$", "termkey\tkey that precedes Vim commands in a terminal window")
+ call <SID>OptionL("tws")
+ call append("$", "termwinkey\tkey that precedes Vim commands in a terminal window")
call append("$", "\t(local to window)")
- call <SID>OptionL("tk")
+ call <SID>OptionL("twk")
+ call append("$", "termwinscroll\tmax number of lines to keep for scrollback in a terminal window")
+ call append("$", "\t(local to window)")
+ call <SID>OptionL("twsl")
if exists("&winptydll")
call append("$", "winptydll\tname of the winpty dynamic library")
call <SID>OptionG("winptydll", &winptydll)
# define PV_COLE OPT_WIN(WV_COLE)
#endif
#ifdef FEAT_TERMINAL
-# define PV_TK OPT_WIN(WV_TK)
-# define PV_TMS OPT_WIN(WV_TMS)
+# define PV_TWK OPT_WIN(WV_TWK)
+# define PV_TWS OPT_WIN(WV_TWS)
+# define PV_TWSL OPT_BUF(BV_TWSL)
#endif
#ifdef FEAT_SIGNS
# define PV_SCL OPT_WIN(WV_SCL)
#ifdef FEAT_KEYMAP
static char_u *p_keymap;
#endif
+#ifdef FEAT_TERMINAL
+static long p_twsl;
+#endif
/* Saved values for when 'bin' is set. */
static int p_et_nobin;
{(char_u *)FALSE, (char_u *)FALSE}
#endif
SCRIPTID_INIT},
+ /* TODO: remove this deprecated entry */
{"terminalscroll", "tlsl", P_NUM|P_VI_DEF|P_VIM|P_RBUF,
#ifdef FEAT_TERMINAL
- (char_u *)&p_tlsl, PV_NONE,
+ (char_u *)&p_twsl, PV_TWSL,
{(char_u *)10000L, (char_u *)10000L}
#else
(char_u *)NULL, PV_NONE,
{(char_u *)NULL, (char_u *)0L}
#endif
SCRIPTID_INIT},
- {"termkey", "tk", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF,
+ /* TODO: remove this deprecated entry */
+ {"termkey", "tk", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF,
#ifdef FEAT_TERMINAL
- (char_u *)VAR_WIN, PV_TK,
+ (char_u *)VAR_WIN, PV_TWK,
{(char_u *)"", (char_u *)NULL}
#else
(char_u *)NULL, PV_NONE,
{(char_u *)NULL, (char_u *)0L}
#endif
SCRIPTID_INIT},
+ /* TODO: remove this deprecated entry */
{"termsize", "tms", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF,
#ifdef FEAT_TERMINAL
- (char_u *)VAR_WIN, PV_TMS,
+ (char_u *)VAR_WIN, PV_TWS,
+ {(char_u *)"", (char_u *)NULL}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ SCRIPTID_INIT},
+ {"termwinkey", "twk", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF,
+#ifdef FEAT_TERMINAL
+ (char_u *)VAR_WIN, PV_TWK,
+ {(char_u *)"", (char_u *)NULL}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ SCRIPTID_INIT},
+ {"termwinscroll", "twsl", P_NUM|P_VI_DEF|P_VIM|P_RBUF,
+#ifdef FEAT_TERMINAL
+ (char_u *)&p_twsl, PV_TWSL,
+ {(char_u *)10000L, (char_u *)10000L}
+#else
+ (char_u *)NULL, PV_NONE,
+ {(char_u *)NULL, (char_u *)0L}
+#endif
+ SCRIPTID_INIT},
+ {"termwinsize", "tws", P_STRING|P_ALLOCED|P_RWIN|P_VI_DEF,
+#ifdef FEAT_TERMINAL
+ (char_u *)VAR_WIN, PV_TWS,
{(char_u *)"", (char_u *)NULL}
#else
(char_u *)NULL, PV_NONE,
#endif
#ifdef FEAT_TERMINAL
- /* 'termkey' */
- else if (varp == &curwin->w_p_tk)
+ /* 'termwinkey' */
+ else if (varp == &curwin->w_p_twk)
{
- if (*curwin->w_p_tk != NUL && string_to_key(curwin->w_p_tk, TRUE) == 0)
+ if (*curwin->w_p_twk != NUL
+ && string_to_key(curwin->w_p_twk, TRUE) == 0)
errmsg = e_invarg;
}
- /* 'termsize' */
- else if (varp == &curwin->w_p_tms)
+ /* 'termwinsize' */
+ else if (varp == &curwin->w_p_tws)
{
- if (*curwin->w_p_tms != NUL)
+ if (*curwin->w_p_tws != NUL)
{
- p = skipdigits(curwin->w_p_tms);
- if (p == curwin->w_p_tms
+ p = skipdigits(curwin->w_p_tws);
+ if (p == curwin->w_p_tws
|| (*p != 'x' && *p != '*')
|| *skipdigits(p + 1) != NUL)
errmsg = e_invarg;
case PV_COLE: return (char_u *)&(curwin->w_p_cole);
#endif
#ifdef FEAT_TERMINAL
- case PV_TK: return (char_u *)&(curwin->w_p_tk);
- case PV_TMS: return (char_u *)&(curwin->w_p_tms);
+ case PV_TWK: return (char_u *)&(curwin->w_p_twk);
+ case PV_TWS: return (char_u *)&(curwin->w_p_tws);
+ case PV_TWSL: return (char_u *)&(curbuf->b_p_twsl);
#endif
case PV_AI: return (char_u *)&(curbuf->b_p_ai);
to->wo_cole = from->wo_cole;
#endif
#ifdef FEAT_TERMINAL
- to->wo_tk = vim_strsave(from->wo_tk);
- to->wo_tms = vim_strsave(from->wo_tms);
+ to->wo_twk = vim_strsave(from->wo_twk);
+ to->wo_tws = vim_strsave(from->wo_tws);
#endif
#ifdef FEAT_FOLDING
to->wo_fdc = from->wo_fdc;
check_string_option(&wop->wo_cocu);
#endif
#ifdef FEAT_TERMINAL
- check_string_option(&wop->wo_tk);
- check_string_option(&wop->wo_tms);
+ check_string_option(&wop->wo_twk);
+ check_string_option(&wop->wo_tws);
#endif
#ifdef FEAT_LINEBREAK
check_string_option(&wop->wo_briopt);
clear_string_option(&wop->wo_cocu);
#endif
#ifdef FEAT_TERMINAL
- clear_string_option(&wop->wo_tk);
- clear_string_option(&wop->wo_tms);
+ clear_string_option(&wop->wo_twk);
+ clear_string_option(&wop->wo_tws);
#endif
}
#ifdef FEAT_KEYMAP
buf->b_p_keymap = vim_strsave(p_keymap);
buf->b_kmap_state |= KEYMAP_INIT;
+#endif
+#ifdef FEAT_TERMINAL
+ buf->b_p_twsl = p_twsl;
#endif
/* This isn't really an option, but copying the langmap and IME
* state from the current buffer is better than resetting it. */
, BV_UDF
, BV_UL
, BV_WM
+#ifdef FEAT_TERMINAL
+ , BV_TWSL
+#endif
, BV_COUNT /* must be the last one */
};
, WV_COLE
#endif
#ifdef FEAT_TERMINAL
- , WV_TK
- , WV_TMS
+ , WV_TWK
+ , WV_TWS
#endif
, WV_CRBIND
#ifdef FEAT_LINEBREAK
* redirection. Probably in call to channel_set_pipes().
* - Win32: Redirecting output does not work, Test_terminal_redir_file()
* is disabled.
+ * - Add test for 'termwinkey'.
+ * - libvterm: bringg back using // comments and trailing comma in enum
* - When starting terminal window with shell in terminal, then using :gui to
* switch to GUI, shell stops working. Scrollback seems wrong, command
* running in shell is still running.
*rows = 0;
*cols = 0;
- if (*wp->w_p_tms != NUL)
+ if (*wp->w_p_tws != NUL)
{
- char_u *p = vim_strchr(wp->w_p_tms, 'x');
+ char_u *p = vim_strchr(wp->w_p_tws, 'x');
/* Syntax of value was already checked when it's set. */
if (p == NULL)
{
minsize = TRUE;
- p = vim_strchr(wp->w_p_tms, '*');
+ p = vim_strchr(wp->w_p_tws, '*');
}
- *rows = atoi((char *)wp->w_p_tms);
+ *rows = atoi((char *)wp->w_p_tws);
*cols = atoi((char *)p + 1);
}
return minsize;
* stored reference. */
in_terminal_loop = curbuf->b_term;
- if (*curwin->w_p_tk != NUL)
- termkey = string_to_key(curwin->w_p_tk, TRUE);
+ if (*curwin->w_p_twk != NUL)
+ termkey = string_to_key(curwin->w_p_twk, TRUE);
position_cursor(curwin, &curbuf->b_term->tl_cursor_pos);
may_set_cursor_props(curbuf->b_term);
/* If the number of lines that are stored goes over 'termscrollback' then
* delete the first 10%. */
- if (term->tl_scrollback.ga_len >= p_tlsl)
+ if (term->tl_scrollback.ga_len >= term->tl_buffer->b_p_twsl)
{
- int todo = p_tlsl / 10;
+ int todo = term->tl_buffer->b_p_twsl / 10;
int i;
curbuf = term->tl_buffer;
\ 'tagcase': [['smart', 'match'], ['', 'xxx', 'smart,match']],
\ 'term': [[], []],
\ 'termguicolors': [[], []],
- \ 'termsize': [['', '24x80', '0x80', '32x0', '0x0'], ['xxx', '80', '8ax9', '24x80b']],
\ 'termencoding': [has('gui_gtk') ? [] : ['', 'utf-8'], ['xxx']],
+ \ 'termsize': [['', '24x80', '0x80', '32x0', '0x0'], ['xxx', '80', '8ax9', '24x80b']],
+ \ 'termwinsize': [['', '24x80', '0x80', '32x0', '0x0'], ['xxx', '80', '8ax9', '24x80b']],
\ 'toolbar': [['', 'icons', 'text'], ['xxx']],
\ 'toolbariconsize': [['', 'tiny', 'huge'], ['xxx']],
\ 'ttymouse': [['', 'xterm'], ['xxx']],
func Test_terminal_scrollback()
let buf = Run_shell_in_terminal({})
- set terminalscroll=100
+ set termwinscroll=100
call writefile(range(150), 'Xtext')
if has('win32')
call term_sendkeys(buf, "type Xtext\<CR>")
call Stop_shell_in_terminal(buf)
call term_wait(buf)
exe buf . 'bwipe'
- set terminalscroll&
+ set termwinscroll&
endfunc
func Test_terminal_size()
exe buf . 'bwipe'
endfunc
-func Test_terminal_termsize_option_fixed()
+func Test_terminal_termwinsize_option_fixed()
if !CanRunVimInTerminal()
return
endif
- set termsize=6x40
+ set termwinsize=6x40
let text = []
for n in range(10)
call add(text, repeat(n, 50))
call StopVimInTerminal(buf)
call delete('Xwinsize')
- call assert_fails('set termsize=40', 'E474')
- call assert_fails('set termsize=10+40', 'E474')
- call assert_fails('set termsize=abc', 'E474')
+ call assert_fails('set termwinsize=40', 'E474')
+ call assert_fails('set termwinsize=10+40', 'E474')
+ call assert_fails('set termwinsize=abc', 'E474')
- set termsize=
+ set termwinsize=
endfunc
-func Test_terminal_termsize_option_zero()
- set termsize=0x0
+func Test_terminal_termwinsize_option_zero()
+ set termwinsize=0x0
let buf = Run_shell_in_terminal({})
let win = bufwinid(buf)
call assert_equal([winheight(win), winwidth(win)], term_getsize(buf))
call term_wait(buf)
exe buf . 'bwipe'
- set termsize=7x0
+ set termwinsize=7x0
let buf = Run_shell_in_terminal({})
let win = bufwinid(buf)
call assert_equal([7, winwidth(win)], term_getsize(buf))
call term_wait(buf)
exe buf . 'bwipe'
- set termsize=0x33
+ set termwinsize=0x33
let buf = Run_shell_in_terminal({})
let win = bufwinid(buf)
call assert_equal([winheight(win), 33], term_getsize(buf))
call term_wait(buf)
exe buf . 'bwipe'
- set termsize=
+ set termwinsize=
endfunc
-func Test_terminal_termsize_mininmum()
- set termsize=10*50
+func Test_terminal_termwinsize_mininmum()
+ set termwinsize=10*50
vsplit
let buf = Run_shell_in_terminal({})
let win = bufwinid(buf)
call term_wait(buf)
exe buf . 'bwipe'
- set termsize=0*0
+ set termwinsize=0*0
let buf = Run_shell_in_terminal({})
let win = bufwinid(buf)
call assert_equal([winheight(win), winwidth(win)], term_getsize(buf))
call term_wait(buf)
exe buf . 'bwipe'
- set termsize=
+ set termwinsize=
endfunc
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1743,
/**/
1742,
/**/