Compare commits

..

34 Commits

Author SHA1 Message Date
Justin M. Keyes
1060bfd033 NVIM v0.3.5
Maintenance release to fix issues found in v0.3.4.

FIXES:

f891131c6b #9894 options: properly reset directories on 'autochdir'
9a5488c2a6 Remove MSVC optimization workaround for SHM_ALL
1793ba8176 Make SHM_ALL to a variable instead of a compound literal #define
947069ba14 doc: mention "pynvim" module rename
46c7e12f27 #9629 screen: don't crash when drawing popupmenu with 'rightleft' option
f1843c0035 vim-patch:8.1.0677: look-behind match may use the wrong line number
1204421888 #8325 :terminal : set topline based on window height
aaa8c3d711 #9504 :recover : Fix crash on non-existent *.swp
2019-04-28 22:10:12 +02:00
Marco Hinz
f891131c6b options: properly reset directories on 'autochdir' (#9894)
Fixes https://github.com/neovim/neovim/issues/9892
2019-04-15 21:04:16 +02:00
James McCoy
9a5488c2a6 Remove MSVC optimization workaround for SHM_ALL 2019-04-12 02:44:35 +02:00
James McCoy
1793ba8176 Make SHM_ALL to a variable instead of a compound literal #define
gcc-9 has [improved compliance] with the C spec for lifetime of compound
literals, tying their lifetime to block scope instead of function scope.
This makes the behavior comparable to all other automatic variables.

Using the SHM_ALL #define instantiated a compound literal local to an if
clause and assigned the address to a "char_u *".  Since the pointer was
then being used outside of the if clause, it was using an invalid
address.

[improved compliance]: https://gcc.gnu.org/gcc-9/porting_to.html#complit

Closes #9855
2019-04-12 02:43:59 +02:00
Justin M. Keyes
947069ba14 doc: mention "pynvim" module rename
closes #9764
2019-03-26 23:07:04 +01:00
Björn Linse
46c7e12f27 Merge pull request #9629 from bfredl/pumfix
screen: don't crash when drawing popupmenu with 'rightleft' option
2019-02-19 19:30:35 +01:00
Björn Linse
b98be54148 screen: don't crash when drawing popupmenu with 'rightleft' option 2019-02-19 17:46:21 +01:00
Jan Edmund Lazo
f1843c0035 vim-patch:8.1.0677: look-behind match may use the wrong line number
crash reported in #9584

Problem:    Look-behind match may use the wrong line number. (Dominique Pelle)
Solution:   Use the line number in regsave instead of the one in behind_pos,
            we may be looking at the previous line. (closes vim/vim#3749)
866f355814
2019-02-07 22:43:38 +01:00
Justin M. Keyes
1204421888 :terminal : set topline based on window height #8325 2019-02-06 04:12:14 +01:00
raffitz
aaa8c3d711 :recover : Fix crash on non-existent *.swp #9504
Reverts d2944e6a29. mf_open() _can_ fail if the file does not exist.

closes #9503
closes #9504
2019-01-15 00:49:11 +01:00
Justin M. Keyes
7b7266430c version bump 2019-01-13 14:29:45 +01:00
Justin M. Keyes
ab2bbbf6c4 NVIM v0.3.4
This maintenance release fixes some issues found in v0.3.3.

FIXES:

8a7b6200fb #9487 provider: improve error message if provider is missing
44ea903ca5 #9468 checkhealth: detect broken pip
b4028056fa Windows: nvim-qt v0.2.12 (fix potential "blank screen" at startup)
2019-01-13 14:25:08 +01:00
Justin M. Keyes
7523eb3ce4 Merge #9495 from justinmk/release-0.3
release candidate 0.3.4
2019-01-13 02:33:47 +01:00
Marco Hinz
8a7b6200fb provider: improve error message if provider is missing (#9487)
Move `has_eval_provider()` check to `eval_call_provider()` to make sure that
every code path calls it first.

Previously we would, when pynvim was missing, get a nice error message for
`:python3 1`, but not for `:py3file blah`.

Fixes https://github.com/neovim/neovim/issues/9485
2019-01-13 01:49:07 +01:00
Justin M. Keyes
44ea903ca5 checkhealth: detect broken pip #9468 2019-01-13 01:48:32 +01:00
Justin M. Keyes
b4028056fa win/dist: nvim-qt v0.2.12 2019-01-13 01:27:36 +01:00
Justin M. Keyes
daad3a5a79 version bump 2019-01-04 20:09:26 +01:00
Justin M. Keyes
2ccc716c4a NVIM v0.3.3
This maintenance release fixes some issues found in v0.3.2 .

FIXES:

a597ab8d1b #9442 Merge pull request from jamessan/revert-pynvim
    d7b3ac029c health/provider: Check for available pynvim when neovim module missing
    edeb19d5e9 python#CheckForModule: Use the given module string instead of hard-coding pynvim
    0dd89cda9c {health,provider}/python: Import the neovim, rather than pynvim, module
fc6e8a4db8 #9423 TUI: Konsole DECSCUSR fixup
2019-01-04 20:05:23 +01:00
Justin M. Keyes
4e23f3e180 release.sh: Format issue-numbers in descriptions [ci skip] 2019-01-04 20:05:08 +01:00
Justin M. Keyes
8b3113ce7a release.sh: fix exclusion pattern [ci skip]
grep support of "\s" pattern is unreliable.
2019-01-04 20:05:08 +01:00
James McCoy
a597ab8d1b Merge pull request #9442 from jamessan/revert-pynvim
Rework Python provider/health check to use neovim module again
2019-01-02 12:14:29 -05:00
James McCoy
d7b3ac029c health/provider: Check for available pynvim when neovim module missing
Adapt the checks so we can still report when the pynvim module is
present but the neovim module is missing.
2019-01-01 20:38:28 -05:00
James McCoy
60e3cf6247 Merge pull request #9439 from jamessan/more-fragile-tests
Mark a few more functionaltests as fragile
2019-01-01 16:07:10 -05:00
James McCoy
edeb19d5e9 python#CheckForModule: Use the given module string instead of hard-coding pynvim 2019-01-01 16:06:37 -05:00
James McCoy
0dd89cda9c {health,provider}/python: Import the neovim, rather than pynvim, module
The neovim module is available for backwards compatibility.  We should
not yet force the use of the pynvim module, since there's no other major
reason to bump the minimum supported Python client module.

Closes #9426
2019-01-01 14:15:31 -05:00
James McCoy
fc6e8a4db8 Merge pull request #9435 from jamessan/tui-konsole
TUI: Konsole DECSCUSR fixup (#9423)
2019-01-01 13:28:05 -05:00
James McCoy
2fbe28bc05 Mark "shell command :! throttles shell-command output greater than ~10KB" fragile 2019-01-01 11:27:52 -05:00
James McCoy
b5de158fdf Mark "feeding large chunks of input with <Paste>" fragile 2019-01-01 11:27:23 -05:00
James McCoy
e53e56d5e5 Mark ":substitute with inccommand during :terminal activity" fragile 2019-01-01 11:26:56 -05:00
Justin M. Keyes
f3260129ad TUI: Konsole DECSCUSR fixup (#9423)
Apparently Konsole's terminfo is still broken.

ref #9364
closes #9420
2019-01-01 11:18:46 -05:00
James McCoy
340d853585 Merge pull request #9433 from jamessan/only-lint-master
travis: Only run lint job for master branch/PRs
2019-01-01 09:23:37 -05:00
James McCoy
57e0a578f0 travis: Only run lint job for master branch/PRs 2019-01-01 09:15:51 -05:00
James McCoy
83fca0ab13 travis: Run ci for release-* branches 2019-01-01 08:14:54 -05:00
James McCoy
fb815bd7b7 version bump 2019-01-01 08:10:13 -05:00
39 changed files with 290 additions and 176 deletions

View File

@@ -74,7 +74,8 @@ jobs:
- os: osx
compiler: gcc
osx_image: xcode9.4 # macOS 10.13
- os: linux
- if: branch = master
os: linux
env: CI_TARGET=lint
- stage: Flaky builds
os: linux
@@ -126,6 +127,7 @@ addons:
branches:
only:
- master
- /^release-\d+\.\d+$/
cache:
apt: true

View File

@@ -112,7 +112,7 @@ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY
# version string, else they are combined with the result of `git describe`.
set(NVIM_VERSION_MAJOR 0)
set(NVIM_VERSION_MINOR 3)
set(NVIM_VERSION_PATCH 2)
set(NVIM_VERSION_PATCH 5)
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
# API level

View File

@@ -192,9 +192,9 @@ function! s:version_info(python) abort
let nvim_path = s:trim(s:system([
\ a:python, '-c',
\ 'import sys; sys.path.remove(""); ' .
\ 'import pynvim; print(pynvim.__file__)']))
\ 'import neovim; print(neovim.__file__)']))
if s:shell_error || empty(nvim_path)
return [python_version, 'unable to load pynvim Python module', pypi_version,
return [python_version, 'unable to load neovim Python module', pypi_version,
\ nvim_path]
endif
@@ -206,13 +206,13 @@ function! s:version_info(python) abort
return a == b ? 0 : a > b ? 1 : -1
endfunction
" Try to get pynvim.VERSION (added in 0.1.11dev).
" Try to get neovim.VERSION (added in 0.1.11dev).
let nvim_version = s:system([a:python, '-c',
\ 'from pynvim import VERSION as v; '.
\ 'from neovim import VERSION as v; '.
\ 'print("{}.{}.{}{}".format(v.major, v.minor, v.patch, v.prerelease))'],
\ '', 1, 1)
if empty(nvim_version)
let nvim_version = 'unable to find pynvim Python module version'
let nvim_version = 'unable to find neovim Python module version'
let base = fnamemodify(nvim_path, ':h')
let metas = glob(base.'-*/METADATA', 1, 1)
\ + glob(base.'-*/PKG-INFO', 1, 1)
@@ -258,71 +258,56 @@ function! s:check_python(version) abort
call health#report_start('Python ' . a:version . ' provider (optional)')
let pyname = 'python'.(a:version == 2 ? '' : '3')
let pyenv = resolve(exepath('pyenv'))
let pyenv_root = exists('$PYENV_ROOT') ? resolve($PYENV_ROOT) : ''
let python_exe = ''
let venv = exists('$VIRTUAL_ENV') ? resolve($VIRTUAL_ENV) : ''
let host_prog_var = pyname.'_host_prog'
let loaded_var = 'g:loaded_'.pyname.'_provider'
let python_bin = ''
let python_multiple = []
if exists(loaded_var) && !exists('*provider#'.pyname.'#Call')
call health#report_info('Disabled ('.loaded_var.'='.eval(loaded_var).'). This might be due to some previous error.')
endif
if !empty(pyenv)
if empty(pyenv_root)
call health#report_info(
\ 'pyenv was found, but $PYENV_ROOT is not set. `pyenv root` will be used.'
\ .' If you run into problems, try setting $PYENV_ROOT explicitly.'
\ )
let pyenv_root = s:trim(s:system([pyenv, 'root']))
endif
if !isdirectory(pyenv_root)
call health#report_error('Invalid pyenv root: '.pyenv_root)
else
call health#report_info(printf('pyenv: %s', pyenv))
call health#report_info(printf('pyenv root: %s', pyenv_root))
endif
endif
let [pyenv, pyenv_root] = s:check_for_pyenv()
if exists('g:'.host_prog_var)
call health#report_info(printf('Using: g:%s = "%s"', host_prog_var, get(g:, host_prog_var)))
endif
let [pyname, pythonx_errs] = provider#pythonx#Detect(a:version)
let [pyname, pythonx_errors] = provider#pythonx#Detect(a:version)
if empty(pyname)
call health#report_warn('No Python interpreter was found with the pynvim '
\ . 'module. Using the first available for diagnostics.')
call health#report_warn('No Python executable found that can `import neovim`. '
\ . 'Using the first available executable for diagnostics.')
elseif exists('g:'.host_prog_var)
let python_bin = pyname
let python_exe = pyname
endif
if !empty(pythonx_errs)
call health#report_error('Python provider error', pythonx_errs)
" No Python executable could `import neovim`.
if !empty(pythonx_errors)
call health#report_error('Python provider error:', pythonx_errors)
elseif !empty(pyname) && empty(python_bin)
elseif !empty(pyname) && empty(python_exe)
if !exists('g:'.host_prog_var)
call health#report_info(printf('`g:%s` is not set. Searching for '
\ . '%s in the environment.', host_prog_var, pyname))
endif
if !empty(pyenv)
let python_bin = s:trim(s:system([pyenv, 'which', pyname], '', 1))
let python_exe = s:trim(s:system([pyenv, 'which', pyname], '', 1))
if empty(python_bin)
if empty(python_exe)
call health#report_warn(printf('pyenv could not find %s.', pyname))
endif
endif
if empty(python_bin)
let python_bin = exepath(pyname)
if empty(python_exe)
let python_exe = exepath(pyname)
if exists('$PATH')
for path in split($PATH, has('win32') ? ';' : ':')
let path_bin = s:normalize_path(path.'/'.pyname)
if path_bin != s:normalize_path(python_bin)
if path_bin != s:normalize_path(python_exe)
\ && index(python_multiple, path_bin) == -1
\ && executable(path_bin)
call add(python_multiple, path_bin)
@@ -336,8 +321,8 @@ function! s:check_python(version) abort
\ . 'Set `g:%s` to avoid surprises.', pyname, host_prog_var))
endif
if python_bin =~# '\<shims\>'
call health#report_warn(printf('`%s` appears to be a pyenv shim.', python_bin), [
if python_exe =~# '\<shims\>'
call health#report_warn(printf('`%s` appears to be a pyenv shim.', python_exe), [
\ '`pyenv` is not in $PATH, your pyenv installation is broken. '
\ .'Set `g:'.host_prog_var.'` to avoid surprises.',
\ ])
@@ -346,9 +331,9 @@ function! s:check_python(version) abort
endif
endif
if !empty(python_bin) && !exists('g:'.host_prog_var)
if !empty(python_exe) && !exists('g:'.host_prog_var)
if empty(venv) && !empty(pyenv)
\ && !empty(pyenv_root) && resolve(python_bin) !~# '^'.pyenv_root.'/'
\ && !empty(pyenv_root) && resolve(python_exe) !~# '^'.pyenv_root.'/'
call health#report_warn('pyenv is not set up optimally.', [
\ printf('Create a virtualenv specifically '
\ . 'for Neovim using pyenv, and set `g:%s`. This will avoid '
@@ -362,7 +347,7 @@ function! s:check_python(version) abort
let venv_root = fnamemodify(venv, ':h')
endif
if resolve(python_bin) !~# '^'.venv_root.'/'
if resolve(python_exe) !~# '^'.venv_root.'/'
call health#report_warn('Your virtualenv is not set up optimally.', [
\ printf('Create a virtualenv specifically '
\ . 'for Neovim and use `g:%s`. This will avoid '
@@ -373,16 +358,16 @@ function! s:check_python(version) abort
endif
endif
if empty(python_bin) && !empty(pyname)
if empty(python_exe) && !empty(pyname)
" An error message should have already printed.
call health#report_error(printf('`%s` was not found.', pyname))
elseif !empty(python_bin) && !s:check_bin(python_bin)
let python_bin = ''
elseif !empty(python_exe) && !s:check_bin(python_exe)
let python_exe = ''
endif
" Check if $VIRTUAL_ENV is valid.
if exists('$VIRTUAL_ENV') && !empty(python_bin)
if $VIRTUAL_ENV ==# matchstr(python_bin, '^\V'.$VIRTUAL_ENV)
if exists('$VIRTUAL_ENV') && !empty(python_exe)
if $VIRTUAL_ENV ==# matchstr(python_exe, '^\V'.$VIRTUAL_ENV)
call health#report_info('$VIRTUAL_ENV matches executable')
else
call health#report_warn(
@@ -393,7 +378,7 @@ function! s:check_python(version) abort
endif
" Diagnostic output
call health#report_info('Executable: ' . (empty(python_bin) ? 'Not found' : python_bin))
call health#report_info('Executable: ' . (empty(python_exe) ? 'Not found' : python_exe))
if len(python_multiple)
for path_bin in python_multiple
call health#report_info('Other python executable: ' . path_bin)
@@ -402,30 +387,39 @@ function! s:check_python(version) abort
let pip = 'pip' . (a:version == 2 ? '' : '3')
if !empty(python_bin)
let [pyversion, current, latest, status] = s:version_info(python_bin)
if empty(python_exe)
" No Python executable can import 'neovim'. Check if any Python executable
" can import 'pynvim'. If so, that Python failed to import 'neovim' as
" well, which is most probably due to a failed pip upgrade:
" https://github.com/neovim/neovim/wiki/Following-HEAD#20181118
let [pynvim_exe, errors] = provider#pythonx#DetectByModule('pynvim', a:version)
if !empty(pynvim_exe)
call health#report_error(
\ 'Detected pip upgrade failure: Python executable can import "pynvim" but '
\ . 'not "neovim": '. pynvim_exe,
\ "Use that Python version to reinstall \"pynvim\" and optionally \"neovim\".\n"
\ . pip ." uninstall pynvim neovim\n"
\ . pip ." install pynvim\n"
\ . pip ." install neovim # only if needed by third-party software")
endif
else
let [pyversion, current, latest, status] = s:version_info(python_exe)
if a:version != str2nr(pyversion)
call health#report_warn('Unexpected Python version.' .
\ ' This could lead to confusing error messages.')
endif
if a:version == 3 && str2float(pyversion) < 3.3
call health#report_warn('Python 3.3+ is recommended.')
endif
call health#report_info('Python version: ' . pyversion)
if s:is_bad_response(status)
call health#report_info(printf('pynvim version: %s (%s)', current, status))
else
call health#report_info(printf('pynvim version: %s', current))
let [module_found, _msg] = provider#pythonx#CheckForModule(python_bin,
\ 'neovim', a:version)
if !module_found
call health#report_error('Importing "neovim" failed.',
\ "Reinstall \"pynvim\" and optionally \"neovim\" packages.\n" .
\ pip ." uninstall pynvim neovim\n" .
\ pip ." install pynvim\n" .
\ pip ." install neovim # only if needed by third-party software")
endif
endif
if s:is_bad_response(current)
@@ -443,7 +437,37 @@ function! s:check_python(version) abort
call health#report_ok(printf('Latest pynvim is installed.'))
endif
endif
endfunction
" Check if pyenv is available and a valid pyenv root can be found, then return
" their respective paths. If either of those is invalid, return two empty
" strings, effectivly ignoring pyenv.
function! s:check_for_pyenv() abort
let pyenv_path = resolve(exepath('pyenv'))
if empty(pyenv_path)
return ['', '']
endif
call health#report_info('pyenv: Path: '. pyenv_path)
let pyenv_root = exists('$PYENV_ROOT') ? resolve($PYENV_ROOT) : ''
if empty(pyenv_root)
let pyenv_root = s:trim(s:system([pyenv_path, 'root']))
call health#report_info('pyenv: $PYENV_ROOT is not set. Infer from `pyenv root`.')
endif
if !isdirectory(pyenv_root)
call health#report_warn(
\ printf('pyenv: Root does not exist: %s. '
\ . 'Ignoring pyenv for all following checks.', pyenv_root))
return ['', '']
endif
call health#report_info('pyenv: Root: '.pyenv_root)
return [pyenv_path, pyenv_root]
endfunction
function! s:check_ruby() abort

View File

@@ -10,7 +10,7 @@ function! provider#pythonx#Require(host) abort
" Python host arguments
let prog = (ver == '2' ? provider#python#Prog() : provider#python3#Prog())
let args = [prog, '-c', 'import sys; sys.path.remove(""); import pynvim; pynvim.start_host()']
let args = [prog, '-c', 'import sys; sys.path.remove(""); import neovim; neovim.start_host()']
" Collect registered Python plugins into args
let python_plugins = remote#host#PluginsForHost(a:host.name)
@@ -21,37 +21,45 @@ function! provider#pythonx#Require(host) abort
return provider#Poll(args, a:host.orig_name, '$NVIM_PYTHON_LOG_FILE')
endfunction
function! provider#pythonx#Detect(major_ver) abort
if a:major_ver == 2
if exists('g:python_host_prog')
return [expand(g:python_host_prog), '']
else
let progs = ['python2', 'python2.7', 'python2.6', 'python']
endif
else
if exists('g:python3_host_prog')
return [expand(g:python3_host_prog), '']
else
let progs = ['python3', 'python3.7', 'python3.6', 'python3.5',
\ 'python3.4', 'python3.3', 'python']
endif
function! s:get_python_executable_from_host_var(major_version) abort
return expand(get(g:, 'python'.(a:major_version == 3 ? '3' : '').'_host_prog', ''))
endfunction
function! s:get_python_candidates(major_version) abort
return {
\ 2: ['python2', 'python2.7', 'python2.6', 'python'],
\ 3: ['python3', 'python3.7', 'python3.6', 'python3.5', 'python3.4', 'python3.3',
\ 'python']
\ }[a:major_version]
endfunction
" Returns [path_to_python_executable, error_message]
function! provider#pythonx#Detect(major_version) abort
return provider#pythonx#DetectByModule('neovim', a:major_version)
endfunction
" Returns [path_to_python_executable, error_message]
function! provider#pythonx#DetectByModule(module, major_version) abort
let python_exe = s:get_python_executable_from_host_var(a:major_version)
if !empty(python_exe)
return [python_exe, '']
endif
let candidates = s:get_python_candidates(a:major_version)
let errors = []
for prog in progs
let [result, err] = provider#pythonx#CheckForModule(prog, 'pynvim', a:major_ver)
for exe in candidates
let [result, error] = provider#pythonx#CheckForModule(exe, a:module, a:major_version)
if result
return [prog, err]
return [exe, error]
endif
" Accumulate errors in case we don't find
" any suitable Python interpreter.
call add(errors, err)
" Accumulate errors in case we don't find any suitable Python executable.
call add(errors, error)
endfor
" No suitable Python interpreter found.
return ['', 'provider/pythonx: Could not load Python ' . a:major_ver
\ . ":\n" . join(errors, "\n")]
" No suitable Python executable found.
return ['', 'provider/pythonx: Could not load Python '.a:major_version.":\n".join(errors, "\n")]
endfunction
" Returns array: [prog_exitcode, prog_version]
@@ -75,12 +83,12 @@ function! provider#pythonx#CheckForModule(prog, module, major_version) abort
let min_version = (a:major_version == 2) ? '2.6' : '3.3'
" Try to load pynvim module, and output Python version.
" Try to load module, and output Python version.
" Exit codes:
" 0 pynvim module can be loaded.
" 2 pynvim module cannot be loaded.
" 0 module can be loaded.
" 2 module cannot be loaded.
" Otherwise something else went wrong (e.g. 1 or 127).
let [prog_exitcode, prog_version] = s:import_module(a:prog, 'pynvim')
let [prog_exitcode, prog_version] = s:import_module(a:prog, a:module)
if prog_exitcode == 2 || prog_exitcode == 0
" Check version only for expected return codes.
@@ -94,7 +102,7 @@ function! provider#pythonx#CheckForModule(prog, module, major_version) abort
endif
if prog_exitcode == 2
return [0, prog_path.' does not have the "pynvim" module. :help provider-python']
return [0, prog_path.' does not have the "' . a:module . '" module. :help provider-python']
elseif prog_exitcode == 127
" This can happen with pyenv's shims.
return [0, prog_path . ' does not exist: ' . prog_version]

View File

@@ -24,29 +24,34 @@ Nvim supports Python |remote-plugin|s and the Vim legacy |python2| and
|python3| interfaces (which are implemented as remote-plugins).
Note: Only the Vim 7.3 API is supported; bindeval (Vim 7.4) is not.
PYTHON QUICKSTART ~
Install the "pynvim" Python package:
To use Python plugins, you need the "pynvim" module. Run |:checkhealth| to see
if you already have it (some package managers install the module with Nvim
itself).
- Run |:checkhealth| to see if you already have the package (some package
managers install the "pynvim" Python package with Nvim itself).
For Python 3 plugins:
1. Make sure Python 3.4+ is available in your $PATH.
2. Install the module (try "pip" if "pip3" is missing): >
pip3 install --user --upgrade pynvim
- For Python 2 plugins, make sure Python 2.7 is available in your $PATH, then
install the package systemwide: >
sudo pip2 install --upgrade pynvim
< or for the current user: >
pip2 install --user --upgrade pynvim
< If "pip2" is missing, try "pip".
For Python 2 plugins:
1. Make sure Python 2.7 is available in your $PATH.
2. Install the module (try "pip" if "pip2" is missing): >
pip2 install --user --upgrade pynvim
- For Python 3 plugins, make sure Python 3.4+ is available in your $PATH, then
install the package systemwide: >
sudo pip3 install --upgrade pynvim
< or for the current user: >
pip3 install --user --upgrade pynvim
< If "pip3" is missing, try "pip".
The pip `--upgrade` flag ensures that you get the latest version even if
a previous version was already installed.
See also |python-virtualenv|.
Note: The old "neovim" module was renamed to "pynvim".
https://github.com/neovim/neovim/wiki/Following-HEAD#20181118
If you run into problems, uninstall _both_ then install "pynvim" again: >
pip uninstall neovim pynvim
pip install pynvim
- The `--upgrade` flag ensures you have the latest version even if a previous
version was already installed.
PYTHON PROVIDER CONFIGURATION ~
*g:python_host_prog*
@@ -67,8 +72,9 @@ To disable Python 2 support: >
To disable Python 3 support: >
let g:loaded_python3_provider = 1
PYTHON VIRTUALENVS ~
PYTHON VIRTUALENVS ~
*python-virtualenv*
If you plan to use per-project virtualenvs often, you should assign one
virtualenv for Neovim and hard-code the interpreter path via
|g:python3_host_prog| (or |g:python_host_prog|) so that the "pynvim" package
@@ -91,6 +97,7 @@ Ruby integration *provider-ruby*
Nvim supports Ruby |remote-plugin|s and the Vim legacy |ruby-vim| interface
(which is itself implemented as a Nvim remote-plugin).
RUBY QUICKSTART ~
To use Ruby plugins with Nvim, install the latest "neovim" RubyGem: >
@@ -98,6 +105,7 @@ To use Ruby plugins with Nvim, install the latest "neovim" RubyGem: >
Run |:checkhealth| to see if your system is up-to-date.
RUBY PROVIDER CONFIGURATION ~
*g:loaded_ruby_provider*
To disable Ruby support: >
@@ -120,6 +128,7 @@ Node.js integration *provider-nodejs*
Nvim supports Node.js |remote-plugin|s.
https://github.com/neovim/node-client/
NODEJS QUICKSTART~
To use javascript remote-plugins with Nvim, install the "neovim" npm package: >
@@ -127,6 +136,7 @@ To use javascript remote-plugins with Nvim, install the "neovim" npm package: >
Run |:checkhealth| to see if your system is up-to-date.
NODEJS PROVIDER CONFIGURATION~
*g:loaded_node_provider*
To disable Node.js support: >

View File

@@ -1,6 +1,8 @@
#!/usr/bin/env bash
# Shows a log with changes grouped next to their merge-commit.
# Prints a nicely-formatted commit history.
# - Commits are grouped below their merge-commit.
# - Issue numbers are moved next to the commit-id.
#
# Parameters:
# $1 "since" commit
@@ -19,14 +21,32 @@ is_merge_commit() {
git log $1^2 >/dev/null 2>&1 && return 0 || return 1
}
# Removes parens from issue/ticket/PR numbers.
#
# Example:
# in: 3340e08becbf foo (#9423)
# out: 3340e08becbf foo #9423
_deparen() {
sed 's/(\(\#[0-9]\{3,\}\))/\1/g'
}
# Cleans up issue/ticket/PR numbers in the commit descriptions.
#
# Example:
# in: 3340e08becbf foo (#9423)
# out: 3340e08becbf #9423 foo
_format_ticketnums() {
nvim -Es +'g/\v(#[0-9]{3,})/norm! ngEldE0ep' +'%p' | _deparen
}
for commit in $(git log --format='%H' --first-parent "$__SINCE"..HEAD); do
if is_merge_commit ${commit} ; then
if [ -z "$__INVMATCH" ] || ! git log --oneline ${commit}^1..${commit}^2 \
| grep -E "$__INVMATCH" >/dev/null 2>&1 ; then
| >/dev/null 2>&1 grep -E "$__INVMATCH" ; then
git log -1 --oneline ${commit}
git log --format=' %h %s' ${commit}^1..${commit}^2
fi
else
git log -1 --oneline ${commit}
fi
done
done | _format_ticketnums

View File

@@ -67,7 +67,7 @@ _do_release_commit() {
if ! test "$ARG1" = '--use-current-commit' ; then
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:[^[:space:]]')"
git add CMakeLists.txt
git commit --edit -m "${__RELEASE_MSG} ${__CHANGELOG}"

View File

@@ -594,7 +594,7 @@ void nvim_set_current_dir(String dir, Error *err)
return;
}
post_chdir(kCdScopeGlobal);
post_chdir(kCdScopeGlobal, true);
try_end(err);
}

View File

@@ -1559,6 +1559,7 @@ void do_autochdir(void)
if (starting == 0
&& curbuf->b_ffname != NULL
&& vim_chdirfile(curbuf->b_ffname) == OK) {
post_chdir(kCdScopeGlobal, false);
shorten_fnames(true);
}
}

View File

@@ -22683,6 +22683,16 @@ static void script_host_eval(char *name, typval_T *argvars, typval_T *rettv)
typval_T eval_call_provider(char *provider, char *method, list_T *arguments)
{
if (!eval_has_provider(provider)) {
emsgf("E319: No \"%s\" provider found. Run \":checkhealth provider\"",
provider);
return (typval_T){
.v_type = VAR_NUMBER,
.v_lock = VAR_UNLOCKED,
.vval.v_number = (varnumber_T)0
};
}
char func[256];
int name_len = snprintf(func, sizeof(func), "provider#%s#Call", provider);

View File

@@ -3908,12 +3908,7 @@ static void script_host_execute(char *name, exarg_T *eap)
tv_list_append_number(args, (int)eap->line1);
tv_list_append_number(args, (int)eap->line2);
if (!eval_has_provider(name)) {
emsgf("E319: No \"%s\" provider found. Run \":checkhealth provider\"",
name);
} else {
(void)eval_call_provider(name, "execute", args);
}
(void)eval_call_provider(name, "execute", args);
}
}

View File

@@ -7218,7 +7218,7 @@ void free_cd_dir(void)
/// Deal with the side effects of changing the current directory.
///
/// @param scope Scope of the function call (global, tab or window).
void post_chdir(CdScope scope)
void post_chdir(CdScope scope, bool trigger_dirchanged)
{
// Always overwrite the window-local CWD.
xfree(curwin->w_localdir);
@@ -7258,7 +7258,10 @@ void post_chdir(CdScope scope)
}
shorten_fnames(true);
do_autocmd_dirchanged(cwd, scope);
if (trigger_dirchanged) {
do_autocmd_dirchanged(cwd, scope);
}
}
/// `:cd`, `:tcd`, `:lcd`, `:chdir`, `:tchdir` and `:lchdir`.
@@ -7320,7 +7323,7 @@ void ex_cd(exarg_T *eap)
if (vim_chdir(new_dir, scope)) {
EMSG(_(e_failed));
} else {
post_chdir(scope);
post_chdir(scope, true);
// Echo the new current directory if the command was typed.
if (KeyTyped || p_verbose >= 5) {
ex_pwd(eap);

View File

@@ -76,7 +76,8 @@
/// @param flags Flags for open() call.
///
/// @return The open memory file.
/// @return - The open memory file, on success.
/// - NULL, on failure (e.g. file does not exist).
memfile_T *mf_open(char_u *fname, int flags)
{
memfile_T *mfp = xmalloc(sizeof(memfile_T));

View File

@@ -277,6 +277,9 @@ int ml_open(buf_T *buf)
// Open the memfile. No swap file is created yet.
memfile_T *mfp = mf_open(NULL, 0);
if (mfp == NULL) {
goto error;
}
buf->b_ml.ml_mfp = mfp;
buf->b_ml.ml_flags = ML_EMPTY;
@@ -360,10 +363,12 @@ int ml_open(buf_T *buf)
return OK;
error:
if (hp) {
mf_put(mfp, hp, false, false);
if (mfp != NULL) {
if (hp) {
mf_put(mfp, hp, false, false);
}
mf_close(mfp, true); // will also xfree(mfp->mf_fname)
}
mf_close(mfp, true); // will also xfree(mfp->mf_fname)
buf->b_ml.ml_mfp = NULL;
return FAIL;
}
@@ -839,7 +844,7 @@ void ml_recover(void)
mf_open() will consume "fname_used"! */
mfp = mf_open(fname_used, O_RDONLY);
fname_used = p;
if (mfp->mf_fd < 0) {
if (mfp == NULL || mfp->mf_fd < 0) {
EMSG2(_("E306: Cannot open %s"), fname_used);
goto theend;
}

View File

@@ -306,6 +306,15 @@ static char *(p_cot_values[]) = { "menu", "menuone", "longest", "preview",
static char *(p_icm_values[]) = { "nosplit", "split", NULL };
static char *(p_scl_values[]) = { "yes", "no", "auto", NULL };
/// All possible flags for 'shm'.
static char_u SHM_ALL[] = {
SHM_RO, SHM_MOD, SHM_FILE, SHM_LAST, SHM_TEXT, SHM_LINES, SHM_NEW, SHM_WRI,
SHM_ABBREVIATIONS, SHM_WRITE, SHM_TRUNC, SHM_TRUNCALL, SHM_OVER,
SHM_OVERALL, SHM_SEARCH, SHM_ATTENTION, SHM_INTRO, SHM_COMPLETIONMENU,
SHM_RECORDING, SHM_FILEINFO,
0,
};
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "option.c.generated.h"
#endif
@@ -2417,11 +2426,6 @@ static bool valid_filetype(char_u *val)
return true;
}
#ifdef _MSC_VER
// MSVC optimizations are disabled for this function because it
// incorrectly generates an empty string for SHM_ALL.
#pragma optimize("", off)
#endif
/*
* Handle string options that need some action to perform when changed.
* Returns NULL for success, or an error message for an error.
@@ -3311,9 +3315,6 @@ did_set_string_option (
return errmsg;
}
#ifdef _MSC_VER
#pragma optimize("", on)
#endif
/*
* Simple int comparison function for use with qsort()

View File

@@ -178,14 +178,6 @@ enum {
SHM_RO, SHM_MOD, SHM_FILE, SHM_LAST, SHM_TEXT, SHM_LINES, SHM_NEW, SHM_WRI, \
0, \
})
/// All possible flags for 'shm'.
#define SHM_ALL ((char_u[]) { \
SHM_RO, SHM_MOD, SHM_FILE, SHM_LAST, SHM_TEXT, SHM_LINES, SHM_NEW, SHM_WRI, \
SHM_ABBREVIATIONS, SHM_WRITE, SHM_TRUNC, SHM_TRUNCALL, SHM_OVER, \
SHM_OVERALL, SHM_SEARCH, SHM_ATTENTION, SHM_INTRO, SHM_COMPLETIONMENU, \
SHM_RECORDING, SHM_FILEINFO, \
0, \
})
/* characters for p_go: */
#define GO_ASEL 'a' /* autoselect */

View File

@@ -4920,7 +4920,7 @@ regmatch (
}
} else {
const char_u *const line =
reg_getline(behind_pos.rs_u.pos.lnum);
reg_getline(rp->rs_un.regsave.rs_u.pos.lnum);
rp->rs_un.regsave.rs_u.pos.col -=
utf_head_off(line,

View File

@@ -5338,10 +5338,11 @@ void screen_puts_len(char_u *text, int textlen, int row, int col, int attr)
schar_from_ascii(ScreenLines[off - 1], ' ');
ScreenAttrs[off - 1] = 0;
// redraw the previous cell, make it empty
if (put_dirty_first == -1) {
if (put_dirty_first == -1 || col-1 < put_dirty_first) {
put_dirty_first = col-1;
}
put_dirty_last = col+1;
put_dirty_last = MAX(put_dirty_last, col+1);
// force the cell at "col" to be redrawn
force_redraw_next = true;
}
@@ -5422,10 +5423,10 @@ void screen_puts_len(char_u *text, int textlen, int row, int col, int attr)
ScreenLines[off + 1][0] = 0;
ScreenAttrs[off + 1] = attr;
}
if (put_dirty_first == -1) {
if (put_dirty_first == -1 || col < put_dirty_first) {
put_dirty_first = col;
}
put_dirty_last = col+mbyte_cells;
put_dirty_last = MAX(put_dirty_last, col+mbyte_cells);
}
off += mbyte_cells;

View File

@@ -2510,7 +2510,7 @@ buf_T *open_spellbuf(void)
buf->b_spell = true;
buf->b_p_swf = true; // may create a swap file
if (ml_open(buf) == FAIL) {
abort();
ELOG("Error opening a new memline");
}
ml_open_file(buf); // create swap file now

View File

@@ -1304,8 +1304,6 @@ static void redraw(bool restore_cursor)
static void adjust_topline(Terminal *term, buf_T *buf, long added)
{
int height, width;
vterm_get_size(term->vt, &height, &width);
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
if (wp->w_buffer == buf) {
linenr_T ml_end = buf->b_ml.ml_line_count;
@@ -1314,7 +1312,7 @@ static void adjust_topline(Terminal *term, buf_T *buf, long added)
if (following || (wp == curwin && is_focused(term))) {
// "Follow" the terminal output
wp->w_cursor.lnum = ml_end;
set_topline(wp, MAX(wp->w_cursor.lnum - height + 1, 1));
set_topline(wp, MAX(wp->w_cursor.lnum - wp->w_height + 1, 1));
} else {
// Ensure valid cursor for each window displaying this terminal.
wp->w_cursor.lnum = MIN(wp->w_cursor.lnum, ml_end);

View File

@@ -1675,8 +1675,7 @@ static void patch_terminfo_bugs(TUIData *data, const char *term,
}
// Blacklist of terminals that cannot be trusted to report DECSCUSR support.
if (!(st || (vte_version != 0 && vte_version < 3900)
|| (konsolev > 0 && konsolev < 180770))) {
if (!(st || (vte_version != 0 && vte_version < 3900) || konsolev)) {
data->unibi_ext.reset_cursor_style = unibi_find_ext_str(ut, "Se");
data->unibi_ext.set_cursor_style = unibi_find_ext_str(ut, "Ss");
}

View File

@@ -286,6 +286,15 @@ describe("getcwd()", function ()
command("call delete('../"..directories.global.."', 'd')")
eq("", helpers.eval("getcwd()"))
end)
it("works with 'autochdir' after local directory was set (#9892)", function()
local curdir = cwd()
command('lcd ' .. directories.global)
command('lcd -')
command('set autochdir')
command('edit ' .. directories.global .. '/foo')
eq(curdir .. pathsep .. directories.global, cwd())
end)
end)

View File

@@ -1,10 +1,11 @@
local Screen = require('test.functional.ui.screen')
local helpers = require('test.functional.helpers')(after_each)
local lfs = require('lfs')
local feed_command, eq, eval, expect, source =
helpers.feed_command, helpers.eq, helpers.eval, helpers.expect, helpers.source
local eq, eval, expect, source =
helpers.eq, helpers.eval, helpers.expect, helpers.source
local clear = helpers.clear
local command = helpers.command
local expect_err = helpers.expect_err
local feed = helpers.feed
local nvim_prog = helpers.nvim_prog
local ok = helpers.ok
@@ -17,9 +18,14 @@ describe(':recover', function()
before_each(clear)
it('fails if given a non-existent swapfile', function()
local swapname = 'bogus-swapfile'
feed_command('recover '..swapname) -- This should not segfault. #2117
eq('E305: No swap file found for '..swapname, eval('v:errmsg'))
local swapname = 'bogus_swapfile'
local swapname2 = 'bogus_swapfile.swp'
expect_err('E305: No swap file found for '..swapname,
command, 'recover '..swapname) -- Should not segfault. #2117
-- Also check filename ending with ".swp". #9504
expect_err('Vim%(recover%):E306: Cannot open '..swapname2,
command, 'recover '..swapname2) -- Should not segfault. #2117
eq(2, eval('1+1')) -- Still alive?
end)
end)

View File

@@ -11,8 +11,9 @@ do
clear()
if missing_provider('python3') then
it(':python3 reports E319 if provider is missing', function()
expect_err([[Vim%(python3%):E319: No "python3" provider found.*]],
command, 'python3 print("foo")')
local expected = [[Vim%(py3.*%):E319: No "python3" provider found.*]]
expect_err(expected, command, 'py3 print("foo")')
expect_err(expected, command, 'py3file foo')
end)
pending('Python 3 (or the pynvim module) is broken/missing', function() end)
return

View File

@@ -19,8 +19,9 @@ do
clear()
if missing_provider('python') then
it(':python reports E319 if provider is missing', function()
expect_err([[Vim%(python%):E319: No "python" provider found.*]],
command, 'python print("foo")')
local expected = [[Vim%(py.*%):E319: No "python" provider found.*]]
expect_err(expected, command, 'py print("foo")')
expect_err(expected, command, 'pyfile foo')
end)
pending('Python 2 (or the pynvim module) is broken/missing', function() end)
return

View File

@@ -19,8 +19,9 @@ do
clear()
if missing_provider('ruby') then
it(':ruby reports E319 if provider is missing', function()
expect_err([[Vim%(ruby%):E319: No "ruby" provider found.*]],
command, 'ruby puts "foo"')
local expected = [[Vim%(ruby.*%):E319: No "ruby" provider found.*]]
expect_err(expected, command, 'ruby puts "foo"')
expect_err(expected, command, 'rubyfile foo')
end)
pending("Missing neovim RubyGem.", function() end)
return

View File

@@ -8,7 +8,7 @@ local exit_altscreen = thelpers.exit_altscreen
if helpers.pending_win32(pending) then return end
describe('terminal altscreen', function()
describe(':terminal altscreen', function()
local screen
before_each(function()

View File

@@ -6,7 +6,7 @@ local eval, feed_command, source = helpers.eval, helpers.feed_command, helpers.s
local eq, neq = helpers.eq, helpers.neq
local write_file = helpers.write_file
describe('terminal buffer', function()
describe(':terminal buffer', function()
local screen
before_each(function()

View File

@@ -7,7 +7,7 @@ local feed_command = helpers.feed_command
local hide_cursor = thelpers.hide_cursor
local show_cursor = thelpers.show_cursor
describe('terminal cursor', function()
describe(':terminal cursor', function()
local screen
before_each(function()

View File

@@ -5,7 +5,7 @@ local feed, clear, nvim = helpers.feed, helpers.clear, helpers.nvim
local nvim_dir, command = helpers.nvim_dir, helpers.command
local eq, eval = helpers.eq, helpers.eval
describe('terminal window highlighting', function()
describe(':terminal window highlighting', function()
local screen
before_each(function()

View File

@@ -4,7 +4,7 @@ local clear, eq, eval = helpers.clear, helpers.eq, helpers.eval
local feed, nvim = helpers.feed, helpers.nvim
local feed_data = thelpers.feed_data
describe('terminal mouse', function()
describe(':terminal mouse', function()
local screen
before_each(function()

View File

@@ -12,7 +12,7 @@ local curbufmeths = helpers.curbufmeths
local nvim = helpers.nvim
local feed_data = thelpers.feed_data
describe('terminal scrollback', function()
describe(':terminal scrollback', function()
local screen
before_each(function()
@@ -344,7 +344,7 @@ describe('terminal scrollback', function()
end)
end)
describe('terminal prints more lines than the screen height and exits', function()
describe(':terminal prints more lines than the screen height and exits', function()
it('will push extra lines to scrollback', function()
clear()
local screen = Screen.new(30, 7)
@@ -460,7 +460,7 @@ describe("'scrollback' option", function()
screen:detach()
end)
it('defaults to 10000 in terminal buffers', function()
it('defaults to 10000 in :terminal buffers', function()
set_fake_shell()
command('terminal')
eq(10000, curbufmeths.get_option('scrollback'))

View File

@@ -20,7 +20,7 @@ local read_file = helpers.read_file
if helpers.pending_win32(pending) then return end
describe('tui', function()
describe('TUI', function()
local screen
before_each(function()

View File

@@ -3,8 +3,12 @@ local thelpers = require('test.functional.terminal.helpers')
local feed, clear = helpers.feed, helpers.clear
local wait = helpers.wait
local iswin = helpers.iswin
local command = helpers.command
local retry = helpers.retry
local eq = helpers.eq
local eval = helpers.eval
describe('terminal window', function()
describe(':terminal window', function()
local screen
before_each(function()
@@ -12,6 +16,19 @@ describe('terminal window', function()
screen = thelpers.screen_setup()
end)
it('sets topline correctly #8556', function()
-- Test has hardcoded assumptions of dimensions.
eq(7, eval('&lines'))
command('set shell=sh')
command('terminal')
retry(nil, nil, function() assert(nil ~= eval('b:terminal_job_pid')) end)
-- Terminal/shell contents must exceed the height of this window.
command('topleft 1split')
feed([[i<cr>]])
-- Check topline _while_ in terminal-mode.
retry(nil, nil, function() eq(6, eval('winsaveview()["topline"]')) end)
end)
describe("with 'number'", function()
it('wraps text', function()
feed([[<C-\><C-N>]])

View File

@@ -9,7 +9,7 @@ local eval = helpers.eval
local iswin = helpers.iswin
local retry = helpers.retry
describe('terminal', function()
describe(':terminal', function()
local screen
before_each(function()

View File

@@ -2512,6 +2512,9 @@ describe(":substitute", function()
end)
it(':substitute with inccommand during :terminal activity', function()
if helpers.skip_fragile(pending) then
return
end
retry(2, 40000, function()
local screen = Screen.new(30,15)
clear()

View File

@@ -61,6 +61,9 @@ describe('feeding large chunks of input with <Paste>', function()
end)
it('ok', function()
if helpers.skip_fragile(pending) then
return
end
local t = {}
for i = 1, 20000 do
t[i] = 'item ' .. tostring(i)

View File

@@ -51,6 +51,9 @@ describe("shell command :!", function()
end)
it("throttles shell-command output greater than ~10KB", function()
if helpers.skip_fragile(pending) then
return
end
child_session.feed_data(
":!for i in $(seq 2 30000); do echo XXXXXXXXXX $i; done\n")

View File

@@ -163,8 +163,8 @@ set(GPERF_SHA256 588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae
set(WINTOOLS_URL https://github.com/neovim/deps/raw/2f9acbecf06365c10baa3c0087f34a54c9c6f949/opt/win32tools.zip)
set(WINTOOLS_SHA256 8bfce7e3a365721a027ce842f2ec1cf878f1726233c215c05964aac07300798c)
set(WINGUI_URL https://github.com/equalsraf/neovim-qt/releases/download/v0.2.11/neovim-qt.zip)
set(WINGUI_SHA256 b7add4b14561a2d8f55d3bbffb1d887209e4f26f837836639c2efeaaed9fa04e)
set(WINGUI_URL https://github.com/equalsraf/neovim-qt/releases/download/v0.2.12/neovim-qt.zip)
set(WINGUI_SHA256 68f8d7d46e21c94ac24577bc65d378c5f622794d11d34950e41edc1b0335560c)
set(WIN32YANK_X86_URL https://github.com/equalsraf/win32yank/releases/download/v0.0.4/win32yank-x86.zip)
set(WIN32YANK_X86_SHA256 62f34e5a46c5d4a7b3f3b512e1ff7b77fedd432f42581cbe825233a996eed62c)