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文档,“normal”关键字的参数是“像键入的那样执行”,但显然情况并非如此。当我键入它时(在正常命令模式下,不带“:”前导),它工作得很好,但在脚本(“e78:未知标记”)中不起作用。
只需键入“_~”/“即可获得此错误。