aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.ci/common/test.sh6
-rw-r--r--Makefile5
-rw-r--r--runtime/autoload/provider/clipboard.vim5
-rw-r--r--runtime/doc/change.txt6
-rw-r--r--runtime/doc/editing.txt10
-rw-r--r--runtime/doc/eval.txt529
-rw-r--r--runtime/doc/index.txt2
-rw-r--r--runtime/doc/nvim_clipboard.txt2
-rw-r--r--runtime/doc/options.txt14
-rw-r--r--runtime/doc/pattern.txt7
-rw-r--r--runtime/indent/lua.vim2
-rw-r--r--runtime/syntax/zsh.vim76
-rwxr-xr-xscripts/release.sh6
-rwxr-xr-xscripts/vim-patch.sh60
-rw-r--r--src/nvim/CMakeLists.txt9
-rw-r--r--src/nvim/eval.c15
-rw-r--r--src/nvim/ex_cmds.c29
-rw-r--r--src/nvim/ex_cmds2.c34
-rw-r--r--src/nvim/ex_docmd.c46
-rw-r--r--src/nvim/os/env.c117
-rw-r--r--src/nvim/testdir/Makefile3
-rw-r--r--src/nvim/testdir/test_help_tagjump.vim40
-rw-r--r--src/nvim/version.c7
-rw-r--r--test/functional/legacy/031_close_commands_spec.lua24
-rw-r--r--test/functional/legacy/068_text_formatting_spec.lua4
-rw-r--r--test/functional/terminal/buffer_spec.lua13
-rw-r--r--test/functional/terminal/ex_terminal_spec.lua23
27 files changed, 633 insertions, 461 deletions
diff --git a/.ci/common/test.sh b/.ci/common/test.sh
index 8c32b63ab2..225d88e072 100644
--- a/.ci/common/test.sh
+++ b/.ci/common/test.sh
@@ -49,11 +49,11 @@ asan_check() {
}
run_unittests() {
- ${MAKE_CMD} -C "${BUILD_DIR}" unittest
+ ${MAKE_CMD} unittest
}
run_functionaltests() {
- if ! ${MAKE_CMD} -C "${BUILD_DIR}" ${FUNCTIONALTEST}; then
+ if ! ${MAKE_CMD} ${FUNCTIONALTEST}; then
asan_check "${LOG_DIR}"
valgrind_check "${LOG_DIR}"
exit 1
@@ -63,7 +63,7 @@ run_functionaltests() {
}
run_oldtests() {
- if ! make -C "${TRAVIS_BUILD_DIR}/src/nvim/testdir"; then
+ if ! make oldtest; then
reset
asan_check "${LOG_DIR}"
valgrind_check "${LOG_DIR}"
diff --git a/Makefile b/Makefile
index 54f7edcf04..9d01347989 100644
--- a/Makefile
+++ b/Makefile
@@ -85,9 +85,12 @@ endif
mkdir -p build
touch $@
-oldtest: | nvim
+oldtest: | nvim tags
+$(SINGLE_MAKE) -C src/nvim/testdir $(MAKEOVERRIDES)
+tags: | nvim
+ +$(BUILD_CMD) -C build runtime/doc/tags
+
functionaltest: | nvim
+$(BUILD_CMD) -C build functionaltest
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim
index 9f1737639b..c7cb14ded7 100644
--- a/runtime/autoload/provider/clipboard.vim
+++ b/runtime/autoload/provider/clipboard.vim
@@ -52,6 +52,11 @@ elseif executable('lemonade')
let s:paste['+'] = 'lemonade paste'
let s:copy['*'] = 'lemonade copy'
let s:paste['*'] = 'lemonade paste'
+elseif executable('doitclient')
+ let s:copy['+'] = 'doitclient wclip'
+ let s:paste['+'] = 'doitclient wclip -r'
+ let s:copy['*'] = s:copy['+']
+ let s:paste['*'] = s:paste['+']
else
echom 'clipboard: No clipboard tool available. See :help nvim-clipboard'
finish
diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt
index 580353ea94..c8eb0705f6 100644
--- a/runtime/doc/change.txt
+++ b/runtime/doc/change.txt
@@ -1,4 +1,4 @@
-*change.txt* For Vim version 7.4. Last change: 2015 Oct 17
+*change.txt* For Vim version 7.4. Last change: 2016 Jan 02
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -423,7 +423,7 @@ This depends on the 'nrformats' option:
index.
For decimals a leading negative sign is considered for incrementing or
-decrementing, for binary and octal and hex values, it won't be considered. To
+decrementing, for binary, octal and hex values, it won't be considered. To
ignore the sign Visually select the number before using CTRL-A or CTRL-X.
For numbers with leading zeros (including all octal and hexadecimal numbers),
@@ -966,7 +966,7 @@ inside of strings can change! Also see 'softtabstop' option. >
:reg[isters] {arg} Display the contents of the numbered and named
registers that are mentioned in {arg}. For example: >
- :dis 1a
+ :reg 1a
< to display registers '1' and 'a'. Spaces are allowed
in {arg}.
diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt
index b1dd3239ea..c51286a350 100644
--- a/runtime/doc/editing.txt
+++ b/runtime/doc/editing.txt
@@ -1,4 +1,4 @@
-*editing.txt* For Vim version 7.4. Last change: 2015 Aug 25
+*editing.txt* For Vim version 7.4. Last change: 2016 Jan 03
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1042,10 +1042,10 @@ The names can be in upper- or lowercase.
the last file in the argument list has not been
edited. See |:confirm| and 'confirm'.
-:q[uit]! Quit without writing, also when currently visible
- buffers have changes. Does not exit when this is the
- last window and there is a changed hidden buffer.
- In this case, the first changed hidden buffer becomes
+:q[uit]! Quit without writing, also when the current buffer has
+ changes. If this is the last window and there is a
+ modified hidden buffer, the current buffer is
+ abandoned and the first changed hidden buffer becomes
the current buffer.
Use ":qall!" to exit always.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 6ae137a6ce..87b90900cb 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1776,374 +1776,373 @@ See |function-list| for a list grouped by what the function is used for.
USAGE RESULT DESCRIPTION ~
-abs( {expr}) Float or Number absolute value of {expr}
-acos( {expr}) Float arc cosine of {expr}
-add( {list}, {item}) List append {item} to |List| {list}
-and( {expr}, {expr}) Number bitwise AND
-append( {lnum}, {string}) Number append {string} below line {lnum}
-append( {lnum}, {list}) Number append lines {list} below line {lnum}
+abs({expr}) Float or Number absolute value of {expr}
+acos({expr}) Float arc cosine of {expr}
+add({list}, {item}) List append {item} to |List| {list}
+and({expr}, {expr}) Number bitwise AND
+append({lnum}, {string}) Number append {string} below line {lnum}
+append({lnum}, {list}) Number append lines {list} below line {lnum}
argc() Number number of files in the argument list
argidx() Number current index in the argument list
-arglistid( [{winnr} [, {tabnr}]])
- Number argument list id
-argv( {nr}) String {nr} entry of the argument list
-argv( ) List the argument list
-assert_equal( {exp}, {act} [, {msg}]) none assert {exp} equals {act}
+arglistid([{winnr} [, {tabnr}]]) Number argument list id
+argv({nr}) String {nr} entry of the argument list
+argv() List the argument list
+assert_equal({exp}, {act} [, {msg}]) none assert {exp} equals {act}
assert_exception({error} [, {msg}]) none assert {error} is in v:exception
-assert_false( {actual} [, {msg}]) none assert {actual} is false
-assert_true( {actual} [, {msg}]) none assert {actual} is true
-asin( {expr}) Float arc sine of {expr}
-atan( {expr}) Float arc tangent of {expr}
-atan2( {expr}, {expr}) Float arc tangent of {expr1} / {expr2}
-browse( {save}, {title}, {initdir}, {default})
+assert_false({actual} [, {msg}]) none assert {actual} is false
+assert_true({actual} [, {msg}]) none assert {actual} is true
+asin({expr}) Float arc sine of {expr}
+atan({expr}) Float arc tangent of {expr}
+atan2({expr}, {expr}) Float arc tangent of {expr1} / {expr2}
+browse({save}, {title}, {initdir}, {default})
String put up a file requester
-browsedir( {title}, {initdir}) String put up a directory requester
-bufexists( {expr}) Number TRUE if buffer {expr} exists
-buflisted( {expr}) Number TRUE if buffer {expr} is listed
-bufloaded( {expr}) Number TRUE if buffer {expr} is loaded
-bufname( {expr}) String Name of the buffer {expr}
-bufnr( {expr} [, {create}]) Number Number of the buffer {expr}
-bufwinnr( {expr}) Number window number of buffer {expr}
-byte2line( {byte}) Number line number at byte count {byte}
-byteidx( {expr}, {nr}) Number byte index of {nr}'th char in {expr}
-byteidxcomp( {expr}, {nr}) Number byte index of {nr}'th char in {expr}
-call( {func}, {arglist} [, {dict}])
+browsedir({title}, {initdir}) String put up a directory requester
+bufexists({expr}) Number TRUE if buffer {expr} exists
+buflisted({expr}) Number TRUE if buffer {expr} is listed
+bufloaded({expr}) Number TRUE if buffer {expr} is loaded
+bufname({expr}) String Name of the buffer {expr}
+bufnr({expr} [, {create}]) Number Number of the buffer {expr}
+bufwinnr({expr}) Number window number of buffer {expr}
+byte2line({byte}) Number line number at byte count {byte}
+byteidx({expr}, {nr}) Number byte index of {nr}'th char in {expr}
+byteidxcomp({expr}, {nr}) Number byte index of {nr}'th char in {expr}
+call({func}, {arglist} [, {dict}])
any call {func} with arguments {arglist}
-ceil( {expr}) Float round {expr} up
+ceil({expr}) Float round {expr} up
changenr() Number current change number
-char2nr( {expr}[, {utf8}]) Number ASCII/UTF8 value of first char in {expr}
-cindent( {lnum}) Number C indent for line {lnum}
+char2nr({expr}[, {utf8}]) Number ASCII/UTF8 value of first char in {expr}
+cindent({lnum}) Number C indent for line {lnum}
clearmatches() none clear all matches
-col( {expr}) Number column nr of cursor or mark
-complete( {startcol}, {matches}) none set Insert mode completion
-complete_add( {expr}) Number add completion match
+col({expr}) Number column nr of cursor or mark
+complete({startcol}, {matches}) none set Insert mode completion
+complete_add({expr}) Number add completion match
complete_check() Number check for key typed during completion
-confirm( {msg} [, {choices} [, {default} [, {type}]]])
+confirm({msg} [, {choices} [, {default} [, {type}]]])
Number number of choice picked by user
-copy( {expr}) any make a shallow copy of {expr}
-cos( {expr}) Float cosine of {expr}
-cosh( {expr}) Float hyperbolic cosine of {expr}
-count( {list}, {expr} [, {ic} [, {start}]])
+copy({expr}) any make a shallow copy of {expr}
+cos({expr}) Float cosine of {expr}
+cosh({expr}) Float hyperbolic cosine of {expr}
+count({list}, {expr} [, {ic} [, {start}]])
Number count how many {expr} are in {list}
-cscope_connection( [{num} , {dbpath} [, {prepend}]])
+cscope_connection([{num} , {dbpath} [, {prepend}]])
Number checks existence of cscope connection
-cursor( {lnum}, {col} [, {off}])
+cursor({lnum}, {col} [, {off}])
Number move cursor to {lnum}, {col}, {off}
-cursor( {list}) Number move cursor to position in {list}
-deepcopy( {expr} [, {noref}]) any make a full copy of {expr}
-delete( {fname} [, {flags}]) Number delete the file or directory {fname}
-dictwatcheradd( {dict}, {pattern}, {callback})
+cursor({list}) Number move cursor to position in {list}
+deepcopy({expr} [, {noref}]) any make a full copy of {expr}
+delete({fname} [, {flags}]) Number delete the file or directory {fname}
+dictwatcheradd({dict}, {pattern}, {callback})
Start watching a dictionary
-dictwatcherdel( {dict}, {pattern}, {callback})
+dictwatcherdel({dict}, {pattern}, {callback})
Stop watching a dictionary
did_filetype() Number TRUE if FileType autocommand event used
-diff_filler( {lnum}) Number diff filler lines about {lnum}
-diff_hlID( {lnum}, {col}) Number diff highlighting at {lnum}/{col}
-empty( {expr}) Number TRUE if {expr} is empty
-escape( {string}, {chars}) String escape {chars} in {string} with '\'
-eval( {string}) any evaluate {string} into its value
-eventhandler( ) Number TRUE if inside an event handler
-executable( {expr}) Number 1 if executable {expr} exists
-exepath( {expr}) String full path of the command {expr}
-exists( {expr}) Number TRUE if {expr} exists
-extend( {expr1}, {expr2} [, {expr3}])
+diff_filler({lnum}) Number diff filler lines about {lnum}
+diff_hlID({lnum}, {col}) Number diff highlighting at {lnum}/{col}
+empty({expr}) Number TRUE if {expr} is empty
+escape({string}, {chars}) String escape {chars} in {string} with '\'
+eval({string}) any evaluate {string} into its value
+eventhandler() Number TRUE if inside an event handler
+executable({expr}) Number 1 if executable {expr} exists
+exepath({expr}) String full path of the command {expr}
+exists({expr}) Number TRUE if {expr} exists
+extend({expr1}, {expr2} [, {expr3}])
List/Dict insert items of {expr2} into {expr1}
-exp( {expr}) Float exponential of {expr}
-expand( {expr} [, {nosuf} [, {list}]])
+exp({expr}) Float exponential of {expr}
+expand({expr} [, {nosuf} [, {list}]])
any expand special keywords in {expr}
-feedkeys( {string} [, {mode}]) Number add key sequence to typeahead buffer
-filereadable( {file}) Number TRUE if {file} is a readable file
-filewritable( {file}) Number TRUE if {file} is a writable file
-filter( {expr}, {string}) List/Dict remove items from {expr} where
+feedkeys({string} [, {mode}]) Number add key sequence to typeahead buffer
+filereadable({file}) Number TRUE if {file} is a readable file
+filewritable({file}) Number TRUE if {file} is a writable file
+filter({expr}, {string}) List/Dict remove items from {expr} where
{string} is 0
-finddir( {name}[, {path}[, {count}]])
+finddir({name}[, {path}[, {count}]])
String find directory {name} in {path}
-findfile( {name}[, {path}[, {count}]])
+findfile({name}[, {path}[, {count}]])
String find file {name} in {path}
-float2nr( {expr}) Number convert Float {expr} to a Number
-floor( {expr}) Float round {expr} down
-fmod( {expr1}, {expr2}) Float remainder of {expr1} / {expr2}
-fnameescape( {fname}) String escape special characters in {fname}
-fnamemodify( {fname}, {mods}) String modify file name
-foldclosed( {lnum}) Number first line of fold at {lnum} if closed
-foldclosedend( {lnum}) Number last line of fold at {lnum} if closed
-foldlevel( {lnum}) Number fold level at {lnum}
-foldtext( ) String line displayed for closed fold
-foldtextresult( {lnum}) String text for closed fold at {lnum}
-foreground( ) Number bring the Vim window to the foreground
-function( {name}) Funcref reference to function {name}
-garbagecollect( [{atexit}]) none free memory, breaking cyclic references
-get( {list}, {idx} [, {def}]) any get item {idx} from {list} or {def}
-get( {dict}, {key} [, {def}]) any get item {key} from {dict} or {def}
-getbufline( {expr}, {lnum} [, {end}])
+float2nr({expr}) Number convert Float {expr} to a Number
+floor({expr}) Float round {expr} down
+fmod({expr1}, {expr2}) Float remainder of {expr1} / {expr2}
+fnameescape({fname}) String escape special characters in {fname}
+fnamemodify({fname}, {mods}) String modify file name
+foldclosed({lnum}) Number first line of fold at {lnum} if closed
+foldclosedend({lnum}) Number last line of fold at {lnum} if closed
+foldlevel({lnum}) Number fold level at {lnum}
+foldtext() String line displayed for closed fold
+foldtextresult({lnum}) String text for closed fold at {lnum}
+foreground() Number bring the Vim window to the foreground
+function({name}) Funcref reference to function {name}
+garbagecollect([{atexit}]) none free memory, breaking cyclic references
+get({list}, {idx} [, {def}]) any get item {idx} from {list} or {def}
+get({dict}, {key} [, {def}]) any get item {key} from {dict} or {def}
+getbufline({expr}, {lnum} [, {end}])
List lines {lnum} to {end} of buffer {expr}
-getbufvar( {expr}, {varname} [, {def}])
+getbufvar({expr}, {varname} [, {def}])
any variable {varname} in buffer {expr}
-getchar( [expr]) Number get one character from the user
-getcharmod( ) Number modifiers for the last typed character
+getchar([expr]) Number get one character from the user
+getcharmod() Number modifiers for the last typed character
getcharsearch() Dict last character search
getcmdline() String return the current command-line
getcmdpos() Number return cursor position in command-line
getcmdtype() String return current command-line type
getcmdwintype() String return current command-line window type
getcurpos() List position of the cursor
-getcwd( [{scope}]) String the current working directory
-getfontname( [{name}]) String name of font being used
-getfperm( {fname}) String file permissions of file {fname}
-getfsize( {fname}) Number size in bytes of file {fname}
-getftime( {fname}) Number last modification time of file
-getftype( {fname}) String description of type of file {fname}
-getline( {lnum}) String line {lnum} of current buffer
-getline( {lnum}, {end}) List lines {lnum} to {end} of current buffer
-getloclist( {nr}) List list of location list items
+getcwd([{scope}]) String the current working directory
+getfontname([{name}]) String name of font being used
+getfperm({fname}) String file permissions of file {fname}
+getfsize({fname}) Number size in bytes of file {fname}
+getftime({fname}) Number last modification time of file
+getftype({fname}) String description of type of file {fname}
+getline({lnum}) String line {lnum} of current buffer
+getline({lnum}, {end}) List lines {lnum} to {end} of current buffer
+getloclist({nr}) List list of location list items
getmatches() List list of current matches
getpid() Number process ID of Vim
-getpos( {expr}) List position of cursor, mark, etc.
+getpos({expr}) List position of cursor, mark, etc.
getqflist() List list of quickfix items
-getreg( [{regname} [, 1 [, {list}]]])
+getreg([{regname} [, 1 [, {list}]]])
String or List contents of register
-getregtype( [{regname}]) String type of register
-gettabvar( {nr}, {varname} [, {def}])
+getregtype([{regname}]) String type of register
+gettabvar({nr}, {varname} [, {def}])
any variable {varname} in tab {nr} or {def}
-gettabwinvar( {tabnr}, {winnr}, {name} [, {def}])
+gettabwinvar({tabnr}, {winnr}, {name} [, {def}])
any {name} in {winnr} in tab page {tabnr}
getwinposx() Number X coord in pixels of GUI Vim window
getwinposy() Number Y coord in pixels of GUI Vim window
-getwinvar( {nr}, {varname} [, {def}])
+getwinvar({nr}, {varname} [, {def}])
any variable {varname} in window {nr}
-glob( {expr} [, {nosuf} [, {list} [, {alllinks}]]])
+glob({expr} [, {nosuf} [, {list} [, {alllinks}]]])
any expand file wildcards in {expr}
-glob2regpat( {expr}) String convert a glob pat into a search pat
-globpath( {path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]])
+glob2regpat({expr}) String convert a glob pat into a search pat
+globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]])
String do glob({expr}) for all dirs in {path}
-has( {feature}) Number TRUE if feature {feature} supported
-has_key( {dict}, {key}) Number TRUE if {dict} has entry {key}
+has({feature}) Number TRUE if feature {feature} supported
+has_key({dict}, {key}) Number TRUE if {dict} has entry {key}
haslocaldir() Number TRUE if current window executed |:lcd|
-hasmapto( {what} [, {mode} [, {abbr}]])
+hasmapto({what} [, {mode} [, {abbr}]])
Number TRUE if mapping to {what} exists
-histadd( {history},{item}) String add an item to a history
-histdel( {history} [, {item}]) String remove an item from a history
-histget( {history} [, {index}]) String get the item {index} from a history
-histnr( {history}) Number highest index of a history
-hlexists( {name}) Number TRUE if highlight group {name} exists
-hlID( {name}) Number syntax ID of highlight group {name}
+histadd({history},{item}) String add an item to a history
+histdel({history} [, {item}]) String remove an item from a history
+histget({history} [, {index}]) String get the item {index} from a history
+histnr({history}) Number highest index of a history
+hlexists({name}) Number TRUE if highlight group {name} exists
+hlID({name}) Number syntax ID of highlight group {name}
hostname() String name of the machine Vim is running on
-iconv( {expr}, {from}, {to}) String convert encoding of {expr}
-indent( {lnum}) Number indent of line {lnum}
-index( {list}, {expr} [, {start} [, {ic}]])
+iconv({expr}, {from}, {to}) String convert encoding of {expr}
+indent({lnum}) Number indent of line {lnum}
+index({list}, {expr} [, {start} [, {ic}]])
Number index in {list} where {expr} appears
-input( {prompt} [, {text} [, {completion}]])
+input({prompt} [, {text} [, {completion}]])
String get input from the user
-inputdialog( {p} [, {t} [, {c}]]) String like input() but in a GUI dialog
-inputlist( {textlist}) Number let the user pick from a choice list
+inputdialog({p} [, {t} [, {c}]]) String like input() but in a GUI dialog
+inputlist({textlist}) Number let the user pick from a choice list
inputrestore() Number restore typeahead
inputsave() Number save and clear typeahead
-inputsecret( {prompt} [, {text}])
+inputsecret({prompt} [, {text}])
String like input() but hiding the text
-insert( {list}, {item} [, {idx}])
+insert({list}, {item} [, {idx}])
List insert {item} in {list} [before {idx}]
-invert( {expr}) Number bitwise invert
-isdirectory( {directory}) Number TRUE if {directory} is a directory
-islocked( {expr}) Number TRUE if {expr} is locked
-items( {dict}) List key-value pairs in {dict}
-jobclose( {job}[, {stream}]) Number Closes a job stream(s)
-jobpid( {job}) Number Returns pid of a job.
-jobresize( {job}, {width}, {height})
+invert({expr}) Number bitwise invert
+isdirectory({directory}) Number TRUE if {directory} is a directory
+islocked({expr}) Number TRUE if {expr} is locked
+items({dict}) List key-value pairs in {dict}
+jobclose({job}[, {stream}]) Number Closes a job stream(s)
+jobpid({job}) Number Returns pid of a job.
+jobresize({job}, {width}, {height})
Number Resize {job}'s pseudo terminal window
-jobsend( {job}, {data}) Number Writes {data} to {job}'s stdin
-jobstart( {cmd}[, {opts}]) Number Spawns {cmd} as a job
-jobstop( {job}) Number Stops a job
-jobwait( {ids}[, {timeout}]) Number Wait for a set of jobs
-join( {list} [, {sep}]) String join {list} items into one String
-json_decode( {expr}) any Convert {expr} from JSON
-json_encode( {expr}) String Convert {expr} to JSON
-keys( {dict}) List keys in {dict}
-len( {expr}) Number the length of {expr}
-libcall( {lib}, {func}, {arg}) String call {func} in library {lib} with {arg}
-libcallnr( {lib}, {func}, {arg}) Number idem, but return a Number
-line( {expr}) Number line nr of cursor, last line or mark
-line2byte( {lnum}) Number byte count of line {lnum}
-lispindent( {lnum}) Number Lisp indent for line {lnum}
+jobsend({job}, {data}) Number Writes {data} to {job}'s stdin
+jobstart({cmd}[, {opts}]) Number Spawns {cmd} as a job
+jobstop({job}) Number Stops a job
+jobwait({ids}[, {timeout}]) Number Wait for a set of jobs
+join({list} [, {sep}]) String join {list} items into one String
+json_decode({expr}) any Convert {expr} from JSON
+json_encode({expr}) String Convert {expr} to JSON
+keys({dict}) List keys in {dict}
+len({expr}) Number the length of {expr}
+libcall({lib}, {func}, {arg}) String call {func} in library {lib} with {arg}
+libcallnr({lib}, {func}, {arg}) Number idem, but return a Number
+line({expr}) Number line nr of cursor, last line or mark
+line2byte({lnum}) Number byte count of line {lnum}
+lispindent({lnum}) Number Lisp indent for line {lnum}
localtime() Number current time
-log( {expr}) Float natural logarithm (base e) of {expr}
-log10( {expr}) Float logarithm of Float {expr} to base 10
-map( {expr}, {string}) List/Dict change each item in {expr} to {expr}
-maparg( {name}[, {mode} [, {abbr} [, {dict}]]])
+log({expr}) Float natural logarithm (base e) of {expr}
+log10({expr}) Float logarithm of Float {expr} to base 10
+map({expr}, {string}) List/Dict change each item in {expr} to {expr}
+maparg({name}[, {mode} [, {abbr} [, {dict}]]])
String or Dict
rhs of mapping {name} in mode {mode}
-mapcheck( {name}[, {mode} [, {abbr}]])
+mapcheck({name}[, {mode} [, {abbr}]])
String check for mappings matching {name}
-match( {expr}, {pat}[, {start}[, {count}]])
+match({expr}, {pat}[, {start}[, {count}]])
Number position where {pat} matches in {expr}
-matchadd( {group}, {pattern}[, {priority}[, {id}]])
+matchadd({group}, {pattern}[, {priority}[, {id}]])
Number highlight {pattern} with {group}
-matchaddpos( {group}, {list}[, {priority}[, {id}]])
+matchaddpos({group}, {list}[, {priority}[, {id}]])
Number highlight positions with {group}
-matcharg( {nr}) List arguments of |:match|
-matchdelete( {id}) Number delete match identified by {id}
-matchend( {expr}, {pat}[, {start}[, {count}]])
+matcharg({nr}) List arguments of |:match|
+matchdelete({id}) Number delete match identified by {id}
+matchend({expr}, {pat}[, {start}[, {count}]])
Number position where {pat} ends in {expr}
-matchlist( {expr}, {pat}[, {start}[, {count}]])
+matchlist({expr}, {pat}[, {start}[, {count}]])
List match and submatches of {pat} in {expr}
-matchstr( {expr}, {pat}[, {start}[, {count}]])
+matchstr({expr}, {pat}[, {start}[, {count}]])
String {count}'th match of {pat} in {expr}
-max( {list}) Number maximum value of items in {list}
-min( {list}) Number minimum value of items in {list}
-mkdir( {name} [, {path} [, {prot}]])
+max({list}) Number maximum value of items in {list}
+min({list}) Number minimum value of items in {list}
+mkdir({name} [, {path} [, {prot}]])
Number create directory {name}
-mode( [expr]) String current editing mode
-msgpackdump( {list}) List dump a list of objects to msgpack
-msgpackparse( {list}) List parse msgpack to a list of objects
-nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum}
-nr2char( {expr}[, {utf8}]) String single char with ASCII/UTF8 value {expr}
-or( {expr}, {expr}) Number bitwise OR
-pathshorten( {expr}) String shorten directory names in a path
-pow( {x}, {y}) Float {x} to the power of {y}
-prevnonblank( {lnum}) Number line nr of non-blank line <= {lnum}
-printf( {fmt}, {expr1}...) String format text
+mode([expr]) String current editing mode
+msgpackdump({list}) List dump a list of objects to msgpack
+msgpackparse({list}) List parse msgpack to a list of objects
+nextnonblank({lnum}) Number line nr of non-blank line >= {lnum}
+nr2char({expr}[, {utf8}]) String single char with ASCII/UTF8 value {expr}
+or({expr}, {expr}) Number bitwise OR
+pathshorten({expr}) String shorten directory names in a path
+pow({x}, {y}) Float {x} to the power of {y}
+prevnonblank({lnum}) Number line nr of non-blank line <= {lnum}
+printf({fmt}, {expr1}...) String format text
pumvisible() Number whether popup menu is visible
-pyeval( {expr}) any evaluate |Python| expression
-py3eval( {expr}) any evaluate |python3| expression
-range( {expr} [, {max} [, {stride}]])
+pyeval({expr}) any evaluate |Python| expression
+py3eval({expr}) any evaluate |python3| expression
+range({expr} [, {max} [, {stride}]])
List items from {expr} to {max}
-readfile( {fname} [, {binary} [, {max}]])
+readfile({fname} [, {binary} [, {max}]])
List get list of lines from file {fname}
-reltime( [{start} [, {end}]]) List get time value
-reltimefloat( {time}) Float turn the time value into a Float
-reltimestr( {time}) String turn time value into a String
-remote_expr( {server}, {string} [, {idvar}])
+reltime([{start} [, {end}]]) List get time value
+reltimefloat({time}) Float turn the time value into a Float
+reltimestr({time}) String turn time value into a String
+remote_expr({server}, {string} [, {idvar}])
String send expression
-remote_foreground( {server}) Number bring Vim server to the foreground
-remote_peek( {serverid} [, {retvar}])
+remote_foreground({server}) Number bring Vim server to the foreground
+remote_peek({serverid} [, {retvar}])
Number check for reply string
-remote_read( {serverid}) String read reply string
-remote_send( {server}, {string} [, {idvar}])
+remote_read({serverid}) String read reply string
+remote_send({server}, {string} [, {idvar}])
String send key sequence
-remove( {list}, {idx} [, {end}]) any remove items {idx}-{end} from {list}
-remove( {dict}, {key}) any remove entry {key} from {dict}
-rename( {from}, {to}) Number rename (move) file from {from} to {to}
-repeat( {expr}, {count}) String repeat {expr} {count} times
-resolve( {filename}) String get filename a shortcut points to
-reverse( {list}) List reverse {list} in-place
-round( {expr}) Float round off {expr}
-rpcnotify( {channel}, {event}[, {args}...])
+remove({list}, {idx} [, {end}]) any remove items {idx}-{end} from {list}
+remove({dict}, {key}) any remove entry {key} from {dict}
+rename({from}, {to}) Number rename (move) file from {from} to {to}
+repeat({expr}, {count}) String repeat {expr} {count} times
+resolve({filename}) String get filename a shortcut points to
+reverse({list}) List reverse {list} in-place
+round({expr}) Float round off {expr}
+rpcnotify({channel}, {event}[, {args}...])
Sends a |msgpack-rpc| notification to {channel}
-rpcrequest( {channel}, {method}[, {args}...])
+rpcrequest({channel}, {method}[, {args}...])
Sends a |msgpack-rpc| request to {channel}
-rpcstart( {prog}[, {argv}]) Spawns {prog} and opens a |msgpack-rpc| channel
-rpcstop( {channel}) Closes a |msgpack-rpc| {channel}
-screenattr( {row}, {col}) Number attribute at screen position
-screenchar( {row}, {col}) Number character at screen position
+rpcstart({prog}[, {argv}]) Spawns {prog} and opens a |msgpack-rpc| channel
+rpcstop({channel}) Closes a |msgpack-rpc| {channel}
+screenattr({row}, {col}) Number attribute at screen position
+screenchar({row}, {col}) Number character at screen position
screencol() Number current cursor column
screenrow() Number current cursor row
-search( {pattern} [, {flags} [, {stopline} [, {timeout}]]])
+search({pattern} [, {flags} [, {stopline} [, {timeout}]]])
Number search for {pattern}
-searchdecl( {name} [, {global} [, {thisblock}]])
+searchdecl({name} [, {global} [, {thisblock}]])
Number search for variable declaration
-searchpair( {start}, {middle}, {end} [, {flags} [, {skip} [...]]])
+searchpair({start}, {middle}, {end} [, {flags} [, {skip} [...]]])
Number search for other end of start/end pair
-searchpairpos( {start}, {middle}, {end} [, {flags} [, {skip} [...]]])
+searchpairpos({start}, {middle}, {end} [, {flags} [, {skip} [...]]])
List search for other end of start/end pair
-searchpos( {pattern} [, {flags} [, {stopline} [, {timeout}]]])
+searchpos({pattern} [, {flags} [, {stopline} [, {timeout}]]])
List search for {pattern}
-server2client( {clientid}, {string})
+server2client({clientid}, {string})
Number send reply string
serverlist() String get a list of available servers
-setbufvar( {expr}, {varname}, {val}) set {varname} in buffer {expr} to {val}
-setcharsearch( {dict}) Dict set character search from {dict}
-setcmdpos( {pos}) Number set cursor position in command-line
-setline( {lnum}, {line}) Number set line {lnum} to {line}
-setloclist( {nr}, {list}[, {action}[, {title}]])
+setbufvar({expr}, {varname}, {val}) set {varname} in buffer {expr} to {val}
+setcharsearch({dict}) Dict set character search from {dict}
+setcmdpos({pos}) Number set cursor position in command-line
+setline({lnum}, {line}) Number set line {lnum} to {line}
+setloclist({nr}, {list}[, {action}[, {title}]])
Number modify location list using {list}
-setmatches( {list}) Number restore a list of matches
-setpos( {expr}, {list}) Number set the {expr} position to {list}
-setqflist( {list}[, {action}[, {title}]]
+setmatches({list}) Number restore a list of matches
+setpos({expr}, {list}) Number set the {expr} position to {list}
+setqflist({list}[, {action}[, {title}]]
Number modify quickfix list using {list}
-setreg( {n}, {v}[, {opt}]) Number set register to value and type
-settabvar( {nr}, {varname}, {val}) set {varname} in tab page {nr} to {val}
-settabwinvar( {tabnr}, {winnr}, {varname}, {val}) set {varname} in window
+setreg({n}, {v}[, {opt}]) Number set register to value and type
+settabvar({nr}, {varname}, {val}) set {varname} in tab page {nr} to {val}
+settabwinvar({tabnr}, {winnr}, {varname}, {val}) set {varname} in window
{winnr} in tab page {tabnr} to {val}
-setwinvar( {nr}, {varname}, {val}) set {varname} in window {nr} to {val}
-sha256( {string}) String SHA256 checksum of {string}
-shellescape( {string} [, {special}])
+setwinvar({nr}, {varname}, {val}) set {varname} in window {nr} to {val}
+sha256({string}) String SHA256 checksum of {string}
+shellescape({string} [, {special}])
String escape {string} for use as shell
command argument
shiftwidth() Number effective value of 'shiftwidth'
-simplify( {filename}) String simplify filename as much as possible
-sin( {expr}) Float sine of {expr}
-sinh( {expr}) Float hyperbolic sine of {expr}
-sort( {list} [, {func} [, {dict}]])
+simplify({filename}) String simplify filename as much as possible
+sin({expr}) Float sine of {expr}
+sinh({expr}) Float hyperbolic sine of {expr}
+sort({list} [, {func} [, {dict}]])
List sort {list}, using {func} to compare
-soundfold( {word}) String sound-fold {word}
+soundfold({word}) String sound-fold {word}
spellbadword() String badly spelled word at cursor
-spellsuggest( {word} [, {max} [, {capital}]])
+spellsuggest({word} [, {max} [, {capital}]])
List spelling suggestions
-split( {expr} [, {pat} [, {keepempty}]])
+split({expr} [, {pat} [, {keepempty}]])
List make |List| from {pat} separated {expr}
-sqrt( {expr}) Float square root of {expr}
-str2float( {expr}) Float convert String to Float
-str2nr( {expr} [, {base}]) Number convert String to Number
-strchars( {expr} [, {skipcc}]) Number character length of the String {expr}
-strdisplaywidth( {expr} [, {col}]) Number display length of the String {expr}
-strftime( {format}[, {time}]) String time in specified format
-stridx( {haystack}, {needle}[, {start}])
+sqrt({expr}) Float square root of {expr}
+str2float({expr}) Float convert String to Float
+str2nr({expr} [, {base}]) Number convert String to Number
+strchars({expr} [, {skipcc}]) Number character length of the String {expr}
+strdisplaywidth({expr} [, {col}]) Number display length of the String {expr}
+strftime({format}[, {time}]) String time in specified format
+stridx({haystack}, {needle}[, {start}])
Number index of {needle} in {haystack}
-string( {expr}) String String representation of {expr} value
-strlen( {expr}) Number length of the String {expr}
-strpart( {src}, {start}[, {len}])
+string({expr}) String String representation of {expr} value
+strlen({expr}) Number length of the String {expr}
+strpart({src}, {start}[, {len}])
String {len} characters of {src} at {start}
-strridx( {haystack}, {needle} [, {start}])
+strridx({haystack}, {needle} [, {start}])
Number last index of {needle} in {haystack}
-strtrans( {expr}) String translate string to make it printable
-strwidth( {expr}) Number display cell length of the String {expr}
-submatch( {nr}[, {list}]) String or List
+strtrans({expr}) String translate string to make it printable
+strwidth({expr}) Number display cell length of the String {expr}
+submatch({nr}[, {list}]) String or List
specific match in ":s" or substitute()
-substitute( {expr}, {pat}, {sub}, {flags})
+substitute({expr}, {pat}, {sub}, {flags})
String all {pat} in {expr} replaced with {sub}
-synID( {lnum}, {col}, {trans}) Number syntax ID at {lnum} and {col}
-synIDattr( {synID}, {what} [, {mode}])
+synID({lnum}, {col}, {trans}) Number syntax ID at {lnum} and {col}
+synIDattr({synID}, {what} [, {mode}])
String attribute {what} of syntax ID {synID}
-synIDtrans( {synID}) Number translated syntax ID of {synID}
-synconcealed( {lnum}, {col}) List info about concealing
-synstack( {lnum}, {col}) List stack of syntax IDs at {lnum} and {col}
-system( {cmd} [, {input}]) String output of shell command/filter {cmd}
-systemlist( {cmd} [, {input}]) List output of shell command/filter {cmd}
-tabpagebuflist( [{arg}]) List list of buffer numbers in tab page
-tabpagenr( [{arg}]) Number number of current or last tab page
-tabpagewinnr( {tabarg}[, {arg}])
+synIDtrans({synID}) Number translated syntax ID of {synID}
+synconcealed({lnum}, {col}) List info about concealing
+synstack({lnum}, {col}) List stack of syntax IDs at {lnum} and {col}
+system({cmd} [, {input}]) String output of shell command/filter {cmd}
+systemlist({cmd} [, {input}]) List output of shell command/filter {cmd}
+tabpagebuflist([{arg}]) List list of buffer numbers in tab page
+tabpagenr([{arg}]) Number number of current or last tab page
+tabpagewinnr({tabarg}[, {arg}])
Number number of current window in tab page
-taglist( {expr}) List list of tags matching {expr}
+taglist({expr}) List list of tags matching {expr}
tagfiles() List tags files used
tempname() String name for a temporary file
-tan( {expr}) Float tangent of {expr}
-tanh( {expr}) Float hyperbolic tangent of {expr}
-tolower( {expr}) String the String {expr} switched to lowercase
-toupper( {expr}) String the String {expr} switched to uppercase
-tr( {src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr}
+tan({expr}) Float tangent of {expr}
+tanh({expr}) Float hyperbolic tangent of {expr}
+tolower({expr}) String the String {expr} switched to lowercase
+toupper({expr}) String the String {expr} switched to uppercase
+tr({src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr}
to chars in {tostr}
-trunc( {expr}) Float truncate Float {expr}
-type( {name}) Number type of variable {name}
-undofile( {name}) String undo file name for {name}
+trunc({expr}) Float truncate Float {expr}
+type({name}) Number type of variable {name}
+undofile({name}) String undo file name for {name}
undotree() List undo file tree
-uniq( {list} [, {func} [, {dict}]])
+uniq({list} [, {func} [, {dict}]])
List remove adjacent duplicates from a list
-values( {dict}) List values in {dict}
-virtcol( {expr}) Number screen column of cursor or mark
-visualmode( [expr]) String last visual mode used
+values({dict}) List values in {dict}
+virtcol({expr}) Number screen column of cursor or mark
+visualmode([expr]) String last visual mode used
wildmenumode() Number whether 'wildmenu' mode is active
-winbufnr( {nr}) Number buffer number of window {nr}
+winbufnr({nr}) Number buffer number of window {nr}
wincol() Number window column of the cursor
-winheight( {nr}) Number height of window {nr}
+winheight({nr}) Number height of window {nr}
winline() Number window line of the cursor
-winnr( [{expr}]) Number number of current window
+winnr([{expr}]) Number number of current window
winrestcmd() String returns command to restore window sizes
-winrestview( {dict}) none restore view of current window
+winrestview({dict}) none restore view of current window
winsaveview() Dict save view of current window
-winwidth( {nr}) Number width of window {nr}
+winwidth({nr}) Number width of window {nr}
wordcount() Dict get byte/char/word statistics
-writefile( {list}, {fname} [, {flags}])
+writefile({list}, {fname} [, {flags}])
Number write list of lines to file {fname}
-xor( {expr}, {expr}) Number bitwise XOR
+xor({expr}, {expr}) Number bitwise XOR
abs({expr}) *abs()*
Return the absolute value of {expr}. When {expr} evaluates to
@@ -5780,7 +5779,7 @@ searchpos({pattern} [, {flags} [, {stopline} [, {timeout}]]]) *searchpos()*
< In this example "submatch" is 2 when a lowercase letter is
found |/\l|, 3 when an uppercase letter is found |/\u|.
-server2client( {clientid}, {string}) *server2client()*
+server2client({clientid}, {string}) *server2client()*
Send a reply string to {clientid}. The most recent {clientid}
that sent a string can be retrieved with expand("<client>").
{only available when compiled with the |+clientserver| feature}
@@ -6302,7 +6301,7 @@ sqrt({expr}) *sqrt()*
"nan" may be different, it depends on system libraries.
-str2float( {expr}) *str2float()*
+str2float({expr}) *str2float()*
Convert String {expr} to a Float. This mostly works the same
as when using a floating point number in an expression, see
|floating-point-format|. But it's a bit more permissive.
@@ -6316,7 +6315,7 @@ str2float( {expr}) *str2float()*
let f = str2float(substitute(text, ',', '', 'g'))
-str2nr( {expr} [, {base}]) *str2nr()*
+str2nr({expr} [, {base}]) *str2nr()*
Convert string {expr} to a number.
{base} is the conversion base, it can be 2, 8, 10 or 16.
When {base} is omitted base 10 is used. This also means that
diff --git a/runtime/doc/index.txt b/runtime/doc/index.txt
index f511b1db6d..e6c1ccc0cf 100644
--- a/runtime/doc/index.txt
+++ b/runtime/doc/index.txt
@@ -1,4 +1,4 @@
-*index.txt* For Vim version 7.4. Last change: 2015 Sep 08
+*index.txt* For Vim version 7.4. Last change: 2016 Jan 03
VIM REFERENCE MANUAL by Bram Moolenaar
diff --git a/runtime/doc/nvim_clipboard.txt b/runtime/doc/nvim_clipboard.txt
index 258fc550f8..078382c7a7 100644
--- a/runtime/doc/nvim_clipboard.txt
+++ b/runtime/doc/nvim_clipboard.txt
@@ -24,6 +24,8 @@ is found in your `$PATH`.
- pbcopy/pbpaste (only for Mac OS X)
- lemonade (useful for SSH machine)
https://github.com/pocke/lemonade
+- doitclient (another option for SSH setups from the maintainer of PuTTY)
+ http://www.chiark.greenend.org.uk/~sgtatham/doit/
The presence of a suitable clipboard tool implicitly enables the '+' and '*'
registers.
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index fedacfaea4..83ae96a651 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -1,4 +1,4 @@
-*options.txt* For Vim version 7.4. Last change: 2015 Nov 23
+*options.txt* For Vim version 7.4. Last change: 2016 Jan 03
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -3785,7 +3785,7 @@ A jump table for the options with a short description can be found at |Q_op|.
feature}
This option allows switching your keyboard into a special language
mode. When you are typing text in Insert mode the characters are
- inserted directly. When in command mode the 'langmap' option takes
+ inserted directly. When in Normal mode the 'langmap' option takes
care of translating these special characters to the original meaning
of the key. This means you don't have to change the keyboard mode to
be able to execute Normal mode commands.
@@ -4152,8 +4152,11 @@ A jump table for the options with a short description can be found at |Q_op|.
global
Maximum amount of memory in Kbyte to use for all buffers together.
The maximum usable value is about 2000000 (2 Gbyte). Use this to work
- without a limit. On 64 bit machines higher values might work. But
- hey, do you really need more than 2 Gbyte for text editing?
+ without a limit.
+ On 64 bit machines higher values might work. But hey, do you really
+ need more than 2 Gbyte for text editing? Keep in mind that text is
+ stored in the swap file, one can edit files > 2 Gbyte anyway. We do
+ need the memory to store undo info.
Also see 'maxmem'.
*'menuitems'* *'mis'*
@@ -5823,7 +5826,8 @@ A jump table for the options with a short description can be found at |Q_op|.
the two-letter, lower case region name. You can use more than one
region by listing them: "en_us,en_ca" supports both US and Canadian
English, but not words specific for Australia, New Zealand or Great
- Britain.
+ Britain. (Note: currently en_au and en_nz dictionaries are older than
+ en_ca, en_gb and en_us).
If the name "cjk" is included East Asian characters are excluded from
spell checking. This is useful when editing text that also has Asian
words.
diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt
index d7b16cc533..5897f756d8 100644
--- a/runtime/doc/pattern.txt
+++ b/runtime/doc/pattern.txt
@@ -1,4 +1,4 @@
-*pattern.txt* For Vim version 7.4. Last change: 2015 Dec 26
+*pattern.txt* For Vim version 7.4. Last change: 2016 Jan 03
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1094,7 +1094,10 @@ x A single character, with no special meaning, matches itself
plausible pattern for a Unix filename: "[-./[:alnum:]_~]\+" That is,
a list of at least one character, each of which is either '-', '.',
'/', alphabetic, numeric, '_' or '~'.
- These items only work for 8-bit characters.
+ These items only work for 8-bit characters, except [:lower:] and
+ [:upper:] also work for multi-byte characters when using the new
+ regexp engine. In the future these items may work for multi-byte
+ characters.
*/[[=* *[==]*
- An equivalence class. This means that characters are matched that
have almost the same meaning, e.g., when ignoring accents. This
diff --git a/runtime/indent/lua.vim b/runtime/indent/lua.vim
index 5f049d4585..393994c590 100644
--- a/runtime/indent/lua.vim
+++ b/runtime/indent/lua.vim
@@ -54,7 +54,7 @@ function! GetLuaIndent()
" Subtract a 'shiftwidth' on end, else (and elseif), until and '}'
" This is the part that requires 'indentkeys'.
- let midx = match(getline(v:lnum), '^\s*\%(end\>\|else\>\|until\>\|}\)')
+ let midx = match(getline(v:lnum), '^\s*\%(end\>\|else\>\|elseif\>\|until\>\|}\)')
if midx != -1 && synIDattr(synID(v:lnum, midx + 1, 1), "name") != "luaComment"
let ind = ind - &shiftwidth
endif
diff --git a/runtime/syntax/zsh.vim b/runtime/syntax/zsh.vim
index 5e588e7d6c..162577669f 100644
--- a/runtime/syntax/zsh.vim
+++ b/runtime/syntax/zsh.vim
@@ -2,7 +2,7 @@
" Language: Zsh shell script
" Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
-" Latest Revision: 2015-05-29
+" Latest Revision: 2015-12-25
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-zsh
@@ -125,20 +125,29 @@ syn keyword zshCommands alias autoload bg bindkey break bye cap cd
\ zsocket zstyle ztcp
" Options, generated by: echo ${(j:\n:)options[(I)*]} | sort
+" Create a list of option names from zsh source dir:
+" #!/bin/zsh
+" topdir=/path/to/zsh-xxx
+" grep '^pindex([A-Za-z_]*)$' $topdir/Src/Doc/Zsh/optionsyo |
+" while read opt
+" do
+" echo ${${(L)opt#pindex\(}%\)}
+" done
+
syn case ignore
syn keyword zshOptions aliases allexport all_export alwayslastprompt
- \ always_lastprompt alwaystoend always_to_end
- \ appendhistory append_history autocd autocontinue
+ \ always_last_prompt always_lastprompt alwaystoend always_to_end appendcreate
+ \ append_create appendhistory append_history autocd auto_cd autocontinue
\ auto_continue autolist auto_list
\ automenu auto_menu autonamedirs auto_name_dirs
\ autoparamkeys auto_param_keys autoparamslash
\ auto_param_slash autopushd auto_pushd autoremoveslash
- \ auto_remove_slash autoresume auto_resume badpattern
+ \ auto_remove_slash autoresume auto_resume badpattern bad_pattern
\ banghist bang_hist bareglobqual bare_glob_qual
\ bashautolist bash_auto_list bashrematch bash_rematch
- \ beep bgnice braceccl brace_ccl braceexpand brace_expand
+ \ beep bgnice bg_nice braceccl brace_ccl braceexpand brace_expand
\ bsdecho bsd_echo caseglob case_glob casematch case_match
- \ cbases cdablevars cd_able_vars chasedots chase_dots
+ \ cbases c_bases cdablevars cdable_vars cd_able_vars chasedots chase_dots
\ chaselinks chase_links checkjobs check_jobs
\ clobber combiningchars combining_chars completealiases
\ complete_aliases completeinword complete_in_word
@@ -146,17 +155,17 @@ syn keyword zshOptions aliases allexport all_export alwayslastprompt
\ correctall correct_all cprecedences c_precedences
\ cshjunkiehistory csh_junkie_history cshjunkieloops
\ csh_junkie_loops cshjunkiequotes csh_junkie_quotes
- \ cshnullcmd csh_null_cmd cshnullglob csh_null_glob
+ \ csh_nullcmd csh_null_cmd cshnullcmd csh_null_cmd cshnullglob csh_null_glob
\ debugbeforecmd debug_before_cmd dotglob dot_glob dvorak
\ emacs equals errexit err_exit errreturn err_return evallineno
\ eval_lineno exec extendedglob extended_glob extendedhistory
\ extended_history flowcontrol flow_control forcefloat
- \ force_float functionargzero function_arg_zero glob globalexport
+ \ force_float functionargzero function_argzero function_arg_zero glob globalexport
\ global_export globalrcs global_rcs globassign glob_assign
\ globcomplete glob_complete globdots glob_dots glob_subst
- \ globsubst hashall hash_all hashcmds hash_cmds hashdirs
- \ hash_dirs hashexecutablesonly hash_executables_only hashlistall
- \ hash_list_all histallowclobber hist_allow_clobber histappend
+ \ globsubst globstarshort glob_star_short hashall hash_all hashcmds
+ \ hash_cmds hashdirs hash_dirs hashexecutablesonly hash_executables_only
+ \ hashlistall hash_list_all histallowclobber hist_allow_clobber histappend
\ hist_append histbeep hist_beep hist_expand hist_expire_dups_first
\ histexpand histexpiredupsfirst histfcntllock hist_fcntl_lock
\ histfindnodups hist_find_no_dups histignorealldups
@@ -184,7 +193,7 @@ syn keyword zshOptions aliases allexport all_export alwayslastprompt
\ numeric_glob_sort octalzeroes octal_zeroes onecmd one_cmd
\ overstrike over_strike pathdirs path_dirs pathscript
\ path_script physical pipefail pipe_fail posixaliases
- \ posix_aliases posixargzero posix_arg_zero posixbuiltins
+ \ posix_aliases posixargzero posix_arg_zero posix_argzero posixbuiltins
\ posix_builtins posixcd posix_cd posixidentifiers posix_identifiers
\ posixjobs posix_jobs posixstrings posix_strings posixtraps
\ posix_traps printeightbit print_eight_bit printexitvalue
@@ -192,8 +201,8 @@ syn keyword zshOptions aliases allexport all_export alwayslastprompt
\ prompt_cr promptpercent prompt_percent promptsp prompt_sp
\ promptsubst prompt_subst promptvars prompt_vars pushdignoredups
\ pushd_ignore_dups pushdminus pushd_minus pushdsilent pushd_silent
- \ pushdtohome pushd_to_home rcexpandparam rc_expandparam rcquotes
- \ rc_quotes rcs recexact rec_exact rematchpcre re_match_pcre
+ \ pushdtohome pushd_to_home rcexpandparam rc_expandparam rc_expand_param rcquotes
+ \ rc_quotes rcs recexact rec_exact rematchpcre re_match_pcre rematch_pcre
\ restricted rmstarsilent rm_star_silent rmstarwait rm_star_wait
\ sharehistory share_history shfileexpansion sh_file_expansion
\ shglob sh_glob shinstdin shin_stdin shnullcmd sh_nullcmd
@@ -201,22 +210,22 @@ syn keyword zshOptions aliases allexport all_export alwayslastprompt
\ sh_word_split singlecommand single_command singlelinezle single_line_zle
\ sourcetrace source_trace stdin sunkeyboardhack sun_keyboard_hack
\ trackall track_all transientrprompt transient_rprompt
- \ trapsasync trapasync typesetsilent type_set_silent unset verbose vi
+ \ trapsasync traps_async typesetsilent type_set_silent typeset_silent unset verbose vi
\ warncreateglobal warn_create_global xtrace zle
syn keyword zshOptions noaliases no_aliases noallexport no_allexport noall_export no_all_export noalwayslastprompt no_alwayslastprompt
- \ noalways_lastprompt no_always_lastprompt noalwaystoend no_alwaystoend noalways_to_end no_always_to_end
- \ noappendhistory no_appendhistory noappend_history no_append_history noautocd no_autocd noautocontinue no_autocontinue
- \ noauto_continue no_auto_continue noautolist no_autolist noauto_list no_auto_list
- \ noautomenu no_automenu noauto_menu no_auto_menu noautonamedirs no_autonamedirs noauto_name_dirs no_auto_name_dirs
- \ noautoparamkeys no_autoparamkeys noauto_param_keys no_auto_param_keys noautoparamslash no_autoparamslash
+ \ noalways_lastprompt no_always_lastprompt no_always_last_prompt noalwaystoend no_alwaystoend noalways_to_end no_always_to_end
+ \ noappendcreate no_appendcreate no_append_create noappendhistory no_appendhistory noappend_history no_append_history noautocd
+ \ no_autocd no_auto_cd noautocontinue no_autocontinue noauto_continue no_auto_continue noautolist no_autolist noauto_list
+ \ no_auto_list noautomenu no_automenu noauto_menu no_auto_menu noautonamedirs no_autonamedirs noauto_name_dirs
+ \ no_auto_name_dirs noautoparamkeys no_autoparamkeys noauto_param_keys no_auto_param_keys noautoparamslash no_autoparamslash
\ noauto_param_slash no_auto_param_slash noautopushd no_autopushd noauto_pushd no_auto_pushd noautoremoveslash no_autoremoveslash
- \ noauto_remove_slash no_auto_remove_slash noautoresume no_autoresume noauto_resume no_auto_resume nobadpattern no_badpattern
+ \ noauto_remove_slash no_auto_remove_slash noautoresume no_autoresume noauto_resume no_auto_resume nobadpattern no_badpattern no_bad_pattern
\ nobanghist no_banghist nobang_hist no_bang_hist nobareglobqual no_bareglobqual nobare_glob_qual no_bare_glob_qual
\ nobashautolist no_bashautolist nobash_auto_list no_bash_auto_list nobashrematch no_bashrematch nobash_rematch no_bash_rematch
- \ nobeep no_beep nobgnice no_bgnice nobraceccl no_braceccl nobrace_ccl no_brace_ccl nobraceexpand no_braceexpand nobrace_expand no_brace_expand
+ \ nobeep no_beep nobgnice no_bgnice no_bg_nice nobraceccl no_braceccl nobrace_ccl no_brace_ccl nobraceexpand no_braceexpand nobrace_expand no_brace_expand
\ nobsdecho no_bsdecho nobsd_echo no_bsd_echo nocaseglob no_caseglob nocase_glob no_case_glob nocasematch no_casematch nocase_match no_case_match
- \ nocbases no_cbases nocdablevars no_cdablevars nocd_able_vars no_cd_able_vars nochasedots no_chasedots nochase_dots no_chase_dots
+ \ nocbases no_cbases no_c_bases nocdablevars no_cdablevars no_cdable_vars nocd_able_vars no_cd_able_vars nochasedots no_chasedots nochase_dots no_chase_dots
\ nochaselinks no_chaselinks nochase_links no_chase_links nocheckjobs no_checkjobs nocheck_jobs no_check_jobs
\ noclobber no_clobber nocombiningchars no_combiningchars nocombining_chars no_combining_chars nocompletealiases no_completealiases
\ nocomplete_aliases no_complete_aliases nocompleteinword no_completeinword nocomplete_in_word no_complete_in_word
@@ -224,14 +233,15 @@ syn keyword zshOptions noaliases no_aliases noallexport no_allexport no
\ nocorrectall no_correctall nocorrect_all no_correct_all nocprecedences no_cprecedences noc_precedences no_c_precedences
\ nocshjunkiehistory no_cshjunkiehistory nocsh_junkie_history no_csh_junkie_history nocshjunkieloops no_cshjunkieloops
\ nocsh_junkie_loops no_csh_junkie_loops nocshjunkiequotes no_cshjunkiequotes nocsh_junkie_quotes no_csh_junkie_quotes
- \ nocshnullcmd no_cshnullcmd nocsh_null_cmd no_csh_null_cmd nocshnullglob no_cshnullglob nocsh_null_glob no_csh_null_glob
+ \ nocshnullcmd no_cshnullcmd no_csh_nullcmd nocsh_null_cmd no_csh_null_cmd nocshnullglob no_cshnullglob nocsh_null_glob no_csh_null_glob
\ nodebugbeforecmd no_debugbeforecmd nodebug_before_cmd no_debug_before_cmd nodotglob no_dotglob nodot_glob no_dot_glob nodvorak no_dvorak
\ noemacs no_emacs noequals no_equals noerrexit no_errexit noerr_exit no_err_exit noerrreturn no_errreturn noerr_return no_err_return noevallineno no_evallineno
\ noeval_lineno no_eval_lineno noexec no_exec noextendedglob no_extendedglob noextended_glob no_extended_glob noextendedhistory no_extendedhistory
\ noextended_history no_extended_history noflowcontrol no_flowcontrol noflow_control no_flow_control noforcefloat no_forcefloat
- \ noforce_float no_force_float nofunctionargzero no_functionargzero nofunction_arg_zero no_function_arg_zero noglob no_glob noglobalexport no_globalexport
+ \ noforce_float no_force_float nofunctionargzero no_functionargzero nofunction_arg_zero no_function_argzero no_function_arg_zero noglob no_glob noglobalexport no_globalexport
\ noglobal_export no_global_export noglobalrcs no_globalrcs noglobal_rcs no_global_rcs noglobassign no_globassign noglob_assign no_glob_assign
- \ noglobcomplete no_globcomplete noglob_complete no_glob_complete noglobdots no_globdots noglob_dots no_glob_dots noglob_subst no_glob_subst
+ \ noglobcomplete no_globcomplete noglob_complete no_glob_complete noglobdots no_globdots noglob_dots no_glob_dots
+ \ noglobstarshort no_glob_star_short noglob_subst no_glob_subst
\ noglobsubst no_globsubst nohashall no_hashall nohash_all no_hash_all nohashcmds no_hashcmds nohash_cmds no_hash_cmds nohashdirs no_hashdirs
\ nohash_dirs no_hash_dirs nohashexecutablesonly no_hashexecutablesonly nohash_executables_only no_hash_executables_only nohashlistall no_hashlistall
\ nohash_list_all no_hash_list_all nohistallowclobber no_histallowclobber nohist_allow_clobber no_hist_allow_clobber nohistappend no_histappend
@@ -262,7 +272,7 @@ syn keyword zshOptions noaliases no_aliases noallexport no_allexport no
\ nonumeric_glob_sort no_numeric_glob_sort nooctalzeroes no_octalzeroes nooctal_zeroes no_octal_zeroes noonecmd no_onecmd noone_cmd no_one_cmd
\ nooverstrike no_overstrike noover_strike no_over_strike nopathdirs no_pathdirs nopath_dirs no_path_dirs nopathscript no_pathscript
\ nopath_script no_path_script nophysical no_physical nopipefail no_pipefail nopipe_fail no_pipe_fail noposixaliases no_posixaliases
- \ noposix_aliases no_posix_aliases noposixargzero no_posixargzero noposix_arg_zero no_posix_arg_zero noposixbuiltins no_posixbuiltins
+ \ noposix_aliases no_posix_aliases noposixargzero no_posixargzero no_posix_argzero noposix_arg_zero no_posix_arg_zero noposixbuiltins no_posixbuiltins
\ noposix_builtins no_posix_builtins noposixcd no_posixcd noposix_cd no_posix_cd noposixidentifiers no_posixidentifiers noposix_identifiers no_posix_identifiers
\ noposixjobs no_posixjobs noposix_jobs no_posix_jobs noposixstrings no_posixstrings noposix_strings no_posix_strings noposixtraps no_posixtraps
\ noposix_traps no_posix_traps noprinteightbit no_printeightbit noprint_eight_bit no_print_eight_bit noprintexitvalue no_printexitvalue
@@ -270,8 +280,8 @@ syn keyword zshOptions noaliases no_aliases noallexport no_allexport no
\ noprompt_cr no_prompt_cr nopromptpercent no_promptpercent noprompt_percent no_prompt_percent nopromptsp no_promptsp noprompt_sp no_prompt_sp
\ nopromptsubst no_promptsubst noprompt_subst no_prompt_subst nopromptvars no_promptvars noprompt_vars no_prompt_vars nopushdignoredups no_pushdignoredups
\ nopushd_ignore_dups no_pushd_ignore_dups nopushdminus no_pushdminus nopushd_minus no_pushd_minus nopushdsilent no_pushdsilent nopushd_silent no_pushd_silent
- \ nopushdtohome no_pushdtohome nopushd_to_home no_pushd_to_home norcexpandparam no_rcexpandparam norc_expandparam no_rc_expandparam norcquotes no_rcquotes
- \ norc_quotes no_rc_quotes norcs no_rcs norecexact no_recexact norec_exact no_rec_exact norematchpcre no_rematchpcre nore_match_pcre no_re_match_pcre
+ \ nopushdtohome no_pushdtohome nopushd_to_home no_pushd_to_home norcexpandparam no_rcexpandparam norc_expandparam no_rc_expandparam no_rc_expand_param norcquotes no_rcquotes
+ \ norc_quotes no_rc_quotes norcs no_rcs norecexact no_recexact norec_exact no_rec_exact norematchpcre no_rematchpcre nore_match_pcre no_re_match_pcre no_rematch_pcre
\ norestricted no_restricted normstarsilent no_rmstarsilent norm_star_silent no_rm_star_silent normstarwait no_rmstarwait norm_star_wait no_rm_star_wait
\ nosharehistory no_sharehistory noshare_history no_share_history noshfileexpansion no_shfileexpansion nosh_file_expansion no_sh_file_expansion
\ noshglob no_shglob nosh_glob no_sh_glob noshinstdin no_shinstdin noshin_stdin no_shin_stdin noshnullcmd no_shnullcmd nosh_nullcmd no_sh_nullcmd
@@ -279,11 +289,11 @@ syn keyword zshOptions noaliases no_aliases noallexport no_allexport no
\ nosh_word_split no_sh_word_split nosinglecommand no_singlecommand nosingle_command no_single_command nosinglelinezle no_singlelinezle nosingle_line_zle no_single_line_zle
\ nosourcetrace no_sourcetrace nosource_trace no_source_trace nostdin no_stdin nosunkeyboardhack no_sunkeyboardhack nosun_keyboard_hack no_sun_keyboard_hack
\ notrackall no_trackall notrack_all no_track_all notransientrprompt no_transientrprompt notransient_rprompt no_transient_rprompt
- \ notrapsasync no_trapsasync notrapasync no_trapasync notypesetsilent no_typesetsilent notype_set_silent no_type_set_silent nounset no_unset noverbose no_verbose novi no_vi
- \ nowarncreateglobal no_warncreateglobal nowarn_create_global no_warn_create_global noxtrace no_xtrace nozle no_zle
+ \ notrapsasync no_trapsasync notrapasync no_trapasync no_traps_async notypesetsilent no_typesetsilent notype_set_silent no_type_set_silent no_typeset_silent \nounset no_unset
+ \ noverbose no_verbose novi no_vi nowarncreateglobal no_warncreateglobal nowarn_create_global no_warn_create_global noxtrace no_xtrace nozle no_zle
syn case match
-syn keyword zshTypes float integer local typeset declare
+syn keyword zshTypes float integer local typeset declare private
" XXX: this may be too much
" syn match zshSwitches '\s\zs--\=[a-zA-Z0-9-]\+'
@@ -303,7 +313,7 @@ syn region zshMathSubst matchgroup=zshSubstDelim transparent
\ start='\$((' skip='\\)'
\ matchgroup=zshSubstDelim end='))'
\ contains=zshParentheses,@zshSubst,zshNumber,
- \ @zshDerefs,zshString
+ \ @zshDerefs,zshString keepend
syn region zshBrackets contained transparent start='{' skip='\\}'
\ end='}'
syn region zshSubst matchgroup=zshSubstDelim start='\${' skip='\\}'
diff --git a/scripts/release.sh b/scripts/release.sh
index 514e5b380a..67738ccc96 100755
--- a/scripts/release.sh
+++ b/scripts/release.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/sh
# Performs steps to tag a release.
#
@@ -45,11 +45,11 @@ echo "Most recent tag: ${__LAST_TAG}"
echo "Release version: ${__VERSION}"
sed -i -r 's/(NVIM_VERSION_PRERELEASE) "-dev"/\1 ""/' CMakeLists.txt
echo "Building changelog since ${__LAST_TAG}..."
-__CHANGELOG="$(./scripts/git-log-pretty-since.sh $__LAST_TAG 'vim-patch:\S')"
+__CHANGELOG="$(./scripts/git-log-pretty-since.sh "$__LAST_TAG" 'vim-patch:\S')"
git add CMakeLists.txt
git commit --edit -m "${__RELEASE_MSG} ${__CHANGELOG}"
-git tag -a v${__VERSION} -m "NVIM v${__VERSION}"
+git tag -a v"${__VERSION}" -m "NVIM v${__VERSION}"
sed -i -r 's/(NVIM_VERSION_PRERELEASE) ""/\1 "-dev"/' CMakeLists.txt
nvim -c '/NVIM_VERSION' -c 'echo "Update version numbers"' CMakeLists.txt
diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh
index 70777535cb..751f50d290 100755
--- a/scripts/vim-patch.sh
+++ b/scripts/vim-patch.sh
@@ -47,14 +47,14 @@ clean_files() {
echo
echo "Created files:"
local file
- for file in ${CREATED_FILES[@]}; do
+ for file in "${CREATED_FILES[@]}"; do
echo " • ${file}"
done
read -p "Delete these files (Y/n)? " -n 1 -r reply
echo
if [[ "${reply}" =~ ^[Yy]$ ]]; then
- rm -- ${CREATED_FILES[@]}
+ rm -- "${CREATED_FILES[@]}"
else
echo "You can use 'git clean' to remove these files when you're done."
fi
@@ -97,13 +97,13 @@ assign_commit_details() {
vim_version="${1}"
vim_tag="v${1}"
vim_commit=$(cd "${VIM_SOURCE_DIR}" \
- && git log -1 --format="%H" ${vim_tag})
+ && git log -1 --format="%H" "${vim_tag}")
local strip_commit_line=true
else
# Interpret parameter as commit hash.
vim_version="${1:0:7}"
vim_commit=$(cd "${VIM_SOURCE_DIR}" \
- && git log -1 --format="%H" ${vim_version})
+ && git log -1 --format="%H" "${vim_version}")
local strip_commit_line=false
fi
@@ -132,13 +132,16 @@ get_vim_patch() {
# Patch surgery: preprocess the patch.
# - transform src/ paths to src/nvim/
- local vim_full="$(git show -1 --pretty=medium "${vim_commit}" \
+ local vim_full
+ vim_full="$(git show -1 --pretty=medium "${vim_commit}" \
| LC_ALL=C sed -e 's/\( [ab]\/src\)/\1\/nvim/g')"
local neovim_branch="${BRANCH_PREFIX}${vim_version}"
cd "${NEOVIM_SOURCE_DIR}"
- local git_remote=$(find_git_remote)
- local checked_out_branch="$(git rev-parse --abbrev-ref HEAD)"
+ local git_remote
+ git_remote="$(find_git_remote)"
+ local checked_out_branch
+ checked_out_branch="$(git rev-parse --abbrev-ref HEAD)"
if [[ "${checked_out_branch}" == ${BRANCH_PREFIX}* ]]; then
echo "✔ Current branch '${checked_out_branch}' seems to be a vim-patch"
@@ -196,20 +199,25 @@ submit_pr() {
check_executable hub
cd "${NEOVIM_SOURCE_DIR}"
- local checked_out_branch="$(git rev-parse --abbrev-ref HEAD)"
+ local checked_out_branch
+ checked_out_branch="$(git rev-parse --abbrev-ref HEAD)"
if [[ "${checked_out_branch}" != ${BRANCH_PREFIX}* ]]; then
echo "✘ Current branch '${checked_out_branch}' doesn't seem to be a vim-patch branch."
exit 1
fi
- local git_remote=$(find_git_remote)
- local pr_body="$(git log --reverse --format='#### %s%n%n%b%n' ${git_remote}/master..HEAD)"
- local patches=("$(git log --reverse --format='%s' ${git_remote}/master..HEAD)")
+ local git_remote
+ git_remote="$(find_git_remote)"
+ local pr_body
+ pr_body="$(git log --reverse --format='#### %s%n%n%b%n' "${git_remote}"/master..HEAD)"
+ local patches
+ patches=("$(git log --reverse --format='%s' "${git_remote}"/master..HEAD)")
patches=(${patches[@]//vim-patch:}) # Remove 'vim-patch:' prefix for each item in array.
- local pr_title="${patches[@]}" # Create space-separated string from array.
+ local pr_title="${patches[*]}" # Create space-separated string from array.
pr_title="${pr_title// /,}" # Replace spaces with commas.
- local pr_message="$(printf '[RFC] vim-patch:%s\n\n%s\n' "${pr_title#,}" "${pr_body}")"
+ local pr_message
+ pr_message="$(printf '[RFC] vim-patch:%s\n\n%s\n' "${pr_title#,}" "${pr_body}")"
echo "Pushing to 'origin/${checked_out_branch}'."
output="$(git push origin "${checked_out_branch}" 2>&1)" &&
@@ -225,7 +233,7 @@ submit_pr() {
echo
echo "Cleaning up files."
local patch_file
- for patch_file in ${patches[@]}; do
+ for patch_file in "${patches[@]}"; do
patch_file="vim-${patch_file}.patch"
if [[ ! -f "${NEOVIM_SOURCE_DIR}/${patch_file}" ]]; then
continue
@@ -241,12 +249,15 @@ list_vim_patches() {
printf "\nVim patches missing from Neovim:\n"
# Get commits since 7.4.602.
- local vim_commits=$(cd "${VIM_SOURCE_DIR}" && git log --reverse --format='%H' v7.4.602..HEAD)
+ local vim_commits
+ vim_commits="$(cd "${VIM_SOURCE_DIR}" && git log --reverse --format='%H' v7.4.602..HEAD)"
local vim_commit
for vim_commit in ${vim_commits}; do
local is_missing
- local vim_tag=$(cd "${VIM_SOURCE_DIR}" && git describe --tags --exact-match "${vim_commit}" 2>/dev/null)
+ local vim_tag
+ # This fails for untagged commits (e.g., runtime file updates) so mask the return status
+ vim_tag="$(cd "${VIM_SOURCE_DIR}" && git describe --tags --exact-match "${vim_commit}" 2>/dev/null)" || true
if [[ -n "${vim_tag}" ]]; then
local patch_number="${vim_tag:5}" # Remove prefix like "v7.4."
# Tagged Vim patch, check version.c:
@@ -283,8 +294,10 @@ review_commit() {
local neovim_patch_url="${neovim_commit_url}.patch"
local git_patch_prefix='Subject: \[PATCH\] '
- local neovim_patch="$(curl -Ssf "${neovim_patch_url}")"
- local vim_version="$(head -n 4 <<< "${neovim_patch}" | sed -n "s/${git_patch_prefix}vim-patch:\([a-z0-9.]*\)$/\1/p")"
+ local neovim_patch
+ neovim_patch="$(curl -Ssf "${neovim_patch_url}")"
+ local vim_version
+ vim_version="$(head -n 4 <<< "${neovim_patch}" | sed -n "s/${git_patch_prefix}vim-patch:\([a-z0-9.]*\)$/\1/p")"
echo
if [[ -n "${vim_version}" ]]; then
@@ -300,9 +313,12 @@ review_commit() {
local vim_patch_url="${vim_commit_url}.patch"
- local expected_commit_message="$(commit_message)"
- local message_length="$(wc -l <<< "${expected_commit_message}")"
- local commit_message="$(tail -n +4 <<< "${neovim_patch}" | head -n "${message_length}")"
+ local expected_commit_message
+ expected_commit_message="$(commit_message)"
+ local message_length
+ message_length="$(wc -l <<< "${expected_commit_message}")"
+ local commit_message
+ commit_message="$(tail -n +4 <<< "${neovim_patch}" | head -n "${message_length}")"
if [[ "${commit_message#${git_patch_prefix}}" == "${expected_commit_message}" ]]; then
echo "✔ Found expected commit message."
else
@@ -347,7 +363,7 @@ review_pr() {
local pr_commit_url
local reply
- for pr_commit_url in ${pr_commit_urls[@]}; do
+ for pr_commit_url in "${pr_commit_urls[@]}"; do
review_commit "${pr_commit_url}"
if [[ "${pr_commit_url}" != "${pr_commit_urls[-1]}" ]]; then
read -p "Continue with next commit (Y/n)? " -n 1 -r reply
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
index 0711642868..6b2ce08d36 100644
--- a/src/nvim/CMakeLists.txt
+++ b/src/nvim/CMakeLists.txt
@@ -1,4 +1,5 @@
include(CheckLibraryExists)
+include(CheckCCompilerFlag)
option(USE_GCOV "Enable gcov support" OFF)
@@ -258,8 +259,14 @@ install_helper(TARGETS nvim)
if(CLANG_ASAN_UBSAN)
message(STATUS "Enabling Clang address sanitizer and undefined behavior sanitizer for nvim.")
+ check_c_compiler_flag(-fno-sanitize-recover=all SANITIZE_RECOVER_ALL)
+ if(SANITIZE_RECOVER_ALL)
+ set(SANITIZE_RECOVER -fno-sanitize-recover=all) # Clang 3.6+
+ else()
+ set(SANITIZE_RECOVER -fno-sanitize-recover) # Clang 3.5-
+ endif()
set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "-DEXITFREE ")
- set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "-fno-sanitize-recover -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=address -fsanitize=undefined -fsanitize-blacklist=${PROJECT_SOURCE_DIR}/.asan-blacklist")
+ set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "${SANITIZE_RECOVER} -fno-omit-frame-pointer -fno-optimize-sibling-calls -fsanitize=address -fsanitize=undefined -fsanitize-blacklist=${PROJECT_SOURCE_DIR}/.asan-blacklist")
set_property(TARGET nvim APPEND_STRING PROPERTY LINK_FLAGS "-fsanitize=address -fsanitize=undefined ")
elseif(CLANG_MSAN)
message(STATUS "Enabling Clang memory sanitizer for nvim.")
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 8c8881b398..712ee06b85 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -21701,6 +21701,18 @@ static void term_resize(uint16_t width, uint16_t height, void *d)
pty_process_resize(&data->proc.pty, width, height);
}
+static inline void term_delayed_free(void **argv)
+{
+ TerminalJobData *j = argv[0];
+ if (j->in.pending_reqs || j->out.pending_reqs || j->err.pending_reqs) {
+ queue_put(j->events, term_delayed_free, 1, j);
+ return;
+ }
+
+ terminal_destroy(j->term);
+ term_job_data_decref(j);
+}
+
static void term_close(void *d)
{
TerminalJobData *data = d;
@@ -21708,8 +21720,7 @@ static void term_close(void *d)
data->exited = true;
process_stop((Process *)&data->proc);
}
- terminal_destroy(data->term);
- term_job_data_decref(d);
+ queue_put(data->events, term_delayed_free, 1, data);
}
static void term_job_data_decref(TerminalJobData *data)
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index e8314e02e0..415d6ee460 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -4413,17 +4413,20 @@ int find_help_tags(char_u *arg, int *num_matches, char_u ***matches, int keep_la
|| (arg[0] == '\\' && arg[1] == '{'))
*d++ = '\\';
- for (s = arg; *s; ++s) {
- /*
- * Replace "|" with "bar" and '"' with "quote" to match the name of
- * the tags for these commands.
- * Replace "*" with ".*" and "?" with "." to match command line
- * completion.
- * Insert a backslash before '~', '$' and '.' to avoid their
- * special meaning.
- */
- if (d - IObuff > IOSIZE - 10) /* getting too long!? */
+ // If tag starts with "('", skip the "(". Fixes CTRL-] on ('option'.
+ if (*arg == '(' && arg[1] == '\'') {
+ arg++;
+ }
+ for (s = arg; *s; s++) {
+ // Replace "|" with "bar" and '"' with "quote" to match the name of
+ // the tags for these commands.
+ // Replace "*" with ".*" and "?" with "." to match command line
+ // completion.
+ // Insert a backslash before '~', '$' and '.' to avoid their
+ // special meaning.
+ if (d - IObuff > IOSIZE - 10) { // getting too long!?
break;
+ }
switch (*s) {
case '|': STRCPY(d, "bar");
d += 3;
@@ -4484,6 +4487,12 @@ int find_help_tags(char_u *arg, int *num_matches, char_u ***matches, int keep_la
*d++ = *s;
+ // If tag contains "({" or "([", tag terminates at the "(".
+ // This is for help on functions, e.g.: abs({expr}).
+ if (*s == '(' && (s[1] == '{' || s[1] =='[')) {
+ break;
+ }
+
/*
* If tag starts with ', toss everything after a second '. Fixes
* CTRL-] on 'option'. (would include the trailing '.').
diff --git a/src/nvim/ex_cmds2.c b/src/nvim/ex_cmds2.c
index 12efddc205..df387f9a60 100644
--- a/src/nvim/ex_cmds2.c
+++ b/src/nvim/ex_cmds2.c
@@ -1241,16 +1241,18 @@ static void add_bufnum(int *bufnrs, int *bufnump, int nr)
*bufnump = *bufnump + 1;
}
-/*
- * Return TRUE if any buffer was changed and cannot be abandoned.
- * That changed buffer becomes the current buffer.
- */
-int
-check_changed_any (
- int hidden /* Only check hidden buffers */
-)
-{
- int ret = FALSE;
+/// Check if any buffer was changed and cannot be abandoned.
+/// That changed buffer becomes the current buffer.
+/// When "unload" is true the current buffer is unloaded instead of making it
+/// hidden. This is used for ":q!".
+///
+/// @param[in] hidden specifies whether to check only hidden buffers.
+/// @param[in] unload specifies whether to unload, instead of hide, the buffer.
+///
+/// @returns true if any buffer is changed and cannot be abandoned
+int check_changed_any(bool hidden, bool unload)
+{
+ bool ret = false;
int save;
int i;
int bufnum = 0;
@@ -1261,8 +1263,9 @@ check_changed_any (
++bufcount;
}
- if (bufcount == 0)
- return FALSE;
+ if (bufcount == 0) {
+ return false;
+ }
bufnrs = xmalloc(sizeof(*bufnrs) * bufcount);
@@ -1346,9 +1349,10 @@ check_changed_any (
}
buf_found:
- /* Open the changed buffer in the current window. */
- if (buf != curbuf)
- set_curbuf(buf, DOBUF_GOTO);
+ // Open the changed buffer in the current window.
+ if (buf != curbuf) {
+ set_curbuf(buf, unload ? DOBUF_UNLOAD : DOBUF_GOTO);
+ }
theend:
xfree(bufnrs);
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 89c35a3c45..870284a0f7 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -5671,10 +5671,10 @@ static void ex_quit(exarg_T *eap)
exiting = TRUE;
if ((!P_HID(curbuf)
&& check_changed(curbuf, (p_awa ? CCGD_AW : 0)
- | (eap->forceit ? CCGD_FORCEIT : 0)
- | CCGD_EXCMD))
- || check_more(TRUE, eap->forceit) == FAIL
- || (only_one_window() && check_changed_any(eap->forceit))) {
+ | (eap->forceit ? CCGD_FORCEIT : 0)
+ | CCGD_EXCMD))
+ || check_more(true, eap->forceit) == FAIL
+ || (only_one_window() && check_changed_any(eap->forceit, true))) {
not_exiting();
} else {
// quit last window
@@ -5723,9 +5723,10 @@ static void ex_quit_all(exarg_T *eap)
if (curbuf_locked() || (curbuf->b_nwindows == 1 && curbuf->b_closing))
return;
- exiting = TRUE;
- if (eap->forceit || !check_changed_any(FALSE))
+ exiting = true;
+ if (eap->forceit || !check_changed_any(false, false)) {
getout(0);
+ }
not_exiting();
}
@@ -6010,21 +6011,22 @@ static void ex_exit(exarg_T *eap)
if (curbuf_locked() || (curbuf->b_nwindows == 1 && curbuf->b_closing))
return;
- /*
- * if more files or windows we won't exit
- */
- if (check_more(FALSE, eap->forceit) == OK && only_one_window())
- exiting = TRUE;
- if ( ((eap->cmdidx == CMD_wq
- || curbufIsChanged())
- && do_write(eap) == FAIL)
- || check_more(TRUE, eap->forceit) == FAIL
- || (only_one_window() && check_changed_any(eap->forceit))) {
+ // if more files or windows we won't exit
+ if (check_more(false, eap->forceit) == OK && only_one_window()) {
+ exiting = true;
+ }
+ if (((eap->cmdidx == CMD_wq
+ || curbufIsChanged())
+ && do_write(eap) == FAIL)
+ || check_more(true, eap->forceit) == FAIL
+ || (only_one_window() && check_changed_any(eap->forceit, false))) {
not_exiting();
} else {
- if (only_one_window()) /* quit last window, exit Vim */
+ if (only_one_window()) {
+ // quit last window, exit Vim
getout(0);
- /* Quit current window, may free the buffer. */
+ }
+ // Quit current window, may free the buffer.
win_close(curwin, !P_HID(curwin->w_buffer));
}
}
@@ -9497,12 +9499,14 @@ static void ex_folddo(exarg_T *eap)
static void ex_terminal(exarg_T *eap)
{
- // We will call termopen() with ['shell'] if not given a {cmd}.
- char *name = (char *)p_sh;
+ char *name = (char *)p_sh; // Default to 'shell' if {cmd} is not given.
+ bool mustfree = false;
char *lquote = "['";
char *rquote = "']";
+
if (*eap->arg != NUL) {
name = (char *)vim_strsave_escaped(eap->arg, (char_u *)"\"\\");
+ mustfree = true;
lquote = rquote = "\"";
}
@@ -9512,7 +9516,7 @@ static void ex_terminal(exarg_T *eap)
eap->forceit==TRUE ? "!" : "", lquote, name, rquote);
do_cmdline_cmd(ex_cmd);
- if (name != (char *)p_sh) {
+ if (mustfree) {
xfree(name);
}
}
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c
index 384a17004e..edc430410c 100644
--- a/src/nvim/os/env.c
+++ b/src/nvim/os/env.c
@@ -147,7 +147,7 @@ static char_u *homedir = NULL;
void init_homedir(void)
{
- /* In case we are called a second time (when 'encoding' changes). */
+ // In case we are called a second time (when 'encoding' changes).
xfree(homedir);
homedir = NULL;
@@ -176,16 +176,16 @@ void init_homedir(void)
if (var != NULL) {
#ifdef UNIX
- /*
- * Change to the directory and get the actual path. This resolves
- * links. Don't do it when we can't return.
- */
+ // Change to the directory and get the actual path. This resolves
+ // links. Don't do it when we can't return.
if (os_dirname(NameBuff, MAXPATHL) == OK
&& os_chdir((char *)NameBuff) == 0) {
- if (!os_chdir((char *)var) && os_dirname(IObuff, IOSIZE) == OK)
+ if (!os_chdir((char *)var) && os_dirname(IObuff, IOSIZE) == OK) {
var = IObuff;
- if (os_chdir((char *)NameBuff) != 0)
+ }
+ if (os_chdir((char *)NameBuff) != 0) {
EMSG(_(e_prev_dir));
+ }
}
#endif
homedir = vim_strsave(var);
@@ -239,29 +239,29 @@ void expand_env(char_u *src, char_u *dst, int dstlen)
/// "~/" is also expanded, using $HOME. For Unix "~user/" is expanded.
/// Skips over "\ ", "\~" and "\$" (not for Win32 though).
/// If anything fails no expansion is done and dst equals src.
-/// startstr recognize the start of a new name, for '~' expansion.
+/// prefix recognize the start of a new name, for '~' expansion.
/// @param srcp Input string e.g. "$HOME/vim.hlp"
/// @param dst Where to put the result
/// @param dstlen Maximum length of the result
/// @param esc Should we escape spaces in expanded variables?
/// @param one Should we expand more than one '~'?
-/// @param startstr Common prefix for paths, can be NULL
-void expand_env_esc(char_u *srcp, char_u *dst, int dstlen, bool esc, bool one,
- char_u *startstr)
+/// @param prefix Common prefix for paths, can be NULL
+void expand_env_esc(char_u *restrict srcp,
+ char_u *restrict dst,
+ int dstlen,
+ bool esc,
+ bool one,
+ char_u *prefix)
{
- char_u *src;
char_u *tail;
- int c;
char_u *var;
bool copy_char;
bool mustfree; // var was allocated, need to free it later
bool at_start = true; // at start of a name
- int startstr_len = 0;
- if (startstr != NULL)
- startstr_len = (int)STRLEN(startstr);
+ int prefix_len = (prefix == NULL) ? 0 : (int)STRLEN(prefix);
- src = skipwhite(srcp);
+ char_u *src = skipwhite(srcp);
dstlen--; // leave one char space for "\,"
while (*src && dstlen > 0) {
// Skip over `=expr`.
@@ -281,6 +281,7 @@ void expand_env_esc(char_u *srcp, char_u *dst, int dstlen, bool esc, bool one,
dstlen -= (int)len;
continue;
}
+
copy_char = true;
if ((*src == '$') || (*src == '~' && at_start)) {
mustfree = false;
@@ -290,14 +291,15 @@ void expand_env_esc(char_u *srcp, char_u *dst, int dstlen, bool esc, bool one,
if (*src != '~') { // environment var
tail = src + 1;
var = dst;
- c = dstlen - 1;
+ int c = dstlen - 1;
#ifdef UNIX
// Unix has ${var-name} type environment vars
if (*tail == '{' && !vim_isIDc('{')) {
- tail++; /* ignore '{' */
- while (c-- > 0 && *tail && *tail != '}')
+ tail++; // ignore '{'
+ while (c-- > 0 && *tail != NUL && *tail != '}') {
*var++ = *tail++;
+ }
} else // NOLINT
#endif
{
@@ -321,7 +323,7 @@ void expand_env_esc(char_u *srcp, char_u *dst, int dstlen, bool esc, bool one,
#if defined(UNIX)
}
#endif
- } else if ( src[1] == NUL /* home directory */
+ } else if (src[1] == NUL // home directory
|| vim_ispathsep(src[1])
|| vim_strchr((char_u *)" ,\t\n", src[1]) != NULL) {
var = homedir;
@@ -331,12 +333,13 @@ void expand_env_esc(char_u *srcp, char_u *dst, int dstlen, bool esc, bool one,
// Copy ~user to dst[], so we can put a NUL after it.
tail = src;
var = dst;
- c = dstlen - 1;
- while ( c-- > 0
- && *tail
- && vim_isfilec(*tail)
- && !vim_ispathsep(*tail))
+ int c = dstlen - 1;
+ while (c-- > 0
+ && *tail
+ && vim_isfilec(*tail)
+ && !vim_ispathsep(*tail)) {
*var++ = *tail++;
+ }
*var = NUL;
// Use os_get_user_directory() to get the user directory.
// If this function fails, the shell is used to
@@ -344,8 +347,7 @@ void expand_env_esc(char_u *srcp, char_u *dst, int dstlen, bool esc, bool one,
// does not support ~user (old versions of /bin/sh).
var = (char_u *)os_get_user_directory((char *)dst + 1);
mustfree = true;
- if (var == NULL)
- {
+ if (var == NULL) {
expand_T xpc;
ExpandInit(&xpc);
@@ -381,8 +383,9 @@ void expand_env_esc(char_u *srcp, char_u *dst, int dstlen, bool esc, bool one,
if (esc && var != NULL && vim_strpbrk(var, (char_u *)" \t") != NULL) {
char_u *p = vim_strsave_escaped(var, (char_u *)" \t");
- if (mustfree)
+ if (mustfree) {
xfree(var);
+ }
var = p;
mustfree = true;
}
@@ -391,7 +394,7 @@ void expand_env_esc(char_u *srcp, char_u *dst, int dstlen, bool esc, bool one,
&& (STRLEN(var) + STRLEN(tail) + 1 < (unsigned)dstlen)) {
STRCPY(dst, var);
dstlen -= (int)STRLEN(var);
- c = (int)STRLEN(var);
+ int c = (int)STRLEN(var);
// if var[] ends in a path separator and tail[] starts
// with it, skip a character
if (*var != NUL && after_pathsep((char *)dst, (char *)dst + c)
@@ -404,8 +407,9 @@ void expand_env_esc(char_u *srcp, char_u *dst, int dstlen, bool esc, bool one,
src = tail;
copy_char = false;
}
- if (mustfree)
+ if (mustfree) {
xfree(var);
+ }
}
if (copy_char) { // copy at least one char
@@ -422,9 +426,10 @@ void expand_env_esc(char_u *srcp, char_u *dst, int dstlen, bool esc, bool one,
*dst++ = *src++;
--dstlen;
- if (startstr != NULL && src - startstr_len >= srcp
- && STRNCMP(src - startstr_len, startstr, startstr_len) == 0)
+ if (prefix != NULL && src - prefix_len >= srcp
+ && STRNCMP(src - prefix_len, prefix, prefix_len) == 0) {
at_start = true;
+ }
}
}
*dst = NUL;
@@ -451,17 +456,37 @@ static char *vim_version_dir(const char *vimdir)
return NULL;
}
-/// If the string between "p" and "pend" ends in "name/", return "pend" minus
-/// the length of "name/". Otherwise return "pend".
-static char *remove_tail(char *p, char *pend, char *name)
+/// If `dirname + "/"` precedes `pend` in the path, return the pointer to
+/// `dirname + "/" + pend`. Otherwise return `pend`.
+///
+/// Examples (path = /usr/local/share/nvim/runtime/doc/help.txt):
+///
+/// pend = help.txt
+/// dirname = doc
+/// -> doc/help.txt
+///
+/// pend = doc/help.txt
+/// dirname = runtime
+/// -> runtime/doc/help.txt
+///
+/// pend = runtime/doc/help.txt
+/// dirname = vim74
+/// -> runtime/doc/help.txt
+///
+/// @param path Path to a file
+/// @param pend A suffix of the path
+/// @param dirname The immediate path fragment before the pend
+/// @return The new pend including dirname or just pend
+static char *remove_tail(char *path, char *pend, char *dirname)
{
- size_t len = STRLEN(name) + 1;
- char *newend = pend - len;
+ size_t len = STRLEN(dirname);
+ char *new_tail = pend - len - 1;
- if (newend >= p
- && fnamencmp((char_u *)newend, (char_u *)name, len - 1) == 0
- && (newend == p || after_pathsep(p, newend)))
- return newend;
+ if (new_tail >= path
+ && fnamencmp((char_u *)new_tail, (char_u *)dirname, len) == 0
+ && (new_tail == path || after_pathsep(path, new_tail))) {
+ return new_tail;
+ }
return pend;
}
@@ -745,9 +770,10 @@ void home_replace(buf_T *buf, char_u *src, char_u *dst, int dstlen, bool one)
/// @param src Input file name
char_u * home_replace_save(buf_T *buf, char_u *src) FUNC_ATTR_NONNULL_RET
{
- size_t len = 3; /* space for "~/" and trailing NUL */
- if (src != NULL) /* just in case */
+ size_t len = 3; // space for "~/" and trailing NUL
+ if (src != NULL) { // just in case
len += STRLEN(src);
+ }
char_u *dst = xmalloc(len);
home_replace(buf, src, dst, (int)len, true);
return dst;
@@ -783,8 +809,7 @@ char_u *get_env_name(expand_T *xp, int idx)
STRLCPY(name, envname, ENVNAMELEN);
xfree(envname);
return name;
- } else {
- return NULL;
}
+ return NULL;
}
diff --git a/src/nvim/testdir/Makefile b/src/nvim/testdir/Makefile
index b763a67347..7195c7e632 100644
--- a/src/nvim/testdir/Makefile
+++ b/src/nvim/testdir/Makefile
@@ -39,8 +39,9 @@ SCRIPTS := \
# Tests using runtest.vim.vim.
# Keep test_alot*.res as the last one, sort the others.
NEW_TESTS = \
- test_viml.res \
test_cursor_func.res \
+ test_help_tagjump.res \
+ test_viml.res \
test_alot.res
SCRIPTS_GUI := test16.out
diff --git a/src/nvim/testdir/test_help_tagjump.vim b/src/nvim/testdir/test_help_tagjump.vim
new file mode 100644
index 0000000000..9f9207d27d
--- /dev/null
+++ b/src/nvim/testdir/test_help_tagjump.vim
@@ -0,0 +1,40 @@
+" Tests for :help! {subject}
+
+func SetUp()
+ " v:progpath is …/build/bin/nvim and we need …/build/runtime
+ " to be added to &rtp
+ let builddir = fnamemodify(exepath(v:progpath), ':h:h')
+ let s:rtp = &rtp
+ let &rtp .= printf(',%s/runtime', builddir)
+endfunc
+
+func TearDown()
+ let &rtp = s:rtp
+endfunc
+
+func Test_help_tagjump()
+ help
+ call assert_equal("help", &filetype)
+ call assert_true(getline('.') =~ '\*help.txt\*')
+ helpclose
+
+ exec "help! ('textwidth'"
+ call assert_equal("help", &filetype)
+ call assert_true(getline('.') =~ "\\*'textwidth'\\*")
+ helpclose
+
+ exec "help! ('buflisted'),"
+ call assert_equal("help", &filetype)
+ call assert_true(getline('.') =~ "\\*'buflisted'\\*")
+ helpclose
+
+ exec "help! abs({expr})"
+ call assert_equal("help", &filetype)
+ call assert_true(getline('.') =~ '\*abs()\*')
+ helpclose
+
+ exec "help! arglistid([{winnr})"
+ call assert_equal("help", &filetype)
+ call assert_true(getline('.') =~ '\*arglistid()\*')
+ helpclose
+endfunc
diff --git a/src/nvim/version.c b/src/nvim/version.c
index d7eae84c1b..3746f53e1f 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -76,6 +76,7 @@ static int included_patches[] = {
1757,
1755,
1753,
+ 1728,
1654,
1652,
1643,
@@ -111,10 +112,10 @@ static int included_patches[] = {
1574,
// 1573,
// 1572 NA
- // 1571,
+ 1571,
1570,
1569,
- // 1568,
+ 1568,
// 1567,
// 1566 NA
// 1565,
@@ -645,7 +646,7 @@ static int included_patches[] = {
// 1040 NA
// 1039,
// 1038 NA
- // 1037,
+ 1037,
// 1036,
1035,
// 1034,
diff --git a/test/functional/legacy/031_close_commands_spec.lua b/test/functional/legacy/031_close_commands_spec.lua
index 3597cba12a..b79b1903ba 100644
--- a/test/functional/legacy/031_close_commands_spec.lua
+++ b/test/functional/legacy/031_close_commands_spec.lua
@@ -10,7 +10,7 @@
-- :edit
local helpers = require('test.functional.helpers')
-local feed, insert = helpers.feed, helpers.insert
+local feed, insert, source = helpers.feed, helpers.insert, helpers.source
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect
describe('Commands that close windows and/or buffers', function()
@@ -84,6 +84,28 @@ describe('Commands that close windows and/or buffers', function()
feed('GA 4<Esc>:all!<CR>')
execute('1wincmd w')
expect('testtext 2 2 2')
+
+ -- Test ":q!" and hidden buffer.
+ execute('bw! Xtest1 Xtest2 Xtest3 Xtest4')
+ execute('sp Xtest1')
+ execute('wincmd w')
+ execute('bw!')
+ execute('set modified')
+ execute('bot sp Xtest2')
+ execute('set modified')
+ execute('bot sp Xtest3')
+ execute('set modified')
+ execute('wincmd t')
+ execute('hide')
+ execute('q!')
+ expect('testtext 3')
+ execute('q!')
+ feed('<CR>')
+ expect('testtext 1')
+ source([[
+ q!
+ " Now nvim should have exited
+ throw "Oh, Not finished yet."]])
end)
teardown(function()
diff --git a/test/functional/legacy/068_text_formatting_spec.lua b/test/functional/legacy/068_text_formatting_spec.lua
index 0e3d66e0e5..cac8be77f3 100644
--- a/test/functional/legacy/068_text_formatting_spec.lua
+++ b/test/functional/legacy/068_text_formatting_spec.lua
@@ -1,7 +1,5 @@
--- Test for text formatting.
-
local helpers = require('test.functional.helpers')
-local feed, insert, source = helpers.feed, helpers.insert, helpers.source
+local feed, insert = helpers.feed, helpers.insert
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect
describe('text formatting', function()
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua
index 55ef254a63..cefb603a7e 100644
--- a/test/functional/terminal/buffer_spec.lua
+++ b/test/functional/terminal/buffer_spec.lua
@@ -158,8 +158,7 @@ describe('terminal buffer', function()
end)
it('handles loss of focus gracefully', function()
- -- Temporarily change the statusline to avoid printing the file name, which
- -- varies be where the test is run.
+ -- Change the statusline to avoid printing the file name, which varies.
nvim('set_option', 'statusline', '==========')
execute('set laststatus=0')
@@ -195,5 +194,15 @@ describe('terminal buffer', function()
execute('set laststatus=1') -- Restore laststatus to the default.
end)
+
+ it('term_close() use-after-free #4393', function()
+ if eval("executable('yes')") == 0 then
+ pending('missing "yes" command')
+ return
+ end
+ execute('terminal yes')
+ feed([[<C-\><C-n>]])
+ execute('bdelete!')
+ end)
end)
diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua
index 493539b4d3..d89092ff27 100644
--- a/test/functional/terminal/ex_terminal_spec.lua
+++ b/test/functional/terminal/ex_terminal_spec.lua
@@ -1,15 +1,15 @@
local helpers = require('test.functional.helpers')
local Screen = require('test.functional.ui.screen')
local clear, wait, nvim = helpers.clear, helpers.wait, helpers.nvim
-local nvim_dir = helpers.nvim_dir
-local execute = helpers.execute
+local nvim_dir, source, eq = helpers.nvim_dir, helpers.source, helpers.eq
+local execute, eval = helpers.execute, helpers.eval
describe(':terminal', function()
local screen
before_each(function()
clear()
- screen = Screen.new(50, 7)
+ screen = Screen.new(50, 4)
screen:attach(false)
nvim('set_option', 'shell', nvim_dir..'/shell-test')
nvim('set_option', 'shellcmdflag', 'EXE')
@@ -23,9 +23,6 @@ describe(':terminal', function()
ready $ |
[Process exited 0] |
|
- |
- |
- |
-- TERMINAL -- |
]])
end)
@@ -37,9 +34,6 @@ describe(':terminal', function()
ready $ echo hi |
|
[Process exited 0] |
- |
- |
- |
-- TERMINAL -- |
]])
end)
@@ -51,10 +45,15 @@ describe(':terminal', function()
ready $ echo 'hello' \ "world" |
|
[Process exited 0] |
- |
- |
- |
-- TERMINAL -- |
]])
end)
+
+ it('ex_terminal() double-free #4554', function()
+ source([[
+ autocmd BufNew * set shell=foo
+ terminal]])
+ -- Verify that BufNew actually fired (else the test is invalid).
+ eq('foo', eval('&shell'))
+ end)
end)