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