mirror of
https://github.com/powerline/powerline.git
synced 2025-07-30 09:15:19 +02:00
Add vim_getoption and vim_setoption functions
This commit is contained in:
parent
757e563250
commit
e64811c661
@ -99,10 +99,23 @@ else:
|
|||||||
if hasattr(vim, 'options'):
|
if hasattr(vim, 'options'):
|
||||||
def vim_getbufoption(info, option):
|
def vim_getbufoption(info, option):
|
||||||
return info['buffer'].options[str(option)]
|
return info['buffer'].options[str(option)]
|
||||||
|
|
||||||
|
def vim_getoption(option):
|
||||||
|
return vim.options[str(option)]
|
||||||
|
|
||||||
|
def vim_setoption(option, value):
|
||||||
|
vim.options[str(option)] = value
|
||||||
else:
|
else:
|
||||||
def vim_getbufoption(info, option): # NOQA
|
def vim_getbufoption(info, option): # NOQA
|
||||||
return getbufvar(info['bufnr'], '&' + option)
|
return getbufvar(info['bufnr'], '&' + option)
|
||||||
|
|
||||||
|
def vim_getoption(option): # NOQA
|
||||||
|
return vim.eval('&g:' + option)
|
||||||
|
|
||||||
|
def vim_setoption(option, value): # NOQA
|
||||||
|
vim.command('let &g:{option} = {value}'.format(
|
||||||
|
option=option, value=json.encode(value)))
|
||||||
|
|
||||||
|
|
||||||
if hasattr(vim, 'tabpages'):
|
if hasattr(vim, 'tabpages'):
|
||||||
current_tabpage = lambda: vim.current.tabpage
|
current_tabpage = lambda: vim.current.tabpage
|
||||||
|
Loading…
x
Reference in New Issue
Block a user