Commit Graph

60 Commits

Author SHA1 Message Date
Justin M. Keyes
2f38ed11c9 providers: Disable if g:loaded_* exists.
The exists('g:loaded_foo') convention is rather common, and may be
relied upon in some cases. It's also very unlikely that a user or plugin
has any reason to set g:loaded_foo to zero, so the principle of least
surprise can be brushed aside here.

https://github.com/neovim/neovim/issues/6107#issuecomment-279532143
2017-02-14 00:02:50 +01:00
Justin M. Keyes
9451647d9b health.vim: Do not check intentionally disabled providers.
Closes #6107
2017-02-13 22:21:23 +01:00
Rui Abreu Ferreira
33cd06dfb7 Windows: Clipboard provider win32yank 2017-01-20 18:29:17 +00:00
Marco Hinz
15c85d8462 clipboard: only check for pbcopy on macOS (#5927)
Fixes #5926.
2017-01-11 00:50:07 +01:00
Marco Hinz
1fbee630a8 provider: add Python 3.6 (#5886) 2017-01-05 21:29:31 +01:00
Justin M. Keyes
695703ca97 provider/clipboard.vim: fallback if xsel is broken (#5868)
Old versions of `xsel` do not support some required features.
Fall back to `xclip` then.

Closes #5853
2017-01-04 15:10:31 +01:00
Marco Hinz
15259c4b84 clipboard: show error message only once and put in history (#5870) 2017-01-04 00:45:31 +01:00
Marco Hinz
20995c7960 Remove g:python{,3}_host_skip_check (#5738)
This option simplifies the configuration options:

1) `g:python{,3}_host_prog` is not set.

    Neovim tries its best to find a suitable interpreter. This means calling
    exepath(), potentially multiple times, and a system('python -c ...') with
    the first found interpreter, to get the Python version.

2) `g:python{,3}_host_prog` is set.

    Avoids everything of the above. No safety checks, no training wheels. Fast
    host startup time!
2016-12-09 15:08:18 +01:00
Marco Hinz
3a802e3c16 provider/clipboard.vim: never show a warning on sourcing
Never throw an error when provider/clipboard.vim is sourced for the first time.
Save the error instead and expose it via `provider#clipboard#Error()`, mimicking
provider/python.vim.
2016-11-02 12:06:57 +01:00
Marco Hinz
0a1b852cd1 provider/clipboard.vim: refactor 2016-11-02 12:04:43 +01:00
Björn Linse
2d60a15e25 job control: reuse common job code for rpc jobs
This makes stderr and exit callbacks work for rpc jobs
2016-08-20 12:55:35 +02:00
Björn Linse
6ea2bde065 clipboard: fix v:register when clipboard=unnamed,unnamedplus 2016-07-12 22:30:51 +02:00
Justin M. Keyes
c7d84c5550 Merge #4980 'Support legacy :ruby commands'. 2016-07-10 14:16:12 -04:00
Alex Genco
0a3c0205c5 Add :ruby, :rubyfile, and :rubydo ex commands 2016-07-02 21:45:48 -07:00
Justin M. Keyes
37f560aedf doc/python: cleanup
- Move info to providers.txt
- Remove "nvim-" prefix.
- Brevity, clarity, ...
2016-06-15 22:50:37 -04:00
Justin M. Keyes
c698ed0531 doc: cleanup 2016-06-15 19:31:11 -04:00
Justin M. Keyes
4bad05ba97 doc/clipboard: cleanup 2016-06-15 19:31:11 -04:00
Aleksa Sarai
96546fb696 runtime: clipboard: start daemons in /
This avoids the issue of nvim started daemons causing mountpoints to be
unmountable. This is currently the only place in runtime/ where this
calling convention occurred.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2016-06-07 17:26:49 +10:00
Justin M. Keyes
5fed9f5626 Merge pull request #4830 from blueyed/proider-pythonx-handle-127
provider/pythonx: handle exit code 127 from pyenv
2016-05-28 21:05:08 -04:00
Daniel Hahler
1ea1626764 provider/pythonx: use robust comparison (via vint) 2016-05-28 17:16:24 +02:00
Daniel Hahler
dab5d1368a provider/pythonx: handle exit code 127 from pyenv
This also checks the major/min version only for expected return codes.

With pyenv, you might get the following (return code 127):

    pyenv: python3.4: command not found

    The `python3.4' command exists in these Python versions:
      3.4.3
      3.4.3/envs/tmp-3.4.3-eElS6Y
      tmp-3.4.3-eElS6Y
2016-05-28 17:10:16 +02:00
Joel D. Elkins
9b1e819c8c clipboard: support "doit" tool 2016-05-15 16:53:49 -05:00
Shougo Matsushita
b50afb4651 clipboard: support "lemonade" tool 2016-04-17 13:38:57 +09:00
Björn Linse
89bb5a8ab8 python: move script_host.py to python-client 2016-03-15 12:32:18 +01:00
Alex Genco
3cb9970acf Ruby remote plugin support 2016-03-10 19:01:44 -08:00
Shougo Matsushita
bb020df0f5 rplugin: Initialize remote plugins lazily. #4384 2016-03-10 10:34:57 -05:00
Shougo Matsushita
46bd3c0f77 clipboard: Check $DISPLAY. Prefer xsel. #4150 2016-02-05 09:51:56 -05:00
Björn Linse
49f0417988 clipboard: Detach clipboard helper, so contents is kept after nvim exit 2016-01-20 11:09:29 +01:00
Dan Strokirk
38435e8a05 python: Add missing I/O methods to RedirectStream
`RedirectStream` is used to redirect `stdout` and `stderr`, but are
missing certain I/O methods available on other file-like objects.
This causes external plugins (like `colorama`) to crash.

Inheriting from `io.IOBase` adds an abstract implementation of these
methods, which will at least keep the python code running.

Fixes #4045
2016-01-18 17:22:11 +01:00
Daniel Hahler
dcc71094d1 runtime/autoload/provider/python{,3}.vim: fix E168
Do not use `finish` inside of `provider#python{,3}#Call`, but `return`.
2015-11-03 16:52:26 +01:00
Florian Walch
e3540a430b provider/pythonx: Improve detection code and error messages.
"python -c" returns 1 in case of an error. Use a return code of 2 if
the Neovim module is not found to distinguish these cases.

Verify the interpreter version before checking for an installed Neovim
module. Show a new error message if the Python interpreter version
is below the minimum required version.

Always use "pkgutil" to determine if the Neovim module is installed.
In contrast to "importlib", which was used for Python 3,
"pkgutil.find_loader" is available for all Python versions [1,2].
"pkgutil.find_loader" internally uses "importlib" for Python >= 3.3 [2].
Also, the previously used "importlib.find_loader" is only available
since Python 3.3 (so checking the major Python version was not enough)
and deprecated since Python 3.4 [3].
Finally, conditioning on the major version in Vimscript was incorrect,
as checking the Neovim module for a certain Python major version does
not mean that the tested interpreters are actually of that version.
For example, we test the "python" executable, which is Python 2 on
Ubuntu and Python 3 on Arch Linux.

[1] https://docs.python.org/2/library/pkgutil.html#pkgutil.find_loader
[2] https://docs.python.org/3/library/pkgutil.html#pkgutil.find_loader
[3] https://docs.python.org/3/library/importlib.html#importlib.find_loader
2015-09-17 18:48:26 +02:00
Jakob Schnitzer
c478dd5ab4 python: remove current working directory from path
Before, running Nvim in a directory containing a Python module `neovim`,
or one that is imported by it or a plugin, will load that module and not
the system one. So Nvim might be tricked into running arbitrary scripts
from the current working directory.

Fixes #1665
Fixes #2530
2015-09-14 12:06:49 +02:00
sanmiguel
0ec6a9c3c3 provider/pythonx.vim: Use shell-agnostic construction. #3190 2015-08-21 00:33:29 -04:00
Justin M. Keyes
681ee8131c Merge pull request #2910 from blueyed/python-fix-path_hook
Python: fixes for sys.path_hooks handler
2015-08-17 19:21:19 -04:00
Björn Linse
d4ebbaa91a clipboard: support clipboard=unnamedplus,unnamed 2015-08-07 13:06:13 +02:00
Björn Linse
c7bfbd4fd9 python3: remove decoding logic, as this is now done in plugin host #3026
DecodeHook isn't needed since neovim/python-client#53
rpc methods won't pass bytes anymore, ref neovim/python-client#129
2015-07-18 22:39:28 +02:00
Daniel Hahler
07e538d589 python: VimPathFinder: remove unused load_module method
This method was not used, but `VimModuleLoader.load_module` is.
2015-07-09 13:45:25 +02:00
Daniel Hahler
5e32120236 python: path_hook: properly implement PEP302
The path hook used to load the module already in the `find_module` hook.

This caused different behaviour between Python 2.7 and 3.3, where the
former would call the `VimModuleLoader`, while Python 3.3 appears to
short-circuited this (because the module was loaded already).

This patch will now only find the module, but not load it in the
`find_module` hook.
2015-07-09 13:43:57 +02:00
Daniel Hahler
ad6dfa6669 python: VimModuleLoader: check sys.modules[fullname]
This is required by PEP302 for `reload()`ing modules.
2015-07-09 13:43:57 +02:00
Daniel Hahler
1cc37f32b8 python: VimPathFinder: use find_spec for Python 3.4
Fixes https://github.com/neovim/neovim/issues/2909
2015-07-09 13:43:29 +02:00
Björn Linse
3fcfd52422 clipboard: avoid redundant error message on clipboard_get failure .
Fixes #2712

Helped-By: Michael Reed <m.reed@mykolab.com>
2015-06-25 19:30:29 -04:00
Björn Linse
d133502e98 clipboard: keep track of ownership and cache clipboard data locally
Helped-By: Justin M. Keyes <justinkz@gmail.com>
2015-06-25 19:30:28 -04:00
Björn Linse
a0e89978bd clipboard: don't use &shell in clipboard provider 2015-06-25 19:16:59 -04:00
Florian Walch
e8c68aa7ee provider/pythonx: Show absolute path to executable in error message. 2015-06-09 10:55:25 +03:00
Florian Walch
cfa278c72e provider/pythonx: Merge s:check_version() and s:check_interpreter(). 2015-06-09 10:29:46 +03:00
Florian Walch
4dc3c84c5a provider/pythonx: Don't use Python 3 interpreter for +python.
The executable 'python' can refer to either Python 2 or Python 3. Add a
check to only accept Python 2 interpreters as providers for +python.

Also improve the error messages.

Resolves #2734.
2015-06-09 10:29:46 +03:00
Daniel Hahler
c148427c89 provider/pythonx: return error from Detect
Ref: https://github.com/blueyed/neovim/commit/9b653ce0#commitcomment-11195449
2015-06-09 10:29:46 +03:00
Daniel Hahler
2111f28fc5 provider/python: Call: fix usage of 'finish' in function
Do not call it again in case of an exception in `remote#host#Require`
(ref: https://github.com/neovim/neovim/pull/2549#issuecomment-102674350).
2015-06-09 10:29:46 +03:00
Daniel Hahler
866e587b88 provider/python: define Prog and Error functions always
`provider#pythonX#Error` and `provider#pythonX#Prog` are currently meant
for debugging only (the error message is not being used), and should
therefore be defined always, especially in case of errors.

Ref: https://github.com/neovim/neovim/pull/2549#issuecomment-98607580
2015-06-09 10:29:46 +03:00
Daniel Hahler
3b0ec6599c provider/pythonx: Detect: only return valid versions
The `check` return value of `s:check_version` was not being used, and it
was returned always.
2015-06-09 10:29:45 +03:00