Merge remote-tracking branch 'vim/master'

This commit is contained in:
Kazuki Sakamoto
2017-08-01 19:51:11 -07:00
37 changed files with 3742 additions and 2825 deletions
+5 -4
View File
@@ -1,4 +1,4 @@
*develop.txt* For Vim version 8.0. Last change: 2017 Jan 05
*develop.txt* For Vim version 8.0. Last change: 2017 Jul 31
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -143,9 +143,10 @@ and its environment.
VIM IS... NOT *design-not*
- Vim is not a shell or an Operating System. You will not be able to run a
shell inside Vim or use it to control a debugger. This should work the
other way around: Use Vim as a component from a shell or in an IDE.
- Vim is not a shell or an Operating System. It does provide a terminal
window, in which you can run a shell or debugger. E.g. to be able to do
this over an ssh connection. But if you don't need a text editor with that
it is out of scope (use something like screen or tmux instead).
A satirical way to say this: "Unlike Emacs, Vim does not attempt to include
everything but the kitchen sink, but some people say that you can clean one
with it. ;-)"
+2 -2
View File
@@ -1,4 +1,4 @@
*editing.txt* For Vim version 8.0. Last change: 2017 Jul 16
*editing.txt* For Vim version 8.0. Last change: 2017 Aug 01
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1737,7 +1737,7 @@ There are three different types of searching:
This searches the same directories, but in a different order.
Note that completion for ":find", ":sfind", and ":tabfind" commands do not
currently work with 'path' items that contain a url or use the double star
currently work with 'path' items that contain a URL or use the double star
with depth limiter (/usr/**2) or upward search (;) notations.
vim:tw=78:ts=8:ft=help:norl:
+14 -13
View File
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.0. Last change: 2017 Jul 30
*eval.txt* For Vim version 8.0. Last change: 2017 Aug 01
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1815,7 +1815,7 @@ v:scrollstart String describing the script or function that caused the
hit-enter prompt.
*v:servername* *servername-variable*
v:servername The resulting registered |x11-clientserver| name if any.
v:servername The resulting registered |client-server-name| if any.
Read-only.
@@ -2372,12 +2372,12 @@ tempname() String name for a temporary file
term_getattr({attr}, {what} Number get the value of attribute {what}
term_getcursor({buf}) List get the cursor position of a terminal
term_getjob({buf}) Job get the job associated with a terminal
term_getline({buf}[, {row}]) String get a line of text from a terminal
term_getline({buf}, {row}) String get a line of text from a terminal
term_getsize({buf}) List get the size of a terminal
term_getstatus({buf}) String get the status of a terminal
term_gettitle({buf}) String get the title of a terminal
term_list() List get the list of terminal buffers
term_scrape({buf}[, {row}]) List get row of a terminal screen
term_scrape({buf}, {row}) List get row of a terminal screen
term_sendkeys({buf}, {keys}) none send keystrokes to a terminal
term_start({cmd}, {options}) Job open a terminal window and run a job
term_wait({buf}) Number wait for screen to be updated
@@ -7916,8 +7916,9 @@ term_getattr({attr}, {what}) *term_getattr()*
term_getcursor({buf}) *term_getcursor()*
Get the cusor position of terminal {buf}. Returns a list with
three numbers: [rows, cols, visible]. "rows" and "cols" are
zero based. "visible" is one when the cursor is visible, zero
when it is hidden.
one based, the first sceen cell is row 1, column 1.
"visible" is one when the cursor is visible, zero when it is
hidden.
This is the cursor position of the terminal itself, not of the
Vim window.
@@ -7930,13 +7931,12 @@ term_getjob({buf}) *term_getjob()*
Get the Job associated with terminal window {buf}.
{buf} is used as with |term_getsize()|.
term_getline({buf} [, {row}]) *term_getline()*
term_getline({buf}, {row}) *term_getline()*
Get a line of text from the terminal window of {buf}.
{buf} is used as with |term_getsize()|.
The first line has {row} zero. When {row} is invalid an empty
string is returned. When {row} is omitted, the cursor line is
used.
The first line has {row} one. When {row} "." the cursor line
is used. When {row} is invalid an empty string is returned.
term_getsize({buf}) *term_getsize()*
Get the size of terminal {buf}. Returns a list with two
@@ -7971,12 +7971,12 @@ term_list() *term_list()*
Return a list with the buffer numbers of all buffers for
terminal windows.
term_scrape({buf} [, {row}]) *term_scrape()*
term_scrape({buf}, {row}) *term_scrape()*
Get the contents of {row} of terminal screen of {buf}.
For {buf} see |term_getsize()|.
The first {row} is zero. When {row} is invalid an empty list
is returned. When {row} is omitted the cursor line is used.
The first line has {row} one. When {row} "." the cursor line
is used. When {row} is invalid an empty string is returned.
Return a List containing a Dict for each screen cell:
"chars" character(s) at the cell
@@ -8731,6 +8731,7 @@ tag_any_white Compiled with support for any white characters in tags
files |tag-any-white|.
tcl Compiled with Tcl interface.
termguicolors Compiled with true color in terminal support.
terminal Compiled with |terminal| support.
terminfo Compiled with terminfo instead of termcap.
termresponse Compiled with support for |t_RV| and |v:termresponse|.
textobjects Compiled with support for |text-objects|.
+3 -3
View File
@@ -116,13 +116,13 @@ g:rustfmt_options~
*g:rust_playpen_url*
g:rust_playpen_url~
Set this option to override the url for the playpen to use: >
Set this option to override the URL for the playpen to use: >
let g:rust_playpen_url = 'https://play.rust-lang.org/'
<
*g:rust_shortener_url*
g:rust_shortener_url~
Set this option to override the url for the url shortener: >
Set this option to override the URL for the URL shortener: >
let g:rust_shortener_url = 'https://is.gd/'
<
@@ -199,7 +199,7 @@ COMMANDS *rust-commands*
|g:rust_playpen_url| is the base URL to the playpen, by default
"https://play.rust-lang.org/".
|g:rust_shortener_url| is the base url for the shorterner, by
|g:rust_shortener_url| is the base URL for the shorterner, by
default "https://is.gd/"
:RustFmt *:RustFmt*
+2 -2
View File
@@ -1,4 +1,4 @@
*gui_x11.txt* For Vim version 8.0. Last change: 2017 Jun 27
*gui_x11.txt* For Vim version 8.0. Last change: 2017 Jul 28
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -682,7 +682,7 @@ Of these three, Vim uses PRIMARY when reading and writing the "* register
register. Vim does not access the SECONDARY selection.
Examples: (assuming the default option values)
- Select an URL in Visual mode in Vim. Go to your browser and click the
- Select a URL in Visual mode in Vim. Go to your browser and click the
middle mouse button in the URL text field. The selected text will be
inserted (hopefully!). Note: in Firefox you can set the
middlemouse.contentLoadURL preference to true in about:config, then the
+4 -1
View File
@@ -1,4 +1,4 @@
*index.txt* For Vim version 8.0. Last change: 2017 Jul 16
*index.txt* For Vim version 8.0. Last change: 2017 Jul 30
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -528,8 +528,10 @@ tag command action in Normal mode ~
|CTRL-W_CTRL-]| CTRL-W CTRL-] same as "CTRL-W ]"
|CTRL-W_CTRL-^| CTRL-W CTRL-^ same as "CTRL-W ^"
|CTRL-W_CTRL-_| CTRL-W CTRL-_ same as "CTRL-W _"
|CTRL-W_quote| CTRL-W " terminal window: paste register
|CTRL-W_+| CTRL-W + increase current window height N lines
|CTRL-W_-| CTRL-W - decrease current window height N lines
|CTRL-W_.| CTRL-W . terminal window: type CTRL-W
|CTRL-W_:| CTRL-W : same as |:|, edit a command line
|CTRL-W_<| CTRL-W < decrease current window width N columns
|CTRL-W_=| CTRL-W = make all windows the same height & width
@@ -538,6 +540,7 @@ tag command action in Normal mode ~
|CTRL-W_J| CTRL-W J move current window to the very bottom
|CTRL-W_K| CTRL-W K move current window to the very top
|CTRL-W_L| CTRL-W L move current window to the far right
|CTRL-W_N| CTRL-W N terminal window: go to Terminal mode
|CTRL-W_P| CTRL-W P go to preview window
|CTRL-W_R| CTRL-W R rotate windows upwards N times
|CTRL-W_S| CTRL-W S same as "CTRL-W s"
+7 -2
View File
@@ -1,4 +1,4 @@
*intro.txt* For Vim version 8.0. Last change: 2017 Jul 17
*intro.txt* For Vim version 8.0. Last change: 2017 Jul 30
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -566,7 +566,7 @@ Ex mode Like Command-line mode, but after entering a command
you remain in Ex mode. Very limited editing of the
command line. |Ex-mode|
There are six ADDITIONAL modes. These are variants of the BASIC modes:
There are seven ADDITIONAL modes. These are variants of the BASIC modes:
*Operator-pending* *Operator-pending-mode*
Operator-pending mode This is like Normal mode, but after an operator
@@ -592,6 +592,11 @@ Insert Normal mode Entered when CTRL-O given in Insert mode. This is
If the 'showmode' option is on "-- (insert) --" is
shown at the bottom of the window.
Terminal Normal mode Using Normal mode in a terminal window. Making
changes is impossible. Use a insert command, such as
"a" or "i", to return control to the job running in
the terminal. Also called |Terminal-mode|.
Insert Visual mode Entered when starting a Visual selection from Insert
mode, e.g., by using CTRL-O and then "v", "V" or
CTRL-V. When the Visual selection ends, Vim returns
+11 -7
View File
@@ -1,4 +1,4 @@
*options.txt* For Vim version 8.0. Last change: 2017 Jul 23
*options.txt* For Vim version 8.0. Last change: 2017 Jul 31
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4163,7 +4163,8 @@ A jump table for the options with a short description can be found at |Q_op|.
L:SpellLocal,-:Conceal,+:Pmenu,=:PmenuSel,
x:PmenuSbar,X:PmenuThumb,*:TabLine,
#:TabLineSel,_:TabLineFill,!:CursorColumn,
.:CursorLine,o:ColorColumn,q:QuickFixLine")
.:CursorLine,o:ColorColumn,q:QuickFixLine,
$:StatusLineTerm")
global
{not in Vi}
This option can be used to set highlighting mode for various
@@ -7949,14 +7950,17 @@ A jump table for the options with a short description can be found at |Q_op|.
NOTE: This option is reset when 'compatible' is set.
*'termkey'* *'tk'*
'termkey' 'tk' string (default "CTRL-W")
'termkey' 'tk' string (default "")
local to window
{not in Vi}
The key that precedes a Vim command in a terminal window. Other keys
The key that starts a CTRL-W command in a terminal window. Other keys
are sent to the job running in the window.
The string must be one key stroke but can be multiple bytes.
NOT IMPLEMENTED YET
The <> notation can be used, e.g.: >
:set termkey=<C-L>
< The string must be one key stroke but can be multiple bytes.
When not set CTRL-W is used, so that CTRL-W : gets you to the command
line. If 'termkey' is set to CTRL-L then CTRL-L : gets you to the
command line.
*'termsize'* *'tms'*
'termsize' 'tms' string (default "")
+2 -2
View File
@@ -1,4 +1,4 @@
*pi_getscript.txt* For Vim version 7.0. Last change: 2013 Nov 29
*pi_getscript.txt* For Vim version 7.0. Last change: 2017 Aug 01
>
GETSCRIPT REFERENCE MANUAL by Charles E. Campbell
<
@@ -389,7 +389,7 @@ v36 Apr 22, 2013 : * (glts) suggested use of plugin/**/*.vim instead of
plugin/*.vim in globpath() call.
* (Andy Wokula) got warning message when setting
g:loaded_getscriptPlugin
v35 Apr 07, 2012 : * (MengHuan Yu) pointed out that the script url has
v35 Apr 07, 2012 : * (MengHuan Yu) pointed out that the script URL has
changed (somewhat). However, it doesn't work, and
the original one does (under Linux). I'll make it
yet-another-option.
+2 -1
View File
@@ -1,4 +1,4 @@
*quickref.txt* For Vim version 8.0. Last change: 2017 Jul 15
*quickref.txt* For Vim version 8.0. Last change: 2017 Aug 01
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -964,6 +964,7 @@ Short explanation of each option: *option-list*
'viewdir' 'vdir' directory where to store files with :mkview
'viewoptions' 'vop' specifies what to save for :mkview
'viminfo' 'vi' use .viminfo file upon startup and exiting
'viminfofile' 'vif' file name used for the viminfo file
'virtualedit' 've' when to use virtual editing
'visualbell' 'vb' use visual bell instead of beeping
'warn' warn for shell command when buffer was changed
+2 -2
View File
@@ -1,4 +1,4 @@
*remote.txt* For Vim version 8.0. Last change: 2017 Mar 18
*remote.txt* For Vim version 8.0. Last change: 2017 Aug 01
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -100,7 +100,7 @@ Tell the remote server "BLA" to write all files and exit: >
vim --servername BLA --remote-send '<C-\><C-N>:wqa<CR>'
SERVER NAME
SERVER NAME *client-server-name*
By default Vim will try to register the name under which it was invoked (gvim,
egvim ...). This can be overridden with the --servername argument. If the
+14 -2
View File
@@ -3583,6 +3583,7 @@ CTRL-V-alternative gui_w32.txt /*CTRL-V-alternative*
CTRL-W index.txt /*CTRL-W*
CTRL-W_+ windows.txt /*CTRL-W_+*
CTRL-W_- windows.txt /*CTRL-W_-*
CTRL-W_. terminal.txt /*CTRL-W_.*
CTRL-W_: windows.txt /*CTRL-W_:*
CTRL-W_< windows.txt /*CTRL-W_<*
CTRL-W_<BS> windows.txt /*CTRL-W_<BS>*
@@ -3622,6 +3623,7 @@ CTRL-W_H windows.txt /*CTRL-W_H*
CTRL-W_J windows.txt /*CTRL-W_J*
CTRL-W_K windows.txt /*CTRL-W_K*
CTRL-W_L windows.txt /*CTRL-W_L*
CTRL-W_N terminal.txt /*CTRL-W_N*
CTRL-W_P windows.txt /*CTRL-W_P*
CTRL-W_R windows.txt /*CTRL-W_R*
CTRL-W_S windows.txt /*CTRL-W_S*
@@ -3649,6 +3651,7 @@ CTRL-W_n windows.txt /*CTRL-W_n*
CTRL-W_o windows.txt /*CTRL-W_o*
CTRL-W_p windows.txt /*CTRL-W_p*
CTRL-W_q windows.txt /*CTRL-W_q*
CTRL-W_quote terminal.txt /*CTRL-W_quote*
CTRL-W_r windows.txt /*CTRL-W_r*
CTRL-W_s windows.txt /*CTRL-W_s*
CTRL-W_t windows.txt /*CTRL-W_t*
@@ -4586,6 +4589,7 @@ E942 eval.txt /*E942*
E943 message.txt /*E943*
E944 pattern.txt /*E944*
E945 pattern.txt /*E945*
E946 terminal.txt /*E946*
E95 message.txt /*E95*
E96 diff.txt /*E96*
E97 diff.txt /*E97*
@@ -4829,6 +4833,7 @@ TabNew autocmd.txt /*TabNew*
Tcl if_tcl.txt /*Tcl*
TermChanged autocmd.txt /*TermChanged*
TermResponse autocmd.txt /*TermResponse*
Terminal-mode terminal.txt /*Terminal-mode*
TextChanged autocmd.txt /*TextChanged*
TextChangedI autocmd.txt /*TextChangedI*
Transact-SQL ft_sql.txt /*Transact-SQL*
@@ -5467,6 +5472,7 @@ cinoptions-values indent.txt /*cinoptions-values*
clear-undo undo.txt /*clear-undo*
clearmatches() eval.txt /*clearmatches()*
client-server remote.txt /*client-server*
client-server-name remote.txt /*client-server-name*
clientserver remote.txt /*clientserver*
clipboard gui.txt /*clipboard*
clipboard-autoselect options.txt /*clipboard-autoselect*
@@ -8891,11 +8897,17 @@ tempname() eval.txt /*tempname()*
term-dependent-settings term.txt /*term-dependent-settings*
term-list syntax.txt /*term-list*
term.txt term.txt /*term.txt*
term_getattr() eval.txt /*term_getattr()*
term_getcursor() eval.txt /*term_getcursor()*
term_getjob() eval.txt /*term_getjob()*
term_getline() eval.txt /*term_getline()*
term_getsize() eval.txt /*term_getsize()*
term_open() eval.txt /*term_open()*
term_getstatus() eval.txt /*term_getstatus()*
term_gettitle() eval.txt /*term_gettitle()*
term_list() eval.txt /*term_list()*
term_scrape() eval.txt /*term_scrape()*
term_sendkeys() eval.txt /*term_sendkeys()*
term_setsize() eval.txt /*term_setsize()*
term_start() eval.txt /*term_start()*
term_wait() eval.txt /*term_wait()*
termcap term.txt /*termcap*
termcap-changed version4.txt /*termcap-changed*
+40 -13
View File
@@ -1,4 +1,4 @@
*terminal.txt* For Vim version 8.0. Last change: 2017 Jul 30
*terminal.txt* For Vim version 8.0. Last change: 2017 Aug 01
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -48,6 +48,9 @@ See |CTRL-W| for more commands.
Special in the terminal window: *CTRL-W_.* *CTRL-W_N*
CTRL-W . send a CTRL-W to the job in the terminal
CTRL-W N go to Terminal Normal mode, see |Terminal-mode|
CTRL-W " {reg} paste register {reg} *CTRL-W_quote*
Also works with the = register to insert the result of
evaluating an expression.
See option 'termkey' for specifying another key instead of CTRL-W that
will work like CTRL-W. However, typing 'termkey' twice sends 'termkey' to
@@ -76,21 +79,28 @@ Syntax ~
If [command] is not given the 'shell' option is used.
A new buffer will be created, using [command] or
'shell' as the name. If a buffer by this name already
exists a number is added in parenthesis.
E.g. if "gdb" exists the second terminal buffer will
use "gdb (1)".
The window can be closed, in which case the buffer
becomes hidden. The command will not be stopped. The
`:buffer` command can be used to turn the current
window into a terminal window, using the existing
buffer. If there are unsaved changes this fails, use
! to force, as usual.
'shell' as the name, prefixed with a "!". If a buffer
by this name already exists a number is added in
parenthesis. E.g. if "gdb" exists the second terminal
buffer will use "!gdb (1)".
When the buffer associated with the terminal is wiped out the job is killed,
similar to calling `job_stop(job, "kill")`
So long as the job is running: If the window is closed the buffer becomes
hidden. The command will not be stopped. The `:buffer` command can be used
to turn the current window into a terminal window. If there are unsaved
changes this fails, use ! to force, as usual.
When the job has finished and no changes were made to the buffer: closing the
window will wipe out the buffer.
Before changes can be made to a terminal buffer, the 'modifiable' option must
be set. This is only possible when the job has finished. At the first change
the buffer will become a normal buffer and the highlighting is removed.
You may want to change the buffer name with |:file| to be able to write, since
the buffer name will still be set to the command.
Resizing ~
@@ -138,6 +148,23 @@ Unix ~
On Unix a pty is used to make it possible to run all kinds of commands. You
can even run Vim in the terminal! That's used for debugging, see below.
Environment variables are used to pass information to the running job:
TERM name of the terminal, 'term'
ROWS number of rows in the terminal initially
LINES same as ROWS
COLUMNS number of columns in the terminal initially
COLORS number of colors, 't_Co' (256*256*256 in the GUI)
VIM_SERVERNAME v:servername
The |client-server| feature can be used to communicate with the Vim instance
where the job was started. This only works when v:servername is not empty.
If needed you can set it with: >
call remote_startserver('vim-server')
In the job you can then do something like: >
vim --servername $VIM_SERVERNAME --remote +123 some_file.c
This will open the file "some_file.c" and put the cursor on line 123.
MS-Windows ~
@@ -191,7 +218,7 @@ This opens three windows:
This uses two terminal windows. To open the gdb window: >
:term gdb [arguments]
To open the terminal to run the tested program |term_open()| is used.
To open the terminal to run the tested program |term_start()| is used.
TODO
+35 -10
View File
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.0. Last change: 2017 Jul 22
*todo.txt* For Vim version 8.0. Last change: 2017 Aug 01
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -35,6 +35,8 @@ entered there will not be repeated below, unless there is extra information.
*known-bugs*
-------------------- Known bugs and current work -----------------------
Check out coverity reports.
No maintainer for Vietnamese translations.
No maintainer for Simplified Chinese translations.
@@ -43,7 +45,8 @@ Terminal emulator window:
- Lots of stuff to implement, see src/terminal.c
- Running a shell command from the GUI still has limitations. Look into how
the terminal emulator of the Vim shell project can help:
http://vimshell.wana.at
http://code.hootsuite.com/vimshell/
- Add winpty.dll and winpty-agent.exe in the NSIS build.
- Add debugger interface. Implementation for gdb by Xavier de Gaye. Should
work like an IDE. Try to keep it generic. Now found here:
http://clewn.sf.net.
@@ -52,9 +55,6 @@ Terminal emulator window:
- make it possible to have 'defineAnnoType' also handle terminal colors.
- send 'balloonText' events for the cursor position (using CursorHold ?)
in terminal mode.
- Feature: switch between "running job" and a normal buffer (possibly
read-only) to allow for searching, copy/paste, etc. (Domnique). Having a
(large) scrollback would be useful.
+channel:
- Try out background make plugin:
@@ -125,6 +125,9 @@ Regexp problems:
Another one: echom matchstr(" sdfsfsf\n sfdsdfsdf",'[^\n]*')
(2017 May 15, #1252)
test_gui fails with gnome2: cannot create .gnome2 dir
use testdir/Xfakehome instead of does/not/exist?
Patch for quickfix: parse lines for any quickfix list. (Yegappan Lakshmanan,
2017 Jul 20)
@@ -138,6 +141,8 @@ ml_get errors with buggy script. (Dominique, 2017 Apr 30)
Error in emsg with buggy script. (Dominique, 2017 Apr 30)
Patch for Murphi syntax. (Matthew Fernandez, 2017 Jul 24)
Better detection of strace file. (Steven Fernandez, 2017 Jul 12, #1837)
Bug with conceal mode: 3rd element returned by synconcealed() differs for
@@ -147,6 +152,11 @@ Add options_default() / options_restore() to set several options to Vim
defaults for a plugin. Comments from Zyx, 2017 May 10.
Perhaps use a vimcontext / endvimcontext command block.
Signs drawn on top of messages. (worp, #1907)
Folds open when job writes to another buffer. (Jonathan Fudger, 2017 Jul 31)
Already fixed?
Illegal memory access, requires ASAN to see. (Dominique Pelle, 2015 Jul 28)
Still happens (2017 Jul 9)
@@ -154,12 +164,15 @@ Memory leak in test_arabic.
Include Haiku port? (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24)
It can replace the BeOS code, which is likely not used anymore.
Now on github: #1856. Is not up-to-date.
Now on github: #1856. Is now up-to-date?
Refactored HTML indent file. (Michael Lee, #1821)
Using uninitialzed value in test_crypt.
Test_writefile_fails_conversion failure on Solaris because if different iconv
behavior. Skip when "uname" returns "SunOS"? (Pavel Heimlich, #1872)
All functions are global, which makes functions like get() and len() awkward.
For the future use the ~get() and ~len() syntax, e.g.:
mylist~get(idx)
@@ -178,10 +191,19 @@ clip_x11_request_selection_cb() is called with zero value and length.
Also: Get an error message from free() in the process that owns the selection.
Seems to happen when the selection is requested the second time, but before
clip_x11_convert_selection_cb() is invoked, thus in X library code.
Patch to fix this by Kiichi, 2017 Jul 11, #1822)
Kazunobu Kuriyama is working on a proper fix. (2017 Jul 25)
Problem with three-piece comment. (Michael Lee, 2017 May 11, #1696)
Completion mixes results from the current buffer with tags and other files.
Happens when typing CTRL-N while still search for results. E.g., type "b_" in
terminal.c and then CTRL-N twice.
Should do current file first and not split it up when more results are found.
(Also #1890)
Python: After "import vim" error messages only show the first line of the
stack trace. (Yggdroot, 2017 Jul 28, #1887)
When checking if a bufref is valid, also check the buffer number, to catch the
case of :bwipe followed by :new.
@@ -189,7 +211,7 @@ Patch to skip writing a temp file for diffing if the buffer is equal to the
existing file. (Akria Sheng, 2017 Jul 22)
Could also skip writing lines that are the same.
Files for Latvian language. (Vitolins, 2017 May 3, #1675)
Patch with Files for Latvian language. (Vitolins, 2017 May 3, #1675)
MS-Windows: Opening same file in a second gvim hangs. (Sven Bruggemann, 2017
Jul 4)
@@ -237,6 +259,9 @@ Is it possible to keep the complete menu open when calling complete()?
Memory leak in test97? The string is actually freed. Weird.
Patch to add configure flags to skip rtl, farsi and arabic support.
(Diego Carrión, #1867)
assert_fails() can only check for the first error. Make it possible to have
it catch multiple errors and check all of them.
@@ -5620,11 +5645,11 @@ Various improvements:
- Support %name% expansion for "gf" on Windows.
- Make "gf" work on "file://c:/path/name". "file:/c:/" and "file:///c:/"
should also work?
- Add 'urlpath', used like 'path' for when "gf" used on an URL?
- Add 'urlpath', used like 'path' for when "gf" used on a URL?
8 When using "gf" on an absolute file name, while editing a remote file
(starts with scp:// or http://) should prepend the method and machine
name.
- When finding an URL or file name, and it doesn't exist, try removing a
- When finding a URL or file name, and it doesn't exist, try removing a
trailing '.'.
- Add ":path" command modifier. Should work for every command that takes a
file name argument, to search for the file name in 'path'. Use
+6 -6
View File
@@ -1,10 +1,10 @@
" Vim filetype plugin file
" Language: Zsh shell script
" Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2015-05-29
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-zsh
" Language: Zsh shell script
" Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2015-05-29
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-zsh
if exists("b:did_ftplugin")
finish
+8 -9
View File
@@ -1,7 +1,7 @@
" Menu translations for Catalan
"
" Maintainer: Ernest Adrogué <eadrogue@gmx.net>
" Last Change: 6 Jun 2008
" Last Change: 26 Jul 2017
"
" Quit when menu translations have already been done.
@@ -70,9 +70,9 @@ menutrans Settings\ &Window Fin&estra\ d'opcions
menutrans Startup\ &Settings Opcions\ i&nicials
menutrans &Global\ Settings Opcions\ &globals
" submenú Edita/Opcions Globals
menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Ressalt\ de\ &patrons<Tab>:set\ hls!
menutrans Toggle\ Pattern\ &Highlight<Tab>:set\ hls! Ressaltat\ de\ &patrons<Tab>:set\ hls!
menutrans Toggle\ &Ignore-case<Tab>:set\ ic! Sensibilitat\ a\ les\ ma&júscules<Tab>:set\ ic!
menutrans Toggle\ &Showmatch<Tab>:set\ sm! &Ressalt\ de\ coincidències<Tab>:set\ sm!
menutrans Toggle\ &Showmatch<Tab>:set\ sm! &Ressaltat\ de\ coincidències<Tab>:set\ sm!
menutrans &Context\ lines Línies\ de\ co&ntext
menutrans &Virtual\ Edit Edició\ &virtual
" submenú Edita/Opcions Globals/Edició virtual
@@ -191,7 +191,7 @@ menutrans &Diff &Difer
menutrans &Update &Actualitza
menutrans &Get\ Block &Obtingues\ un\ bloc
menutrans &Put\ Block &Posa\ un\ bloc
menutrans &Make<Tab>:make Crida\ a\ &make<Tab>:make
menutrans &Make<Tab>:make Crida\ &make<Tab>:make
menutrans &List\ Errors<Tab>:cl Llista\ d'&errors<Tab>:cl
menutrans L&ist\ Messages<Tab>:cl! &Llista\ de\ missatges<Tab>:cl!
menutrans &Next\ Error<Tab>:cn Error\ se&güent<Tab>:cn
@@ -203,8 +203,7 @@ menutrans Error\ &Window F&inestra\ d'errors
menutrans &Update<Tab>:cwin &Actualitza<Tab>:cwin
menutrans &Open<Tab>:copen &Obre<Tab>:copen
menutrans &Close<Tab>:cclose &Tanca<Tab>:cclose
menutrans &Set\ Compiler &Compilador
menutrans &SeT\ Compiler &Compilador
menutrans Se&t\ Compiler &Compilador
menutrans &Convert\ to\ HEX<Tab>:%!xxd Converteix\ a\ &HEX<Tab>:%!xxd
menutrans Conve&rt\ back<Tab>:%!xxd\ -r Torna\ al\ format\ &original<Tab>:%!xxd\ -r
@@ -303,14 +302,14 @@ menutrans &Syntax &Sintaxi
menutrans &Manual &Manual
menutrans A&utomatic A&utomàtica
menutrans on/off\ for\ &This\ file Activa/Desactiva\ en\ &aquest\ fitxer
menutrans &Show\ filetypes\ in\ menu Mostra\ tots\ els\ &tipus\ al\ menú
menutrans &Show\ File\ Types\ in\ Menu Mostra\ tots\ els\ &tipus\ al\ menú
menutrans &Off &Desactiva
menutrans Co&lor\ test Prova\ dels\ &colors
menutrans &Highlight\ test Prova\ del\ &ressalt
menutrans &Highlight\ test Prova\ del\ &ressaltat
menutrans &Convert\ to\ HTML Converteix\ a\ &HTML
menutrans Assembly Ensamblador
menutrans Config Configuració
menutrans Set\ '&syntax'\ only Només\ el\ ressalt\ de\ sintaxi
menutrans Set\ '&syntax'\ only Només\ el\ ressaltat\ de\ sintaxi
menutrans Set\ '&filetype'\ too Carrega\ també\ els\ plugins
let &cpo = s:keepcpo
+3 -1
View File
@@ -1,7 +1,7 @@
" These commands create the option window.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2017 Jul 15
" Last Change: 2017 Aug 01
" If there already is an option window, jump to that one.
if bufwinnr("option-window") > 0
@@ -1323,6 +1323,8 @@ endif
if has("viminfo")
call append("$", "viminfo\tlist that specifies what to write in the viminfo file")
call <SID>OptionG("vi", &vi)
call append("$", "viminfofile\tfile name used for the viminfo file")
call <SID>OptionG("vif", &vif)
endif
if has("quickfix")
call append("$", "bufhidden\twhat happens with a buffer when it's no longer in a window")
+1 -12
View File
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: none; used to see highlighting
" Maintainer: Ronald Schild <rs@scutum.de>
" Last Change: 2001 Sep 02
" Last Change: 2017 Jul 28
" Version: 5.4n.1
" To see your current highlight settings, do
@@ -111,17 +111,6 @@ endif
nohlsearch
normal 0
" add autocommands to remove temporary file from buffer list
aug highlighttest
au!
au BufUnload Highlight\ test if expand("<afile>") == "Highlight test"
au BufUnload Highlight\ test bdelete! Highlight\ test
au BufUnload Highlight\ test endif
au VimLeavePre * if bufexists("Highlight test")
au VimLeavePre * bdelete! Highlight\ test
au VimLeavePre * endif
aug END
" we don't want to save this temporary file
set nomodified
+192 -2
View File
File diff suppressed because one or more lines are too long
+281 -279
View File
File diff suppressed because it is too large Load Diff
+4 -1
View File
@@ -481,7 +481,10 @@ You need to set the following variables:
MZSCHEME: Where Racket is installed.
E.g. C:\Program Files (x86)\Racket
DYNAMIC_MZSCHEME: Whether dynamic linking is used. Usually, set to yes.
MZSCHEME_VER: Racket DLL version. E.g. 3m_9z0ds0 for Racket 6.3.
MZSCHEME_VER: Racket DLL version which is used for the file name.
E.g. 3m_9z0ds0 for Racket 6.3.
The DLL can be found under the lib directory. E.g.
C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll
MZSCHEME_COLLECTS: (Optional) Path of the collects directory used at
runtime. Default: $(MZSCHEME)\collects
User can override this with the PLTCOLLECTS environment
+25
View File
@@ -468,6 +468,31 @@ close_buffer(
int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE);
int wipe_buf = (action == DOBUF_WIPE);
#ifdef FEAT_TERMINAL
if (bt_terminal(buf))
{
if (term_job_running(buf->b_term))
{
if (wipe_buf)
/* Wiping out a terminal buffer kills the job. */
free_terminal(buf);
else
{
/* The job keeps running, hide the buffer. */
del_buf = FALSE;
unload_buf = FALSE;
}
}
else
{
/* A terminal buffer is wiped out if the job has finished. */
del_buf = TRUE;
unload_buf = TRUE;
wipe_buf = TRUE;
}
}
else
#endif
/*
* Force unloading or deleting when 'bufhidden' says so.
* The caller must take care of NOT deleting/freeing when 'bufhidden' is
+2 -1
View File
@@ -8365,7 +8365,8 @@ set_bool_option(
{
# ifdef FEAT_TERMINAL
/* Cannot set 'modifiable' when in Terminal mode. */
if (term_in_terminal_mode())
if (term_in_terminal_mode()
|| (bt_terminal(curbuf) && !term_is_finished(curbuf)))
{
curbuf->b_p_ma = FALSE;
return (char_u *)N_("E946: Cannot make a terminal with running job modifiable");
+66 -16
View File
@@ -4100,6 +4100,9 @@ mch_parse_cmd(char_u *cmd, int use_shcf, char ***argv, int *argc)
#endif
#if !defined(USE_SYSTEM) || defined(FEAT_JOB_CHANNEL)
/*
* Set the environment for a child process.
*/
static void
set_child_environment(long rows, long columns, char *term)
{
@@ -4111,6 +4114,9 @@ set_child_environment(long rows, long columns, char *term)
static char envbuf_Lines[20];
static char envbuf_Columns[20];
static char envbuf_Colors[20];
# ifdef FEAT_CLIENTSERVER
static char envbuf_Servername[60];
# endif
# endif
long colors =
# ifdef FEAT_GUI
@@ -4118,7 +4124,6 @@ set_child_environment(long rows, long columns, char *term)
# endif
t_colors;
/* Simulate to have a dumb terminal (for now) */
# ifdef HAVE_SETENV
setenv("TERM", term, 1);
sprintf((char *)envbuf, "%ld", rows);
@@ -4129,10 +4134,14 @@ set_child_environment(long rows, long columns, char *term)
setenv("COLUMNS", (char *)envbuf, 1);
sprintf((char *)envbuf, "%ld", colors);
setenv("COLORS", (char *)envbuf, 1);
# ifdef FEAT_CLIENTSERVER
setenv("VIM_SERVERNAME", serverName == NULL ? "" : (char *)serverName, 1);
# endif
# else
/*
* Putenv does not copy the string, it has to remain valid.
* Use a static array to avoid losing allocated memory.
* This won't work well when running multiple children...
*/
vim_snprintf(envbuf_Term, sizeof(envbuf_Term), "TERM=%s", term);
putenv(envbuf_Term);
@@ -4145,6 +4154,11 @@ set_child_environment(long rows, long columns, char *term)
putenv(envbuf_Columns);
vim_snprintf(envbuf_Colors, sizeof(envbuf_Colors), "COLORS=%ld", colors);
putenv(envbuf_Colors);
# ifdef FEAT_CLIENTSERVER
vim_snprintf(envbuf_Servername, sizeof(envbuf_Servername),
"VIM_SERVERNAME=%s", serverName == NULL ? "" : (char *)serverName);
putenv(envbuf_Servername);
# endif
# endif
}
@@ -4156,6 +4170,11 @@ set_default_child_environment(void)
#endif
#if defined(FEAT_GUI) || defined(FEAT_JOB_CHANNEL)
/*
* Open a PTY, with FD for the master and slave side.
* When failing "pty_master_fd" and "pty_slave_fd" are -1.
* When successful both file descriptors are stored.
*/
static void
open_pty(int *pty_master_fd, int *pty_slave_fd)
{
@@ -4181,6 +4200,26 @@ open_pty(int *pty_master_fd, int *pty_slave_fd)
}
#endif
/*
* Send SIGINT to a child process if "c" is an interrupt character.
*/
void
may_send_sigint(int c UNUSED, pid_t pid UNUSED, pid_t wpid UNUSED)
{
# ifdef SIGINT
if (c == Ctrl_C || c == intr_char)
{
# ifdef HAVE_SETSID
kill(-pid, SIGINT);
# else
kill(0, SIGINT);
# endif
if (wpid > 0)
kill(wpid, SIGINT);
}
# endif
}
int
mch_call_shell(
char_u *cmd,
@@ -4764,23 +4803,12 @@ mch_call_shell(
*/
if (len == 1 && (pty_master_fd < 0 || cmd != NULL))
{
# ifdef SIGINT
/*
* Send SIGINT to the child's group or all
* processes in our group.
*/
if (ta_buf[ta_len] == Ctrl_C
|| ta_buf[ta_len] == intr_char)
{
# ifdef HAVE_SETSID
kill(-pid, SIGINT);
# else
kill(0, SIGINT);
# endif
if (wpid > 0)
kill(wpid, SIGINT);
}
# endif
may_send_sigint(ta_buf[ta_len], pid, wpid);
if (pty_master_fd < 0 && toshell_fd >= 0
&& ta_buf[ta_len] == Ctrl_D)
{
@@ -5363,15 +5391,26 @@ mch_job_start(char **argv, job_T *job, jobopt_T *options)
if (null_fd >= 0)
close(null_fd);
if (pty_slave_fd >= 0)
{
/* push stream discipline modules */
SetupSlavePTY(pty_slave_fd);
# ifdef TIOCSCTTY
/* Try to become controlling tty (probably doesn't work,
* unless run by root) */
ioctl(pty_slave_fd, TIOCSCTTY, (char *)NULL);
# endif
}
/* See above for type of argv. */
execvp(argv[0], argv);
if (stderr_works)
perror("executing job failed");
#ifdef EXITFREE
# ifdef EXITFREE
/* calling free_all_mem() here causes problems. Ignore valgrind
* reporting possibly leaked memory. */
#endif
# endif
_exit(EXEC_FAILED); /* exec failed, return failure code */
}
@@ -5402,6 +5441,17 @@ mch_job_start(char **argv, job_T *job, jobopt_T *options)
? INVALID_FD : fd_err[0] < 0 ? pty_master_fd : fd_err[0]);
channel_set_job(channel, job, options);
}
else
{
if (fd_in[1] >= 0)
close(fd_in[1]);
if (fd_out[0] >= 0)
close(fd_out[0]);
if (fd_err[0] >= 0)
close(fd_err[0]);
if (pty_master_fd >= 0)
close(pty_master_fd);
}
/* success! */
return;
+8 -2
View File
@@ -84,7 +84,13 @@ language.
You should include your name and E-mail address instead, for example:
msgstr "Berichten übersetzt bei: John Doe <john@doe.org>"
(3) Clean up
(3) Remove unused messages (optional)
Remove messages that have been marked as obsolete.
Such messages start with "#~".
The cleanup script will also do that (see next step).
(4) Clean up
This is very important to make sure the translation works on all systems.
Comment-out all non-translated strings. There are two types:
- items marked with "#, fuzzy"
@@ -100,7 +106,7 @@ language.
messed up by changes in line numbers and show the actual changes in the
text.
(4) Check:
(5) Check:
While editing the .po file:
:source check.vim
+2492 -1754
View File
File diff suppressed because it is too large Load Diff
+10
View File
@@ -143,6 +143,16 @@ while 1
endif
endwhile
" Check that the file is well formed according to msgfmts understanding
if executable("msgfmt")
let filename = expand("%")
let a = system("msgfmt --statistics OLD_PO_FILE_INPUT=yes " . filename)
if v:shell_error != 0
let error = matchstr(a, filename.':\zs\d\+\ze:')+0
for line in split(a, '\n') | echomsg line | endfor
endif
endif
if error == 0
" If all was OK restore the view.
call winrestview(wsv)
+317 -620
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -57,6 +57,7 @@ int mch_report_winsize(int fd, int rows, int cols);
void mch_set_shellsize(void);
void mch_new_shellsize(void);
int mch_parse_cmd(char_u *cmd, int use_shcf, char ***argv, int *argc);
void may_send_sigint(int c, pid_t pid, pid_t wpid);
int mch_call_shell(char_u *cmd, int options);
void mch_job_start(char **argv, job_T *job, jobopt_T *options);
char *mch_job_status(job_T *job);
+1 -1
View File
@@ -23,7 +23,7 @@ void ex_syntime(exarg_T *eap);
char_u *get_syntime_arg(expand_T *xp, int idx);
void init_highlight(int both, int reset);
int load_colors(char_u *name);
int lookup_color(int idx, int foreground);
int lookup_color(int idx, int foreground, int *boldp);
void do_highlight(char_u *line, int forceit, int init);
void free_highlight(void);
void restore_cterm_colors(void);
+1
View File
@@ -2,6 +2,7 @@
void ex_terminal(exarg_T *eap);
void free_terminal(buf_T *buf);
void write_to_term(buf_T *buffer, char_u *msg, channel_T *channel);
int term_job_running(term_T *term);
int term_in_terminal_mode(void);
void term_leave_terminal_mode(void);
int term_use_loop(void);
+4
View File
@@ -3527,7 +3527,11 @@ post2nfa(int *postfix, int *end, int nfa_calc_size)
{
/* NFA_ZEND -> NFA_END_PATTERN -> NFA_SKIP -> what follows. */
skip = alloc_state(NFA_SKIP, NULL, NULL);
if (skip == NULL)
goto theend;
zend = alloc_state(NFA_ZEND, s1, NULL);
if (zend == NULL)
goto theend;
s1->out= skip;
patch(e.out, zend);
PUSH(frag(s, list1(&skip->out)));
+4 -1
View File
@@ -1019,8 +1019,11 @@ update_debug_sign(buf_T *buf, linenr_T lnum)
}
/* Return when there is nothing to do, screen updating is already
* happening (recursive call) or still starting up. */
* happening (recursive call), messages on the screen or still starting up.
*/
if (!doit || updating_screen
|| State == ASKMORE || State == HITRETURN
|| msg_scrolled
#ifdef FEAT_GUI
|| gui.starting
#endif
+18 -7
View File
@@ -7276,9 +7276,11 @@ static int color_numbers_8[28] = {0, 4, 2, 6,
/*
* Lookup the "cterm" value to be used for color with index "idx" in
* color_names[].
* "boldp" will be set to TRUE or FALSE for a foreground color when using 8
* colors, otherwise it will be unchanged.
*/
int
lookup_color(int idx, int foreground)
lookup_color(int idx, int foreground, int *boldp)
{
int color = color_numbers_16[idx];
char_u *p;
@@ -7300,12 +7302,9 @@ lookup_color(int idx, int foreground)
/* set/reset bold attribute to get light foreground
* colors (on some terminals, e.g. "linux") */
if (color & 8)
{
HL_TABLE()[idx].sg_cterm |= HL_BOLD;
HL_TABLE()[idx].sg_cterm_bold = TRUE;
}
*boldp = TRUE;
else
HL_TABLE()[idx].sg_cterm &= ~HL_BOLD;
*boldp = FALSE;
}
color &= 7; /* truncate to 8 colors */
}
@@ -7838,6 +7837,8 @@ do_highlight(
}
else
{
int bold = MAYBE;
#if defined(__QNXNTO__)
static int *color_numbers_8_qansi = color_numbers_8;
/* On qnx, the 8 & 16 color arrays are the same */
@@ -7858,7 +7859,17 @@ do_highlight(
break;
}
color = lookup_color(i, key[5] == 'F');
color = lookup_color(i, key[5] == 'F', &bold);
/* set/reset bold attribute to get light foreground
* colors (on some terminals, e.g. "linux") */
if (bold == TRUE)
{
HL_TABLE()[idx].sg_cterm |= HL_BOLD;
HL_TABLE()[idx].sg_cterm_bold = TRUE;
}
else if (bold == FALSE)
HL_TABLE()[idx].sg_cterm &= ~HL_BOLD;
}
/* Add one to the argument, to avoid zero. Zero is used for
+69 -45
View File
@@ -36,9 +36,7 @@
* that buffer, attributes come from the scrollback buffer tl_scrollback.
*
* TODO:
* - Use "." for current line instead of optional.
* - make row and cols one-based instead of zero-based in term_ functions.
* - Add StatusLineTerm highlighting
* - don't allow exiting Vim when a terminal is still running a job
* - in bash mouse clicks are inserting characters.
* - mouse scroll: when over other window, scroll that window.
* - For the scrollback buffer store lines in the buffer, only attributes in
@@ -56,10 +54,8 @@
* - do not store terminal window in viminfo. Or prefix term:// ?
* - add a character in :ls output
* - add 't' to mode()
* - when closing window and job has not ended, make terminal hidden?
* - when closing window and job has ended, make buffer hidden?
* - don't allow exiting Vim when a terminal is still running a job
* - use win_del_lines() to make scroll-up efficient.
* - implement term_setsize()
* - add test for giving error for invalid 'termsize' value.
* - support minimal size when 'termsize' is "rows*cols".
* - support minimal size when 'termsize' is empty?
@@ -71,6 +67,8 @@
* conversions.
* - update ":help function-list" for terminal functions.
* - In the GUI use a terminal emulator for :!cmd.
* - Copy text in the vterm to the Vim buffer once in a while, so that
* completion works.
*/
#include "vim.h"
@@ -219,17 +217,19 @@ ex_terminal(exarg_T *eap)
if (cmd == NULL || *cmd == NUL)
cmd = p_sh;
if (buflist_findname(cmd) == NULL)
curbuf->b_ffname = vim_strsave(cmd);
else
{
int i;
size_t len = STRLEN(cmd) + 10;
char_u *p = alloc((int)len);
for (i = 1; p != NULL; ++i)
for (i = 0; p != NULL; ++i)
{
vim_snprintf((char *)p, len, "%s (%d)", cmd, i);
/* Prepend a ! to the command name to avoid the buffer name equals
* the executable, otherwise ":w!" would overwrite it. */
if (i == 0)
vim_snprintf((char *)p, len, "!%s", cmd);
else
vim_snprintf((char *)p, len, "!%s (%d)", cmd, i);
if (buflist_findname(p) == NULL)
{
curbuf->b_ffname = p;
@@ -239,8 +239,8 @@ ex_terminal(exarg_T *eap)
}
curbuf->b_fname = curbuf->b_ffname;
/* Mark the buffer as changed, so that it's not easy to abandon the job. */
curbuf->b_changed = TRUE;
/* Mark the buffer as not modifiable. It can only be made modifiable after
* the job finished. */
curbuf->b_p_ma = FALSE;
set_string_option_direct((char_u *)"buftype", -1,
(char_u *)"terminal", OPT_FREE|OPT_LOCAL, 0);
@@ -261,8 +261,6 @@ ex_terminal(exarg_T *eap)
* free_terminal(). */
do_buffer(DOBUF_WIPE, DOBUF_CURRENT, FORWARD, 0, TRUE);
}
/* TODO: Setup pty, see mch_call_shell(). */
}
/*
@@ -571,7 +569,7 @@ term_convert_key(term_T *term, int c, char *buf)
/*
* Return TRUE if the job for "term" is still running.
*/
static int
int
term_job_running(term_T *term)
{
/* Also consider the job finished when the channel is closed, to avoid a
@@ -967,6 +965,17 @@ terminal_loop(void)
/* job finished while waiting for a character */
break;
#ifdef UNIX
may_send_sigint(c, curbuf->b_term->tl_job->jv_pid, 0);
#endif
#ifdef WIN3264
if (c == Ctrl_C)
/* We don't know if the job can handle CTRL-C itself or not, this
* may kill the shell instead of killing the command running in the
* shell. */
mch_stop_job(curbuf->b_term->tl_job, "quit")
#endif
if (c == (termkey == 0 ? Ctrl_W : termkey))
{
int prev_c = c;
@@ -1258,7 +1267,7 @@ term_channel_closed(channel_T *ch)
* First color is 1. Return 0 if no match found.
*/
static int
color2index(VTermColor *color, int foreground)
color2index(VTermColor *color, int fg, int *boldp)
{
int red = color->red;
int blue = color->blue;
@@ -1270,16 +1279,16 @@ color2index(VTermColor *color, int foreground)
if (green == 0)
{
if (blue == 0)
return lookup_color(0, foreground) + 1; /* black */
return lookup_color(0, fg, boldp) + 1; /* black */
if (blue == 224)
return lookup_color(1, foreground) + 1; /* dark blue */
return lookup_color(1, fg, boldp) + 1; /* dark blue */
}
else if (green == 224)
{
if (blue == 0)
return lookup_color(2, foreground) + 1; /* dark green */
return lookup_color(2, fg, boldp) + 1; /* dark green */
if (blue == 224)
return lookup_color(3, foreground) + 1; /* dark cyan */
return lookup_color(3, fg, boldp) + 1; /* dark cyan */
}
}
else if (red == 224)
@@ -1287,38 +1296,38 @@ color2index(VTermColor *color, int foreground)
if (green == 0)
{
if (blue == 0)
return lookup_color(4, foreground) + 1; /* dark red */
return lookup_color(4, fg, boldp) + 1; /* dark red */
if (blue == 224)
return lookup_color(5, foreground) + 1; /* dark magenta */
return lookup_color(5, fg, boldp) + 1; /* dark magenta */
}
else if (green == 224)
{
if (blue == 0)
return lookup_color(6, foreground) + 1; /* dark yellow / brown */
return lookup_color(6, fg, boldp) + 1; /* dark yellow / brown */
if (blue == 224)
return lookup_color(8, foreground) + 1; /* white / light grey */
return lookup_color(8, fg, boldp) + 1; /* white / light grey */
}
}
else if (red == 128)
{
if (green == 128 && blue == 128)
return lookup_color(12, foreground) + 1; /* high intensity black / dark grey */
return lookup_color(12, fg, boldp) + 1; /* high intensity black / dark grey */
}
else if (red == 255)
{
if (green == 64)
{
if (blue == 64)
return lookup_color(20, foreground) + 1; /* light red */
return lookup_color(20, fg, boldp) + 1; /* light red */
if (blue == 255)
return lookup_color(22, foreground) + 1; /* light magenta */
return lookup_color(22, fg, boldp) + 1; /* light magenta */
}
else if (green == 255)
{
if (blue == 64)
return lookup_color(24, foreground) + 1; /* yellow */
return lookup_color(24, fg, boldp) + 1; /* yellow */
if (blue == 255)
return lookup_color(26, foreground) + 1; /* white */
return lookup_color(26, fg, boldp) + 1; /* white */
}
}
else if (red == 64)
@@ -1326,14 +1335,14 @@ color2index(VTermColor *color, int foreground)
if (green == 64)
{
if (blue == 255)
return lookup_color(14, foreground) + 1; /* light blue */
return lookup_color(14, fg, boldp) + 1; /* light blue */
}
else if (green == 255)
{
if (blue == 64)
return lookup_color(16, foreground) + 1; /* light green */
return lookup_color(16, fg, boldp) + 1; /* light green */
if (blue == 255)
return lookup_color(18, foreground) + 1; /* light cyan */
return lookup_color(18, fg, boldp) + 1; /* light cyan */
}
}
if (t_colors >= 256)
@@ -1404,8 +1413,14 @@ cell2attr(VTermScreenCell *cell)
else
#endif
{
return get_cterm_attr_idx(attr, color2index(&cell->fg, TRUE),
color2index(&cell->bg, FALSE));
int bold = MAYBE;
int fg = color2index(&cell->fg, TRUE, &bold);
int bg = color2index(&cell->bg, FALSE, &bold);
/* with 8 colors set the bold attribute to get a bright foreground */
if (bold == TRUE)
attr |= HL_BOLD;
return get_cterm_attr_idx(attr, fg, bg);
}
return 0;
}
@@ -1568,6 +1583,11 @@ term_change_in_curbuf(void)
{
free_scrollback(term);
redraw_buf_later(term->tl_buffer, NOT_VALID);
/* The buffer is now like a normal buffer, it cannot be easily
* abandoned when changed. */
set_string_option_direct((char_u *)"buftype", -1,
(char_u *)"", OPT_FREE|OPT_LOCAL, 0);
}
}
@@ -1768,8 +1788,8 @@ f_term_getcursor(typval_T *argvars, typval_T *rettv)
return;
l = rettv->vval.v_list;
list_append_number(l, buf->b_term->tl_cursor_pos.row);
list_append_number(l, buf->b_term->tl_cursor_pos.col);
list_append_number(l, buf->b_term->tl_cursor_pos.row + 1);
list_append_number(l, buf->b_term->tl_cursor_pos.col + 1);
list_append_number(l, buf->b_term->tl_cursor_visible);
}
@@ -1791,6 +1811,16 @@ f_term_getjob(typval_T *argvars, typval_T *rettv)
++rettv->vval.v_job->jv_refcount;
}
static int
get_row_number(typval_T *tv, term_T *term)
{
if (tv->v_type == VAR_STRING
&& tv->vval.v_string != NULL
&& STRCMP(tv->vval.v_string, ".") == 0)
return term->tl_cursor_pos.row;
return (int)get_tv_number(tv) - 1;
}
/*
* "term_getline(buf, row)" function
*/
@@ -1805,10 +1835,7 @@ f_term_getline(typval_T *argvars, typval_T *rettv)
if (buf == NULL)
return;
term = buf->b_term;
if (argvars[1].v_type == VAR_UNKNOWN)
row = term->tl_cursor_pos.row;
else
row = (int)get_tv_number(&argvars[1]);
row = get_row_number(&argvars[1], term);
if (term->tl_vterm == NULL)
{
@@ -1939,10 +1966,7 @@ f_term_scrape(typval_T *argvars, typval_T *rettv)
screen = vterm_obtain_screen(term->tl_vterm);
l = rettv->vval.v_list;
if (argvars[1].v_type == VAR_UNKNOWN)
pos.row = term->tl_cursor_pos.row;
else
pos.row = (int)get_tv_number(&argvars[1]);
pos.row = get_row_number(&argvars[1], term);
for (pos.col = 0; pos.col < term->tl_cols; )
{
dict_T *dcell;
+60 -4
View File
@@ -6,7 +6,9 @@ endif
source shared.vim
func Test_terminal_basic()
" Open a terminal with a shell, assign the job to g:job and return the buffer
" number.
func Run_shell_in_terminal()
let buf = term_start(&shell)
let termlist = term_list()
@@ -16,16 +18,70 @@ func Test_terminal_basic()
let g:job = term_getjob(buf)
call assert_equal(v:t_job, type(g:job))
call term_sendkeys(buf, "exit\r")
return buf
endfunc
" Stops the shell started by Run_shell_in_terminal().
func Stop_shell_in_terminal(buf)
call term_sendkeys(a:buf, "exit\r")
call WaitFor('job_status(g:job) == "dead"')
call assert_equal('dead', job_status(g:job))
endfunc
func Test_terminal_basic()
let buf = Run_shell_in_terminal()
call Stop_shell_in_terminal(buf)
call term_wait(buf)
" closing window wipes out the terminal buffer a with finished job
close
call assert_equal("", bufname(buf))
unlet g:job
endfunc
func Test_terminal_make_change()
let buf = Run_shell_in_terminal()
call Stop_shell_in_terminal(buf)
call term_wait(buf)
setlocal modifiable
exe "normal Axxx\<Esc>"
call assert_fails(buf . 'bwipe', 'E517')
undo
exe buf . 'bwipe'
unlet g:job
endfunc
func Test_terminal_wipe_buffer()
let buf = Run_shell_in_terminal()
exe buf . 'bwipe'
call WaitFor('job_status(g:job) == "dead"')
call assert_equal('dead', job_status(g:job))
call assert_equal("", bufname(buf))
unlet g:job
endfunc
func Test_terminal_hide_buffer()
let buf = Run_shell_in_terminal()
quit
for nr in range(1, winnr('$'))
call assert_notequal(winbufnr(nr), buf)
endfor
call assert_true(bufloaded(buf))
call assert_true(buflisted(buf))
exe 'split ' . buf . 'buf'
call Stop_shell_in_terminal(buf)
exe buf . 'bwipe'
unlet g:job
endfunc
func Check_123(buf)
let l = term_scrape(a:buf, 0)
let l = term_scrape(a:buf, 1)
call assert_true(len(l) > 0)
call assert_equal('1', l[0].chars)
call assert_equal('2', l[1].chars)
@@ -37,7 +93,7 @@ func Check_123(buf)
call assert_equal('#000000', l[0].bg)
endif
let l = term_getline(a:buf, 0)
let l = term_getline(a:buf, 1)
call assert_equal('123', l)
endfunc
+26
View File
@@ -784,6 +784,32 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
839,
/**/
838,
/**/
837,
/**/
836,
/**/
835,
/**/
834,
/**/
833,
/**/
832,
/**/
831,
/**/
830,
/**/
829,
/**/
828,
/**/
827,
/**/
826,
/**/