From 6866fe3d1fbafe795a368927dfe1bd442ddab7a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Yngve=20Lerv=C3=A5g?= Date: Mon, 18 May 2015 19:08:25 +0200 Subject: [PATCH] Fixed bug in ref completion (fixes #169) --- autoload/vimtex/complete.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/vimtex/complete.vim b/autoload/vimtex/complete.vim index ae5a17a..67b82c9 100644 --- a/autoload/vimtex/complete.vim +++ b/autoload/vimtex/complete.vim @@ -346,7 +346,8 @@ function! s:labels_extract(file) " {{{2 let lines = map(lines, 'vimtex#util#convert_back(v:val)') for line in lines let tree = vimtex#util#tex2tree(line) - if !empty(tree[2][0]) + if type(tree[2][0]) == type([]) + \ && !empty(tree[2][0]) call add(matches, [ \ vimtex#util#tree2tex(tree[1][0]), \ vimtex#util#tree2tex(tree[2][0][0]),