mirror of
https://github.com/powerline/powerline.git
synced 2025-07-23 05:46:01 +02:00
parent
87e39d0b56
commit
33592145ae
@ -8,6 +8,7 @@ from powerline.colorscheme import ATTR_BOLD, ATTR_ITALIC, ATTR_UNDERLINE
|
|||||||
from powerline.theme import Theme
|
from powerline.theme import Theme
|
||||||
|
|
||||||
import vim
|
import vim
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
vim_mode = vim_get_func('mode', rettype=str)
|
vim_mode = vim_get_func('mode', rettype=str)
|
||||||
@ -51,11 +52,16 @@ class VimRenderer(Renderer):
|
|||||||
return self.theme
|
return self.theme
|
||||||
|
|
||||||
if hasattr(vim, 'strwidth'):
|
if hasattr(vim, 'strwidth'):
|
||||||
@staticmethod
|
if sys.version_info < (3,):
|
||||||
def strwidth(string):
|
@staticmethod
|
||||||
# Does not work with tabs, but neither is strwidth from default
|
def strwidth(string):
|
||||||
# renderer
|
# Does not work with tabs, but neither is strwidth from default
|
||||||
return vim.strwidth(string.encode('utf-8'))
|
# renderer
|
||||||
|
return vim.strwidth(string.encode('utf-8'))
|
||||||
|
else:
|
||||||
|
@staticmethod
|
||||||
|
def strwidth(string):
|
||||||
|
return vim.strwidth(string)
|
||||||
|
|
||||||
def render(self, window_id, winidx, current):
|
def render(self, window_id, winidx, current):
|
||||||
'''Render all segments.
|
'''Render all segments.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user