diff --git a/plugin/image.vim b/plugin/image.vim index 16fb80d..7298f15 100644 --- a/plugin/image.vim +++ b/plugin/image.vim @@ -1,7 +1,7 @@ command! -nargs=0 Image call DisplayImage() -if !has("python") - echo "image.vim requires python support" +if !has("python3") + echo "image.vim requires python3 support" finish endif @@ -9,7 +9,7 @@ au BufRead *.png,*.jpg,*.jpeg :call DisplayImage() function! DisplayImage() set nowrap -python << EOF +python3 << EOF from __future__ import division import vim from PIL import Image @@ -53,9 +53,9 @@ def getAsciiImage(imageFile, maxWidth, maxHeight): # clear the buffer vim.current.buffer[:] = None - for y in xrange(scaledHeight): + for y in range(scaledHeight): asciiImage = "" - for x in xrange(scaledWidth): + for x in range(scaledWidth): rgb = pixels[x, y] if not isinstance(rgb, tuple): rgb = (rgb,)