diff --git a/pythonx/jedi_vim.py b/pythonx/jedi_vim.py index 7edc8ac..6d360f5 100644 --- a/pythonx/jedi_vim.py +++ b/pythonx/jedi_vim.py @@ -229,6 +229,7 @@ def tempfile(content): finally: os.unlink(f.name) + @_check_jedi_availability(show_error=True) @catch_and_print_exceptions def goto(mode="goto", no_output=False): @@ -250,7 +251,6 @@ def goto(mode="goto", no_output=False): elif mode == "assignment": definitions = script.goto_assignments() - if no_output: return definitions if not definitions: @@ -270,10 +270,12 @@ def goto(mode="goto", no_output=False): using_tagstack=using_tagstack) if not result: return [] - if d.module_path and os.path.exists(d.module_path) and using_tagstack: + if (using_tagstack and d.module_path and + os.path.exists(d.module_path)): tagname = d.name - with tempfile('{0}\t{1}\t{2}'.format(tagname, d.module_path, - 'call cursor({0}, {1})'.format(d.line, d.column + 1))) as f: + with tempfile('{0}\t{1}\t{2}'.format( + tagname, d.module_path, 'call cursor({0}, {1})'.format( + d.line, d.column + 1))) as f: old_tags = vim.eval('&tags') old_wildignore = vim.eval('&wildignore') try: @@ -389,7 +391,8 @@ def show_call_signatures(signatures=()): line = vim_eval("getline(%s)" % line_to_replace) # Descriptions are usually looking like `param name`, remove the param. - params = [p.description.replace('\n', '').replace('param ', '', 1) for p in signature.params] + params = [p.description.replace('\n', '').replace('param ', '', 1) + for p in signature.params] try: # *_*PLACEHOLDER*_* makes something fat. See after/syntax file. params[signature.index] = '*_*%s*_*' % params[signature.index] @@ -587,7 +590,8 @@ def do_rename(replace, orig=None): assert r.module_path is not None result = new_buffer(r.module_path) if not result: - echo_highlight("Jedi-vim: failed to create buffer window for {0}!".format(r.module_path)) + echo_highlight('Failed to create buffer window for %s!' % ( + r.module_path)) continue buffers.add(vim.current.buffer.name) diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..7da1f96 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length = 100