parent
d14aecbc0a
commit
4ed1a7e561
|
@ -3,7 +3,7 @@ from __future__ import (unicode_literals, division, absolute_import, print_funct
|
|||
|
||||
import os
|
||||
|
||||
from powerline.bindings.vim import vim_getbufoption
|
||||
from powerline.bindings.vim import vim_getbufoption, buffer_name
|
||||
|
||||
|
||||
def help(matcher_info):
|
||||
|
@ -11,8 +11,8 @@ def help(matcher_info):
|
|||
|
||||
|
||||
def cmdwin(matcher_info):
|
||||
name = matcher_info['buffer'].name
|
||||
return name and os.path.basename(name) == '[Command Line]'
|
||||
name = buffer_name(matcher_info)
|
||||
return name and os.path.basename(name) == b'[Command Line]'
|
||||
|
||||
|
||||
def quickfix(matcher_info):
|
||||
|
|
|
@ -3,10 +3,13 @@ from __future__ import (unicode_literals, division, absolute_import, print_funct
|
|||
|
||||
import os
|
||||
|
||||
from powerline.bindings.vim import buffer_name
|
||||
|
||||
|
||||
try:
|
||||
import vim
|
||||
except ImportError:
|
||||
vim = object()
|
||||
pass
|
||||
else:
|
||||
vim.command('''
|
||||
function! Powerline_plugin_ctrlp_main(...)
|
||||
|
@ -26,5 +29,5 @@ else:
|
|||
|
||||
|
||||
def ctrlp(matcher_info):
|
||||
name = matcher_info['buffer'].name
|
||||
return name and os.path.basename(name) == 'ControlP'
|
||||
name = buffer_name(matcher_info)
|
||||
return name and os.path.basename(name) == b'ControlP'
|
||||
|
|
|
@ -3,12 +3,14 @@ from __future__ import (unicode_literals, division, absolute_import, print_funct
|
|||
|
||||
import os
|
||||
|
||||
from powerline.bindings.vim import buffer_name
|
||||
|
||||
|
||||
def gundo(matcher_info):
|
||||
name = matcher_info['buffer'].name
|
||||
return name and os.path.basename(name) == '__Gundo__'
|
||||
name = buffer_name(matcher_info)
|
||||
return name and os.path.basename(name) == b'__Gundo__'
|
||||
|
||||
|
||||
def gundo_preview(matcher_info):
|
||||
name = matcher_info['buffer'].name
|
||||
return name and os.path.basename(name) == '__Gundo_Preview__'
|
||||
name = buffer_name(matcher_info)
|
||||
return name and os.path.basename(name) == b'__Gundo_Preview__'
|
||||
|
|
|
@ -4,7 +4,12 @@ from __future__ import (unicode_literals, division, absolute_import, print_funct
|
|||
import os
|
||||
import re
|
||||
|
||||
from powerline.bindings.vim import buffer_name
|
||||
|
||||
|
||||
NERD_TREE_RE = re.compile(b'NERD_TREE_\\d+')
|
||||
|
||||
|
||||
def nerdtree(matcher_info):
|
||||
name = matcher_info['buffer'].name
|
||||
return name and re.match(r'NERD_tree_\d+', os.path.basename(name))
|
||||
name = buffer_name(matcher_info)
|
||||
return name and NERD_TREE_RE.match(os.path.basename(name))
|
||||
|
|
Loading…
Reference in New Issue