Skip to content

Commit 373d4dd

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 04e786a + cae24be commit 373d4dd

File tree

104 files changed

+12230
-153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+12230
-153
lines changed

Filelist

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ SRC_ALL = \
8585
src/syntax.c \
8686
src/tag.c \
8787
src/term.c \
88+
src/terminal.c \
8889
src/term.h \
8990
src/termlib.c \
9091
src/ui.c \
@@ -187,13 +188,84 @@ SRC_ALL = \
187188
src/proto/syntax.pro \
188189
src/proto/tag.pro \
189190
src/proto/term.pro \
191+
src/proto/terminal.pro \
190192
src/proto/termlib.pro \
191193
src/proto/ui.pro \
192194
src/proto/undo.pro \
193195
src/proto/userfunc.pro \
194196
src/proto/version.pro \
195197
src/proto/winclip.pro \
196198
src/proto/window.pro \
199+
src/libvterm/.bzrignore \
200+
src/libvterm/.gitignore \
201+
src/libvterm/LICENSE \
202+
src/libvterm/Makefile \
203+
src/libvterm/README \
204+
src/libvterm/tbl2inc_c.pl \
205+
src/libvterm/vterm.pc.in \
206+
src/libvterm/bin/unterm.c \
207+
src/libvterm/bin/vterm-ctrl.c \
208+
src/libvterm/bin/vterm-dump.c \
209+
src/libvterm/doc/URLs \
210+
src/libvterm/doc/seqs.txt \
211+
src/libvterm/include/vterm.h \
212+
src/libvterm/include/vterm_keycodes.h \
213+
src/libvterm/src/encoding.c \
214+
src/libvterm/src/encoding/DECdrawing.inc \
215+
src/libvterm/src/encoding/DECdrawing.tbl \
216+
src/libvterm/src/encoding/uk.inc \
217+
src/libvterm/src/encoding/uk.tbl \
218+
src/libvterm/src/keyboard.c \
219+
src/libvterm/src/mouse.c \
220+
src/libvterm/src/parser.c \
221+
src/libvterm/src/pen.c \
222+
src/libvterm/src/rect.h \
223+
src/libvterm/src/screen.c \
224+
src/libvterm/src/state.c \
225+
src/libvterm/src/unicode.c \
226+
src/libvterm/src/utf8.h \
227+
src/libvterm/src/vterm.c \
228+
src/libvterm/src/vterm_internal.h \
229+
src/libvterm/t/02parser.test \
230+
src/libvterm/t/03encoding_utf8.test \
231+
src/libvterm/t/10state_putglyph.test \
232+
src/libvterm/t/11state_movecursor.test \
233+
src/libvterm/t/12state_scroll.test \
234+
src/libvterm/t/13state_edit.test \
235+
src/libvterm/t/14state_encoding.test \
236+
src/libvterm/t/15state_mode.test \
237+
src/libvterm/t/16state_resize.test \
238+
src/libvterm/t/17state_mouse.test \
239+
src/libvterm/t/18state_termprops.test \
240+
src/libvterm/t/20state_wrapping.test \
241+
src/libvterm/t/21state_tabstops.test \
242+
src/libvterm/t/22state_save.test \
243+
src/libvterm/t/25state_input.test \
244+
src/libvterm/t/26state_query.test \
245+
src/libvterm/t/27state_reset.test \
246+
src/libvterm/t/28state_dbl_wh.test \
247+
src/libvterm/t/29state_fallback.test \
248+
src/libvterm/t/30pen.test \
249+
src/libvterm/t/40screen_ascii.test \
250+
src/libvterm/t/41screen_unicode.test \
251+
src/libvterm/t/42screen_damage.test \
252+
src/libvterm/t/43screen_resize.test \
253+
src/libvterm/t/44screen_pen.test \
254+
src/libvterm/t/45screen_protect.test \
255+
src/libvterm/t/46screen_extent.test \
256+
src/libvterm/t/47screen_dbl_wh.test \
257+
src/libvterm/t/48screen_termprops.test \
258+
src/libvterm/t/90vttest_01-movement-1.test \
259+
src/libvterm/t/90vttest_01-movement-2.test \
260+
src/libvterm/t/90vttest_01-movement-3.test \
261+
src/libvterm/t/90vttest_01-movement-4.test \
262+
src/libvterm/t/90vttest_02-screen-1.test \
263+
src/libvterm/t/90vttest_02-screen-2.test \
264+
src/libvterm/t/90vttest_02-screen-3.test \
265+
src/libvterm/t/90vttest_02-screen-4.test \
266+
src/libvterm/t/92lp1640917.test \
267+
src/libvterm/t/harness.c \
268+
src/libvterm/t/run-test.pl \
197269

198270

199271
# source files for Unix only

runtime/doc/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ DOCS = \
102102
tabpage.txt \
103103
tagsrch.txt \
104104
term.txt \
105+
terminal.txt \
105106
tips.txt \
106107
todo.txt \
107108
uganda.txt \
@@ -237,6 +238,7 @@ HTMLS = \
237238
tabpage.html \
238239
tagsrch.html \
239240
term.html \
241+
terminal.html \
240242
tips.html \
241243
todo.html \
242244
uganda.html \

runtime/doc/eval.txt

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*eval.txt* For Vim version 8.0. Last change: 2017 Jun 25
1+
*eval.txt* For Vim version 8.0. Last change: 2017 Jul 08
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4189,14 +4189,14 @@ getchar([expr]) *getchar()*
41894189
not consumed. Return zero if no character available.
41904190

41914191
Without [expr] and when [expr] is 0 a whole character or
4192-
special key is returned. If it is an 8-bit character, the
4192+
special key is returned. If it is a single character, the
41934193
result is a number. Use nr2char() to convert it to a String.
41944194
Otherwise a String is returned with the encoded character.
4195-
For a special key it's a sequence of bytes starting with 0x80
4196-
(decimal: 128). This is the same value as the string
4197-
"\<Key>", e.g., "\<Left>". The returned value is also a
4198-
String when a modifier (shift, control, alt) was used that is
4199-
not included in the character.
4195+
For a special key it's a String with a sequence of bytes
4196+
starting with 0x80 (decimal: 128). This is the same value as
4197+
the String "\<Key>", e.g., "\<Left>". The returned value is
4198+
also a String when a modifier (shift, control, alt) was used
4199+
that is not included in the character.
42004200

42014201
When [expr] is 0 and Esc is typed, there will be a short delay
42024202
while Vim waits to see if this is the start of an escape
@@ -8017,6 +8017,10 @@ timer_start({time}, {callback} [, {options}])
80178017
"repeat" Number of times to repeat calling the
80188018
callback. -1 means forever. When not present
80198019
the callback will be called once.
8020+
If the timer causes an error three times in a
8021+
row the repeat is cancelled. This avoids that
8022+
Vim becomes unusable because of all the error
8023+
messages.
80208024

80218025
Example: >
80228026
func MyHandler(timer)

runtime/doc/terminal.txt

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
*terminal.txt* For Vim version 8.0. Last change: 2017 Jul 04
2+
3+
4+
VIM REFERENCE MANUAL by Bram Moolenaar
5+
6+
7+
Terminal window support *terminal*
8+
9+
10+
WARNING: THIS IS ONLY PARTLY IMPLEMENTED, ANYTHING CAN STILL CHANGE
11+
12+
13+
1. Basic use |terminal-use|
14+
2. Remote testing |terminal-testing|
15+
3. Debugging |terminal-debug|
16+
17+
{Vi does not have any of these commands}
18+
19+
==============================================================================
20+
1. Basic use *terminal-use*
21+
22+
This feature is for running a terminal emulator in a Vim window. A job can be
23+
started connected to the terminal emulator. For example, to run a shell: >
24+
:term bash
25+
26+
Or to run a debugger: >
27+
:term gdb vim
28+
29+
The job runs asynchronously from Vim, the window will be updated to show
30+
output from the job, also while editing in any other window.
31+
32+
When the keyboard focus is in the terminal window, typed keys will be send to
33+
the job. This uses a pty when possible.
34+
35+
Navigate between windows with CTRL-W commands (and mouse).
36+
E.g. CTRL-W CTRL-W moves focus to the next window.
37+
38+
Option 'termkey'
39+
Specify key for Vim command in terminal window. local to window.
40+
Default is CTRL-W.
41+
42+
Option 'termsize'
43+
Specify terminal size. Local to window.
44+
When empty the terminal gets the size from the window.
45+
When set (e.g., "24x80") the terminal size is fixed. If the window is smaller
46+
only the top-left part is displayed. (TODO: scrolling?)
47+
48+
Syntax ~
49+
*:ter* *:terminal*
50+
:terminal[!] [command] Open a new terminal window.
51+
52+
If [command] is provided run it as a job and connect
53+
the input and output to the terminal.
54+
If [command] is not given the 'shell' option is used.
55+
56+
A new buffer will be created, using [command] or
57+
'shell' as the name. If a buffer by this name already
58+
exists a number is added in parenthesis.
59+
E.g. if "gdb" exists the second terminal buffer will
60+
use "gdb (1)".
61+
62+
The window can be closed, in which case the buffer
63+
becomes hidden. The command will not be stopped. The
64+
`:buffer` command can be used to turn the current
65+
window into a terminal window, using the existing
66+
buffer. If there are unsaved changes this fails, use
67+
! to force, as usual.
68+
69+
Resizing ~
70+
71+
The size of the terminal can be in one of three modes:
72+
73+
1. The 'termsize' option is empty: The terminal size follows the window size.
74+
The minimal size is 2 screen lines with 10 cells.
75+
76+
2. The 'termsize' option is "rows*cols", where "rows" is the minimal number of
77+
screen rows and "cols" is the minial number of cells.
78+
79+
3. The 'termsize' option is "rowsXcols" (where the x is upper or lower case).
80+
The terminal size is fixed to the specified number of screen lines and
81+
cells. If the window is bigger there will be unused empty space.
82+
83+
If the window is smaller than the terminal size, only part of the terminal can
84+
be seen (the lower-left part).
85+
86+
The |term_getsize()| function can be used to get the current size of the
87+
terminal. |term_setsize()| can be used only when in the first or second mode,
88+
not when 'termsize' is "rowsXcols".
89+
90+
==============================================================================
91+
2. Remote testing *terminal-testing*
92+
93+
Most Vim tests execute a script inside Vim. For some tests this does not
94+
work, running the test interferes with the code being tested. To avoid this
95+
Vim is executed in a terminal window. The test sends keystrokes to it and
96+
inspects the resulting screen state.
97+
98+
Functions ~
99+
100+
term_sendkeys() send keystrokes to a terminal
101+
term_wait() wait for screen to be updated
102+
term_scrape() inspect terminal screen
103+
104+
105+
==============================================================================
106+
3. Debugging *terminal-debug*
107+
108+
The Terminal debugging plugin can be used to debug a program with gdb and view
109+
the source code in a Vim window. For example: >
110+
111+
:TermDebug vim
112+
113+
This opens three windows:
114+
- A terminal window in which "gdb vim" is executed. Here you can directly
115+
interact with gdb.
116+
- A terminal window for the executed program. When "run" is used in gdb the
117+
program I/O will happen in this window, so that it does not interfere with
118+
controlling gdb.
119+
- A normal Vim window used to show the source code. When gdb jumps to a
120+
source file location this window will display the code, if possible. Values
121+
of variables can be inspected, breakpoints set and cleared, etc.
122+
123+
This uses two terminal windows. To open the gdb window: >
124+
:term gdb [arguments]
125+
To open the terminal to run the tested program |term_open()| is used.
126+
127+
TODO
128+
129+
130+
vim:tw=78:ts=8:ft=help:norl:

0 commit comments

Comments
 (0)