mirror of
https://github.com/powerline/powerline.git
synced 2025-07-27 07:44:36 +02:00
Do not call mode() with an argument on old Vims
This commit is contained in:
parent
c2609e31b8
commit
2c8932b084
@ -18,6 +18,10 @@ except ImportError:
|
|||||||
|
|
||||||
|
|
||||||
vim_mode = vim_get_func('mode', rettype=str)
|
vim_mode = vim_get_func('mode', rettype=str)
|
||||||
|
if int(vim.eval('v:version')) >= 702:
|
||||||
|
_vim_mode = vim_mode
|
||||||
|
vim_mode = lambda: _vim_mode(1)
|
||||||
|
|
||||||
mode_translations = {
|
mode_translations = {
|
||||||
chr(ord('V') - 0x40): '^V',
|
chr(ord('V') - 0x40): '^V',
|
||||||
chr(ord('S') - 0x40): '^S',
|
chr(ord('S') - 0x40): '^S',
|
||||||
@ -89,7 +93,7 @@ class VimRenderer(Renderer):
|
|||||||
segment_info = self.segment_info.copy()
|
segment_info = self.segment_info.copy()
|
||||||
|
|
||||||
if window is vim.current.window:
|
if window is vim.current.window:
|
||||||
mode = vim_mode(1)
|
mode = vim_mode()
|
||||||
mode = mode_translations.get(mode, mode)
|
mode = mode_translations.get(mode, mode)
|
||||||
else:
|
else:
|
||||||
mode = 'nc'
|
mode = 'nc'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user