Update runtime files
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
*terminal.txt* For Vim version 8.2. Last change: 2021 Jan 04
|
||||
*terminal.txt* For Vim version 8.2. Last change: 2021 Feb 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@ -126,11 +126,28 @@ After opening the terminal window and setting 'buftype' to "terminal" the
|
||||
|TerminalWinOpen| autocommand event is triggered. This makes it possible to set
|
||||
options specifically for the terminal window and buffer. Example: >
|
||||
au TerminalWinOpen * setlocal bufhidden=hide
|
||||
This only works properly if the terminal is not hidden.
|
||||
|
||||
There is also the |TerminalOpen| event, but this may be triggered for a hidden
|
||||
terminal, and the current window and buffer may not be for the new terminal.
|
||||
For both hidden and non-hidden terminals this works, both for buffer-local and
|
||||
window-local options: >
|
||||
au TerminalWinOpen,BufWinEnter * if &buftype == 'terminal'
|
||||
\ | setlocal bufhidden=hide colorcolumn=123
|
||||
\ | endif
|
||||
Note that for a hidden terminal the options are not set until the terminal is
|
||||
no longer hidden.
|
||||
|
||||
There is also the |TerminalOpen| event. Keep in mind this may be triggered
|
||||
for a hidden terminal, then the current window and buffer are not that of the
|
||||
new terminal.
|
||||
You need to use <abuf>, which is set to the terminal buffer. Example: >
|
||||
au TerminalOpen * call setbufvar(+expand('<abuf>'), '&colorcolumn', 123)
|
||||
au TerminalOpen * call setbufvar(expand('<abuf>')->str2nr(),
|
||||
\ '&termwinscroll', 1000)
|
||||
For a window-local option, you need to delay setting the option until the
|
||||
terminal window has been created (this only works for a hidden terminal): >
|
||||
au TerminalOpen * exe printf(
|
||||
\ 'au BufWinEnter <buffer=%d> ++once setlocal colorcolumn=%d',
|
||||
\ expand('<abuf>')->str2nr(), 123)
|
||||
For a non-hidden terminal use |TerminalWinOpen|.
|
||||
|
||||
Mouse events (click and drag) are passed to the terminal. Mouse move events
|
||||
are only passed when Vim itself is receiving them. For a terminal that is
|
||||
@ -717,6 +734,8 @@ term_scrape({buf}, {row}) *term_scrape()*
|
||||
"attr" attributes of the cell, use |term_getattr()|
|
||||
to get the individual flags
|
||||
"width" cell width: 1 or 2
|
||||
For a double-width cell there is one item, thus the list can
|
||||
be shorter than the width of the terminal.
|
||||
|
||||
Can also be used as a |method|: >
|
||||
GetBufnr()->term_scrape(row)
|
||||
|
||||
Reference in New Issue
Block a user