Improve compatibility with older Vim

`systemlist` was introduced in a patch for Vim 7.4.  By instead
using `split(system(...), '\n')`, the plugin should be compatible
with Vim 7.3 (and perhaps also earlier versions).
This commit is contained in:
Karl Yngve Lervåg 2015-07-06 15:31:09 +02:00
parent 66c0b273e2
commit bc50385973

View File

@ -408,7 +408,7 @@ function! s:xwin_get_id() dict " {{{1
sleep 500m
let cmd = 'xdotool search --class ' . self.class
let xwin_ids = systemlist(cmd)
let xwin_ids = split(system(cmd), '\n')
if len(xwin_ids) == 0
call vimtex#echo#warning(
\ 'vimtex viewer can not find ' . self.class . ' window ID!')
@ -425,7 +425,7 @@ function! s:xwin_exists() dict " {{{1
if !executable('xdotool') | return 0 | endif
let cmd = 'xdotool search --class ' . self.class
if index(systemlist(cmd), self.xwin_id) >= 0
if index(split(system(cmd), '\n'), self.xwin_id) >= 0
return 1
endif