mirror of
https://github.com/mattn/emmet-vim.git
synced 2025-12-07 19:24:27 +08:00
Get image paths that is relative location from the current buffer. Related issue #150
This commit is contained in:
@@ -120,10 +120,7 @@ function! emmet#lang#haml#imageSize()
|
|||||||
if fn =~ '^\s*$'
|
if fn =~ '^\s*$'
|
||||||
return
|
return
|
||||||
elseif fn !~ '^\(/\|http\)'
|
elseif fn !~ '^\(/\|http\)'
|
||||||
let fn = resolve(expand(fn))
|
let fn = simplify(expand('%:h') . '/' . fn)
|
||||||
if !filereadable(fn)
|
|
||||||
let fn = simplify(expand('%:h') . '/' . fn)
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let [width, height] = emmet#util#getImageSize(fn)
|
let [width, height] = emmet#util#getImageSize(fn)
|
||||||
|
|||||||
@@ -447,10 +447,7 @@ function! emmet#lang#html#imageSize()
|
|||||||
if fn =~ '^\s*$'
|
if fn =~ '^\s*$'
|
||||||
return
|
return
|
||||||
elseif fn !~ '^\(/\|http\)'
|
elseif fn !~ '^\(/\|http\)'
|
||||||
let fn = resolve(expand(fn))
|
let fn = simplify(expand('%:h') . '/' . fn)
|
||||||
if !filereadable(fn)
|
|
||||||
let fn = simplify(expand('%:h') . '/' . fn)
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let [width, height] = emmet#util#getImageSize(fn)
|
let [width, height] = emmet#util#getImageSize(fn)
|
||||||
|
|||||||
@@ -98,10 +98,7 @@ function! emmet#lang#slim#imageSize()
|
|||||||
if fn =~ '^\s*$'
|
if fn =~ '^\s*$'
|
||||||
return
|
return
|
||||||
elseif fn !~ '^\(/\|http\)'
|
elseif fn !~ '^\(/\|http\)'
|
||||||
let fn = resolve(expand(fn))
|
let fn = simplify(expand('%:h') . '/' . fn)
|
||||||
if !filereadable(fn)
|
|
||||||
let fn = simplify(expand('%:h') . '/' . fn)
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let [width, height] = emmet#util#getImageSize(fn)
|
let [width, height] = emmet#util#getImageSize(fn)
|
||||||
|
|||||||
Reference in New Issue
Block a user