From 8c257e24e02600112d6c7db48386eeabd4748536 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 27 Jun 2015 18:23:46 +0200 Subject: [PATCH] VimBuffer: use vim.current.buffer.number instead of vim.eval This should be more performant. --- pythonx/UltiSnips/_vim.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pythonx/UltiSnips/_vim.py b/pythonx/UltiSnips/_vim.py index b9afc38..39f5cc6 100644 --- a/pythonx/UltiSnips/_vim.py +++ b/pythonx/UltiSnips/_vim.py @@ -49,8 +49,8 @@ class VimBuffer(object): @property def number(self): # pylint:disable=no-self-use - """The bufnr() of this buffer.""" - return int(eval("bufnr('%')")) + """The bufnr() of the current buffer.""" + return vim.current.buffer.number @property def cursor(self): # pylint:disable=no-self-use