From d42f56bc822cd328794780dd83ff61762d2c26b2 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Wed, 11 Oct 2017 09:44:48 +0200 Subject: [PATCH] Buffer names seem to be an empty string sometimes and not None --- pythonx/jedi_vim.py | 2 +- test/goto.vim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pythonx/jedi_vim.py b/pythonx/jedi_vim.py index d762985..c61fc79 100644 --- a/pythonx/jedi_vim.py +++ b/pythonx/jedi_vim.py @@ -665,7 +665,7 @@ def new_buffer(path, options='', using_tagstack=False): vim_command(split_options[user_split_option] + " %s" % escape_file_path(path)) else: if int(vim_eval("!&hidden && &modified")) == 1: - if vim_eval("bufname('%')") is None: + if not vim_eval("bufname('%')"): echo_highlight('Cannot open a new buffer, use `:set hidden` or save your buffer') return False else: diff --git a/test/goto.vim b/test/goto.vim index 2a79649..aaa6602 100644 --- a/test/goto.vim +++ b/test/goto.vim @@ -21,7 +21,7 @@ describe 'goto simple' end it 'goto definitions' - silent normal \d + normal \d Expect line('.') == 1 end