Alter plugin layout: move *.plugin to *.{ext}.plugin
I do not see why vim plugins should receive such a generic name as `powerline.segments.plugin.gundo`: taking a name that clearly indicates that `gundo` is a *vim* plugin is better.
This commit is contained in:
parent
d66256ad34
commit
63a376e91d
|
@ -34,10 +34,10 @@
|
|||
"help": "help",
|
||||
"quickfix": "quickfix",
|
||||
|
||||
"powerline.matchers.plugin.nerdtree.nerdtree": "plugin_nerdtree",
|
||||
"powerline.matchers.plugin.ctrlp.ctrlp": "plugin_ctrlp",
|
||||
"powerline.matchers.plugin.gundo.gundo": "plugin_gundo",
|
||||
"powerline.matchers.plugin.gundo.gundo_preview": "plugin_gundo-preview"
|
||||
"powerline.matchers.vim.plugin.nerdtree.nerdtree": "plugin_nerdtree",
|
||||
"powerline.matchers.vim.plugin.ctrlp.ctrlp": "plugin_ctrlp",
|
||||
"powerline.matchers.vim.plugin.gundo.gundo": "plugin_gundo",
|
||||
"powerline.matchers.vim.plugin.gundo.gundo_preview": "plugin_gundo-preview"
|
||||
}
|
||||
},
|
||||
"wm": {
|
||||
|
|
|
@ -55,13 +55,13 @@
|
|||
},
|
||||
{
|
||||
"exclude_modes": ["nc"],
|
||||
"module": "powerline.segments.plugin.syntastic",
|
||||
"module": "powerline.segments.vim.plugin.syntastic",
|
||||
"name": "syntastic",
|
||||
"priority": 50
|
||||
},
|
||||
{
|
||||
"exclude_modes": ["nc"],
|
||||
"module": "powerline.segments.plugin.tagbar",
|
||||
"module": "powerline.segments.vim.plugin.tagbar",
|
||||
"name": "current_tag",
|
||||
"draw_soft_divider": false,
|
||||
"priority": 50
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"default_module": "powerline.segments.plugin.ctrlp",
|
||||
"default_module": "powerline.segments.vim.plugin.ctrlp",
|
||||
"segments": {
|
||||
"left": [
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"default_module": "powerline.segments.plugin.nerdtree",
|
||||
"default_module": "powerline.segments.vim.plugin.nerdtree",
|
||||
"segments": {
|
||||
"left": [
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@ def gen_matcher_getter(ext, import_paths):
|
|||
oldpath = sys.path
|
||||
sys.path = import_paths + sys.path
|
||||
try:
|
||||
return getattr(__import__(match_module, fromlist=[match_function]), match_function)
|
||||
return getattr(__import__(str(match_module), fromlist=[str(match_function)]), match_function)
|
||||
finally:
|
||||
sys.path = oldpath
|
||||
return get
|
||||
|
|
|
@ -58,8 +58,9 @@ def get_function(data, segment):
|
|||
oldpath = sys.path
|
||||
sys.path = data['path'] + sys.path
|
||||
segment_module = str(segment.get('module', data['default_module']))
|
||||
name = str(segment['name'])
|
||||
try:
|
||||
return None, getattr(__import__(segment_module, fromlist=[segment['name']]), segment['name']), segment_module
|
||||
return None, getattr(__import__(segment_module, fromlist=[name]), name), segment_module
|
||||
finally:
|
||||
sys.path = oldpath
|
||||
|
||||
|
|
Loading…
Reference in New Issue