forked from VimPlug/emmet-vim
Get image paths that is relative location from the current buffer. Related issue #150
This commit is contained in:
@@ -120,11 +120,8 @@ function! emmet#lang#haml#imageSize()
|
|||||||
if fn =~ '^\s*$'
|
if fn =~ '^\s*$'
|
||||||
return
|
return
|
||||||
elseif fn !~ '^\(/\|http\)'
|
elseif fn !~ '^\(/\|http\)'
|
||||||
let fn = resolve(expand(fn))
|
|
||||||
if !filereadable(fn)
|
|
||||||
let fn = simplify(expand('%:h') . '/' . fn)
|
let fn = simplify(expand('%:h') . '/' . fn)
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
let [width, height] = emmet#util#getImageSize(fn)
|
let [width, height] = emmet#util#getImageSize(fn)
|
||||||
if width == -1 && height == -1
|
if width == -1 && height == -1
|
||||||
|
|||||||
@@ -447,11 +447,8 @@ function! emmet#lang#html#imageSize()
|
|||||||
if fn =~ '^\s*$'
|
if fn =~ '^\s*$'
|
||||||
return
|
return
|
||||||
elseif fn !~ '^\(/\|http\)'
|
elseif fn !~ '^\(/\|http\)'
|
||||||
let fn = resolve(expand(fn))
|
|
||||||
if !filereadable(fn)
|
|
||||||
let fn = simplify(expand('%:h') . '/' . fn)
|
let fn = simplify(expand('%:h') . '/' . fn)
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
let [width, height] = emmet#util#getImageSize(fn)
|
let [width, height] = emmet#util#getImageSize(fn)
|
||||||
if width == -1 && height == -1
|
if width == -1 && height == -1
|
||||||
|
|||||||
@@ -98,11 +98,8 @@ function! emmet#lang#slim#imageSize()
|
|||||||
if fn =~ '^\s*$'
|
if fn =~ '^\s*$'
|
||||||
return
|
return
|
||||||
elseif fn !~ '^\(/\|http\)'
|
elseif fn !~ '^\(/\|http\)'
|
||||||
let fn = resolve(expand(fn))
|
|
||||||
if !filereadable(fn)
|
|
||||||
let fn = simplify(expand('%:h') . '/' . fn)
|
let fn = simplify(expand('%:h') . '/' . fn)
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
let [width, height] = emmet#util#getImageSize(fn)
|
let [width, height] = emmet#util#getImageSize(fn)
|
||||||
if width == -1 && height == -1
|
if width == -1 && height == -1
|
||||||
|
|||||||
Reference in New Issue
Block a user