When rbenv is used for managing Ruby installations, just checking for an
executable called "neovim-ruby-host" is not enough. It has to be run as well.
If it does not return 0, then neovim-ruby-host is merely a shim for another Ruby
installation.
$ rbenv versions
2.5.0
* 2.5.1 (set by /Users/mhi/.rbenv/version)
$ rbenv whence neovim-ruby-host
2.5.0
$ which neovim-ruby-host
/Users/mhi/.rbenv/shims/neovim-ruby-host
$ neovim-ruby-host
rbenv: neovim-ruby-host: command not found
The `neovim-ruby-host' command exists in these Ruby versions:
2.5.0
$ echo $?
127
Additionally, the detection logic was moved from provider#ruby#Detect() to
s:detect(), because the former is run in the sandbox which forbids calling
system().
This would need to get `expand`ed to not become empty, and is being
handled by s:check_bin already.
`s:check_bin` will also complain about e.g.
"~/.pyenv/versions/3.6.6/bin/python" not being executable, but that
reflects that the host will fail to start with it.
Fixes#8778
Compare `$VIRTUAL_ENV` to `python_bin`.
This is necessary when `g:python_host_prog` is set to an absolute path,
and looking up `pyname` in `$PATH` yields another result.
OpenBSD's man returns all candidates when searching with -w instead of
the first one it finds. So this patch takes the first one if multiple
entries are found.
closes#8372closes#8341
Remove "" from sys.path (typically the first entry), which could cause
e.g. "logging" to be added from the current directory.
This gets done already for loading the host in
runtime/autoload/provider/pythonx.vim.
Problem: Loading file type detection slows down startup.
Solution: Move functions to an autoload script.
851ee6c3da
---
vim-patch:8.0.0635
Problem: When 'ignorecase' is set script detection is inaccurate.
Solution: Enforce matching case for text. (closes#1753)
I have `g:python3_host_prog` set to the system Python, where a package
is also installed to provide the "neovim" module.
`:checkhealth provider` however displays a warning for this:
> Your virtualenv is not set up optimally.
This is because /usr/bin/python is not in /home/user/.pyenv.
I think this warning should not get displayed if host_prog_var exists.
It goes back to the initial commit (20447ba09), and is maybe only
missing the `!` there as with the previous commit.
Full output:
```
- INFO: pyenv: /home/user/.pyenv/libexec/pyenv
- INFO: pyenv root: /home/user/.pyenv
- INFO: Using: g:python3_host_prog = "/usr/bin/python"
- WARNING: Your virtualenv is not set up optimally (/usr/bin/python is not in /home/user/.pyenv).
- ADVICE:
- Create a virtualenv specifically for Neovim and use `g:python3_host_prog`. This will avoid the need to install Neovim's Python module in each virtualenv.
- WARNING: $VIRTUAL_ENV exists but appears to be inactive. This could lead to unexpected results.
- ADVICE:
- If you are using Zsh, see: http://vi.stackexchange.com/a/7654
- INFO: Executable: /usr/bin/python
- INFO: Python3 version: 3.6.4
- INFO: python-neovim version: 0.2.1
- OK: Latest python-neovim is installed: 0.2.1
```
`g:loaded_python3_provider` gets set when the autoload file is sourced,
but this might error out, e.g. with deoplete:
[deoplete] Failed to load python3 host. You can try to see what happened by starting nvim with $NVIM_PYTHON_LOG_FILE set and opening the generated log file. Also, the host stderr is available in messages.
[deoplete] function remote#define#FunctionBootstrap[1]..remote#host#Require[10]..provider#pythonx#Require[13]..provider#Poll, line 14
[deoplete] deoplete requires Python3 support("+python3").
[deoplete] deoplete failed to load. Try the :UpdateRemotePlugins command and restart Neovim. See also :checkhealth.
It refers to `:checkhealth` from there explicitly, which would then
(without this patch) say that Python 3 is disabled.
This patch changes the reported info to include that it might have been
disabled due to some error, and keeps on going.
If `jobstart()` fails, then the subsequent `rpcrequest()` will throw due
to an invalid channel id. This causes `job.stderr` not to exist, so we
throw another exception when trying to dump the job's stderr.
Error detected while processing function remote#define#AutocmdBootstrap[1]..remote#host#Require[10]..provider#pythonx#Require:
line 22:
E716: Key not present in Dictionary: stderr
This obfuscates the actual problem.
On some versions of macOS, pbcopy doesn't work in tmux <2.6
https://superuser.com/q/231130
Fallback to tmux in that case.
Add a healthcheck for this scenario.
The argument expansion for :Man depends on the number of arguments given to it
starting at the command itself. But user completion functions always provide the
entire command-line which can include modifier commands like :tab, :vert, etc.
leading to a wrong number of arguments.
Prune all arguments up to :Man.
Fixes#7872.
For back-compat, :CheckHealth runs :checkhealth. But don't define
:CheckHealth explicitly, it adds noise to wildmenu completion.
Completion of healthchecks doesn't yet work with :checkhealth, this is
a regression but it needs to be implemented for :checkhealth rather than
keeping :CheckHealth around.
vim-patch:8.0.1206: no autocmd for entering or leaving the command line
(commit a4f6cec7a3)
NA patches:
vim-patch:8.0.0320: warning for unused variable with small build
ci: install nodejs 8 in Appveyor, Travis
provider: check node version for debug support
Resolve https://github.com/neovim/neovim/pull/7577#issuecomment-350590592 for Unix.
provider: test if nodejs in ci supports --inspect-brk
nodejs host for neovim requires nodejs 6+ to work properly.
nodejs 6.12+ or 7.6+ is required for debug support via `node --inspect-brk`.
provider: run cli.js of nodejs host directly
npm shims are useless because the user cannot set node to debug mode via
--inspect-brk. This is problematic on Windows which use batchfiles and
shell scripts to compensate for not supporting shebang.
The patch uses `npm root -g` to get the absolute path of the global npm
modules. If that fails, then the user did not install neovim npm package
globally. Use that absolute path to find `neovim/bin/cli.js`, which is
what the npm shim actually runs with node. glob() is for a simple file
check in case bin/ is removed because the npm shims are ignored now.
ruby uses batchfiles with 'cmd' extension.
gem creates batchfiles with 'bat' extension.
`gem install rails` does the following in Windows (not Cygwin):
1. Run `gem.cmd install rails` on cmd.exe
2. gem.cmd runs `ruby.exe -x gem install rails`
3. `rails` gem is installed.
`rails.bat` is created in the same directory
where ruby.exe and gem.cmd reside.
neovim-ruby-host is a ruby script.
neovim-node-host is a shell script.
Both don't work in cmd.exe so gem and npm provide batchfile shims.
Return the full path of these shims, cmd.exe knows better what to do with these files.
Fix bug that checked for npm AND yarn, where we wanted npm OR yarn.
But since we call `npm` exclusively, and it's highly unlikely you have
yarn installed without npm, let's just remove the yarn check altogether.
Addresses https://github.com/neovim/node-client/issues/41
:checkhealth reports that remote plugins are unregistered
after running :UpdateRemotePlugins because of the backslashes in filepath.
Normalize them to forward slashes because the paths in rplugin.vim are normalized in autoload/remote/host.vim.
With the old behavior, if a GUI makes a blocking request that requires user
interaction (like nvim_input()), it would not get any screen updates.
The client, not nvim, should decide how to handle notifications during a
pending request. If an rplugin wants to avoid async calls while a sync call is
busy, it likely wants to avoid processing async calls while another async call
also is handled as well.
This may break the expectation of some existing rplugins. For compatibility,
remote/define.vim reimplements the old behavior. Clients can opt-out by
specifying `sync=urgent`.
- Legacy hosts should be updated to use `sync=urgent`. They could add a flag
indicating which async methods are always safe to call and which must wait
until the main loop returns.
- New hosts can expose the full asyncness, they don't need to offer both
behaviors.
ref #6532
ref #1398d83868fe90
`:syntax keyword` is affected by 'iskeyword'. When we aligned
'iskeyword' to that of filetype=help, colon (:) is now included.
Simplest way to deal with this is to include colon (:) in the `:syntax
keyword` directive.
Also:
- change "SUGGESTIONS" mouthful to "ADVICE"
- change "SUCCESS" to "OK"
Always check for the presence of pyenv_root if pyenv is installed: if it
is not set, we don't know if it was intentional. If it wasn't
intentional, the warning is confusing (see #7176).
closes#7176
If an autoloaded function hasn't been resolved before it is used in
function(), the self dict will not be created which causes E725 when
calling the function. Since self isn't being used in
provider#stderr_collector, we can remove the dict attribute to
workaround the self dict bug[0].
Closes#7115
[0]: https://groups.google.com/d/msg/vim_dev/I7AXOyv-P4o/DzbyOxDHBgAJ
- Show hint only once per session.
- provider#clipboard#Call(): prevent recursion
- provider#clear_stderr(): use has_key(), because :silent! is still
captured by :redir.
closes#7184
redir_write():
- This is a "batch" operation which was not yet covered by
start_batch_changes()
adjust_clipboard_name():
- msg() and friends during :redir will, of course, cause redir_write()
to try to capture that message, which causes recursion.
- EMSG() here is trouble: if it interrupts :redir it is a mess.
Rather than deal with the mess, show a non-error message.
closes#7182closes#7184closes#7183
ref #6048
ref #7032