Truncate paths at slashes.
This commit is contained in:
parent
f8fd2ecce2
commit
ba26044746
@ -623,8 +623,13 @@ function! s:Path.str(...)
|
|||||||
|
|
||||||
if has_key(options, 'truncateTo')
|
if has_key(options, 'truncateTo')
|
||||||
let limit = options['truncateTo']
|
let limit = options['truncateTo']
|
||||||
if len(toReturn) > limit
|
if len(toReturn) > limit-1
|
||||||
let toReturn = "<" . strpart(toReturn, len(toReturn) - limit + 1)
|
let toReturn = toReturn[(len(toReturn)-limit+1):]
|
||||||
|
if len(split(toReturn, '/')) > 1
|
||||||
|
let toReturn = '</' . join(split(toReturn, '/')[1:], '/') . '/'
|
||||||
|
else
|
||||||
|
let toReturn = '<' . toReturn
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user