diff --git a/powerline/lint/__init__.py b/powerline/lint/__init__.py index 4470c947..55f7a414 100644 --- a/powerline/lint/__init__.py +++ b/powerline/lint/__init__.py @@ -28,6 +28,16 @@ def open_file(path): return open(path, 'rb') +def generate_json_config_loader(lhadproblem): + def load_json_config(config_file_path, load=load, open_file=open_file): + with open_file(config_file_path) as config_file_fp: + r, hadproblem = load(config_file_fp) + if hadproblem: + lhadproblem[0] = True + return r + return load_json_config + + function_name_re = '^(\w+\.)*[a-zA-Z_]\w*$' @@ -279,16 +289,6 @@ theme_spec = common_theme_spec().update( ) -def generate_json_config_loader(lhadproblem): - def load_json_config(config_file_path, load=load, open_file=open_file): - with open_file(config_file_path) as config_file_fp: - r, hadproblem = load(config_file_fp) - if hadproblem: - lhadproblem[0] = True - return r - return load_json_config - - def check(paths=None, debug=False, echoerr=echoerr, require_ext=None): search_paths = paths or get_config_paths() find_config_files = generate_config_finder(lambda: search_paths)