function! CheckMe(file)
let shellcmd = 'checkme '.a:file
let output=system(shellcmd)
if !v:shell_error
return 0
endif
" Are you sure you want to split on non-blanks? This
" will result in list of blank strings.
" My variant:
let [line, char]=split(output)
" Normal is not an execute: this is what it will do:
" «'/» means «Go to mark /», produces an error E78 because /
" is not a valid symbol for mark. Than normal stops after error occured.
" If you need to use variables in nomal use «execute 'normal '.ncmd».
" And you can not use «normal» to perform search
execute '/\%'.line.'l\%'.char.'c'
" or
call setpos('.', [0, line, char, 0])
return 1
endfunction
Согласно документам Vim, аргумент "нормального" ключевого слова "выполняется так, как он напечатан", но, очевидно, это не так. Он прекрасно работает, когда я его набираю (в обычном командном режиме, без начального ':'), но не в сценарии ("E78: Неизвестная отметка).
Просто введите «'/», чтобы получить эту ошибку.