From 05cb133dd4e0f289f222cf8097a77e958660f597 Mon Sep 17 00:00:00 2001 From: ZyX Date: Fri, 5 Sep 2014 22:13:51 +0400 Subject: [PATCH] =?UTF-8?q?Replace=20g:powerline=5Fconfig=5Fpath=20Vim=20v?= =?UTF-8?q?ariable=20with=20=E2=80=A6=5Fpaths=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is for consistency with other powerline bindings that now all do have a way to specify a list of paths. --- docs/source/configuration/local.rst | 8 ++++---- powerline/vim.py | 2 +- tests/test_configuration.py | 2 +- tests/test_local_overrides.vim | 2 +- tests/test_plugin_file.vim | 2 +- tests/test_provided_config_files.py | 2 +- tests/test_tabline.vim | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/source/configuration/local.rst b/docs/source/configuration/local.rst index c66b5c78..385bdfcf 100644 --- a/docs/source/configuration/local.rst +++ b/docs/source/configuration/local.rst @@ -22,10 +22,10 @@ Vim configuration can be overridden using the following options: redefine some value (e.g. segment) in list, only the whole list itself: only dictionaries are merged recursively. -``g:powerline_config_path`` - Path (must be expanded, ``~`` shortcut is not supported). Points to the - directory which will be searched for configuration. When this option is - present, none of the other locations are searched. +``g:powerline_config_paths`` + Paths list (each path must be expanded, ``~`` shortcut is not supported). + Points to the list of directories which will be searched for configuration. + When this option is present, none of the other locations are searched. ``g:powerline_no_python_error`` If this variable is set to a true value it will prevent Powerline from reporting diff --git a/powerline/vim.py b/powerline/vim.py index ec754107..d0123707 100644 --- a/powerline/vim.py +++ b/powerline/vim.py @@ -119,7 +119,7 @@ class VimPowerline(Powerline): def get_config_paths(self): try: - return [vim_getvar('powerline_config_path')] + return vim_getvar('powerline_config_paths') except KeyError: return super(VimPowerline, self).get_config_paths() diff --git a/tests/test_configuration.py b/tests/test_configuration.py index 714bba83..5172fb42 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -646,7 +646,7 @@ class TestVim(TestCase): from powerline.vim import VimPowerline import powerline as powerline_module import vim - vim.vars['powerline_config_path'] = '/' + vim.vars['powerline_config_paths'] = ['/'] with swap_attributes(config, powerline_module): with vim_module._with('environ', TEST='abc'): with get_powerline_raw(config, VimPowerline) as powerline: diff --git a/tests/test_local_overrides.vim b/tests/test_local_overrides.vim index ec902856..f6cf0931 100755 --- a/tests/test_local_overrides.vim +++ b/tests/test_local_overrides.vim @@ -1,6 +1,6 @@ #!/usr/bin/vim -S set encoding=utf-8 -let g:powerline_config_path = expand(':p:h:h') . '/powerline/config_files' +let g:powerline_config_paths = [expand(':p:h:h') . '/powerline/config_files'] let g:powerline_config_overrides = {'common': {'default_top_theme': 'ascii'}} let g:powerline_theme_overrides__default = {'segment_data': {'line_current_symbol': {'contents': 'LN '}, 'branch': {'before': 'B '}}} diff --git a/tests/test_plugin_file.vim b/tests/test_plugin_file.vim index 27a85411..e139c44f 100755 --- a/tests/test_plugin_file.vim +++ b/tests/test_plugin_file.vim @@ -1,6 +1,6 @@ #!/usr/bin/vim -S set encoding=utf-8 -let g:powerline_config_path = expand(':p:h:h') . '/powerline/config_files' +let g:powerline_config_paths = [expand(':p:h:h') . '/powerline/config_files'] tabedit abc tabedit def try diff --git a/tests/test_provided_config_files.py b/tests/test_provided_config_files.py index 05dd68a9..381cd842 100644 --- a/tests/test_provided_config_files.py +++ b/tests/test_provided_config_files.py @@ -58,7 +58,7 @@ class TestVimConfig(TestCase): with vim_module._with('bufname', '/tmp/foo.txt'): out = powerline.render(vim_module.current.window, 1, vim_module.current.window.number, is_tabline=True) outputs[out] = (-1, (None, None), 'tab') - with vim_module._with('globals', powerline_config_path=cfg_path): + with vim_module._with('globals', powerline_config_paths=[cfg_path]): exclude = set(('no', 'v', 'V', VBLOCK, 's', 'S', SBLOCK, 'R', 'Rv', 'c', 'cv', 'ce', 'r', 'rm', 'r?', '!')) try: for mode in ['n', 'nc', 'no', 'v', 'V', VBLOCK, 's', 'S', SBLOCK, 'i', 'R', 'Rv', 'c', 'cv', 'ce', 'r', 'rm', 'r?', '!']: diff --git a/tests/test_tabline.vim b/tests/test_tabline.vim index 2db32045..a47fafaf 100755 --- a/tests/test_tabline.vim +++ b/tests/test_tabline.vim @@ -1,6 +1,6 @@ #!/usr/bin/vim -S set encoding=utf-8 -let g:powerline_config_path = expand(':p:h:h') . '/powerline/config_files' +let g:powerline_config_paths = [expand(':p:h:h') . '/powerline/config_files'] source powerline/bindings/vim/plugin/powerline.vim edit abc tabedit def