function! SetupEncoding(encoding)
- if !has("iconv") || exists('b:encoding_set') || strlen(a:encoding) == 0
+ if !has("iconv") || exists('b:encoding_set') || empty(a:encoding)
return
endif
call RestorePosition()
let b:encoding_set = 1
- if len(expand('%'))
+ if !empty(expand('%'))
execute "edit ++enc=" . a:encoding
endif
endfunction
let line = getline('.')
let parts = split(line, s:URL_re . '\zs')
- if len(parts) == 0
+ if empty(parts)
throw 'ExtractURLCannotFindURL' " No URL found
endif
autocmd BufReadPost * call SetupSpell()
function! SaveSpell()
- if expand('%') == expand('~/.vim/spell/en.ascii.add')
+ if expand('%:p') == expand('~/.vim/spell/en.ascii.add')
mkspell! -ascii %
else
mkspell! %