diff options
-rw-r--r-- | runtime/autoload/health/provider.vim | 2 | ||||
-rw-r--r-- | runtime/autoload/vimexpect.vim | 2 | ||||
-rwxr-xr-x | scripts/vim-patch.sh | 35 | ||||
-rw-r--r-- | test/functional/core/job_spec.lua | 6 |
4 files changed, 28 insertions, 17 deletions
diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim index dce0abd671..cb32dab376 100644 --- a/runtime/autoload/health/provider.vim +++ b/runtime/autoload/health/provider.vim @@ -25,7 +25,7 @@ function! s:version_cmp(a, b) abort endfunction " Handler for s:system() function. -function! s:system_handler(jobid, data, event) abort +function! s:system_handler(jobid, data, event) dict abort if a:event == 'stdout' || a:event == 'stderr' let self.output .= join(a:data, '') elseif a:event == 'exit' diff --git a/runtime/autoload/vimexpect.vim b/runtime/autoload/vimexpect.vim index 16e7d30d6c..0ed888d2a4 100644 --- a/runtime/autoload/vimexpect.vim +++ b/runtime/autoload/vimexpect.vim @@ -140,7 +140,7 @@ endfunction " Job handler that simply forwards lines to the parser. -function! s:JobOutput(id, lines) +function! s:JobOutput(_id, lines, _event) dict call self._parser.feed(a:lines) endfunction diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index 83a64e5b1a..28aa53b3c9 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -25,6 +25,9 @@ usage() { echo " -p {vim-revision} Download and apply the Vim patch vim-revision." echo " vim-revision can be a version number of the " echo " format '7.4.xxx' or a Git commit hash." + echo " -g {vim-revision} Download the Vim patch vim-revision." + echo " vim-revision can be a version number of the " + echo " format '7.4.xxx' or a Git commit hash." echo " -s Submit a vim-patch pull request to Neovim." echo " -r {pr-number} Review a vim-patch pull request to Neovim." echo @@ -166,9 +169,21 @@ get_vim_patch() { local patch_content patch_content="$(git --no-pager show --color=never -1 --pretty=medium "${vim_commit}")" - local nvim_branch="${BRANCH_PREFIX}${vim_version}" cd "${NVIM_SOURCE_DIR}" + + printf "Creating patch...\n" + echo "$patch_content" > "${NVIM_SOURCE_DIR}/${patch_file}" + + printf "Pre-processing patch...\n" + preprocess_patch "${NVIM_SOURCE_DIR}/${patch_file}" + + printf "✔ Saved patch to '${NVIM_SOURCE_DIR}/${patch_file}'.\n" +} + +stage_patch() { + get_vim_patch "$1" + local git_remote git_remote="$(find_git_remote)" local checked_out_branch @@ -183,6 +198,7 @@ get_vim_patch() { echo "✔ ${output}" || (echo "✘ ${output}"; false) + local nvim_branch="${BRANCH_PREFIX}${vim_version}" echo echo "Creating new branch '${nvim_branch}' based on '${git_remote}/master'." cd "${NVIM_SOURCE_DIR}" @@ -196,14 +212,6 @@ get_vim_patch() { echo "✔ ${output}" || (echo "✘ ${output}"; false) - printf "Creating patch...\n" - echo "$patch_content" > "${NVIM_SOURCE_DIR}/${patch_file}" - - printf "Pre-processing patch...\n" - preprocess_patch "${NVIM_SOURCE_DIR}/${patch_file}" - - printf "✔ Saved patch to '${NVIM_SOURCE_DIR}/${patch_file}'.\n" - printf "\nInstructions: Proceed to port the patch. This may help: patch -p1 < ${patch_file} @@ -218,8 +226,7 @@ get_vim_patch() { When you're done, try '${BASENAME} -s' to create the pull request. See the wiki for more information: - * https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-vim - " + * https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-vim\n" } hub_pr() { @@ -430,7 +437,7 @@ review_pr() { clean_files } -while getopts "hlp:r:s" opt; do +while getopts "hlp:g:r:s" opt; do case ${opt} in h) usage @@ -441,6 +448,10 @@ while getopts "hlp:r:s" opt; do exit 0 ;; p) + stage_patch "${OPTARG}" + exit 0 + ;; + g) get_vim_patch "${OPTARG}" exit 0 ;; diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua index 34085fa522..fa38671529 100644 --- a/test/functional/core/job_spec.lua +++ b/test/functional/core/job_spec.lua @@ -368,11 +368,11 @@ describe('jobs', function() eq({'notification', 'wait', {{-2}}}, next_msg()) end) - pending('can be called recursively', function() + it('can be called recursively', function() source([[ let g:opts = {} let g:counter = 0 - function g:opts.on_stdout(id, msg) + function g:opts.on_stdout(id, msg, _event) if self.state == 0 if self.counter < 10 call Run() @@ -390,7 +390,7 @@ describe('jobs', function() call jobclose(a:id, 'stdin') endif endfunction - function g:opts.on_exit() + function g:opts.on_exit(...) call rpcnotify(g:channel, 'w', printf('job %d exited', self.counter)) endfunction function Run() |