mirror of
https://github.com/powerline/powerline.git
synced 2025-07-27 07:44:36 +02:00
Use different fallback for old Vims
Reasoning: currently used fallback works well only if relatively recent patches are there: specifically the one that transforms Vim errors to Python exceptions. This variant should work in any case, but it has a downside: it does not test whether function exists, it tests whether argument given to vim_func_exists denote some callable object (which may as well be global variable with the same name). When it comes to CapsLockStatusline I do not care much as I am using `vim.eval` to call it and not saving reference to this function somewhere. Fixes #1146
This commit is contained in:
parent
a6ba63a8e5
commit
8afb35bd5d
@ -135,7 +135,7 @@ if hasattr(vim, 'Function'):
|
|||||||
else:
|
else:
|
||||||
def vim_func_exists(f):
|
def vim_func_exists(f):
|
||||||
try:
|
try:
|
||||||
return bool(int(vim.eval('type(function("{0}")) == 2'.format(f))))
|
return bool(int(vim.eval('exists("*{0}")'.format(f))))
|
||||||
except vim.error:
|
except vim.error:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user