iamcco / markdown-preview.vim

⚠️ PLEASE USE https://github.com/iamcco/markdown-preview.nvim INSTEAD

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

无效的表达式: > mkdp#markdownRefresh()})

z-huabao opened this issue · comments

Ubuntu 16系统、VIM-7.4,出现这个错误:

处理 function <SNR>41_serverStart[10]..mkdp#browserStart[2]..<SNR>69_browserStart 时发生错误:
第   29 行:
E15: 无效的表达式: > mkdp#markdownRefresh()})
E116: Invalid arguments for function timer_start

@zhonghuabao1
I had the same issue, after some investigating, I found some interesting thing.
Probably after this commit iamcco started to using lambda functions which had implemented only in vim 8.1, soo all vim`s under 8.1 version can't work properly.
You have two ways.
First upgrade vim I did it like here
The second one, edit locally plugin and remove parts which are using lambda functions. (Small hint: it looks like this {... -> ...} and uses inside function timer_start, because it forcibly sends the arguments to the function which has no parameters)

By the way:
@iamcco Are you sure is it good idea supports only vim versions above 8.1?
If yes, I want to create a small pull request for update README file and add this note.

fix, please update and have a try

commit: fced5ca

@iamcco
Not yet.
After my changes provided in a pull request, it starts to work. But know they are not "by best practice" probably only as a workaround.
So, please review it and if you know better way tell me and I will update the pull request.

after update, same error,but '69' to '63':

处理 function <SNR>41_serverStart[5]..mkdp#browserStart[2]..<SNR>63_browserStart 时发生错误:
第   29 行:
E15: 无效的表达式: > mkdp#markdownRefresh()})
E116: Invalid arguments for function timer_start

another error: E492: 不是编辑器命令:StopMarkdownPreview

@zhonghuabao1
If you have time, could you please try edits provided in the pull request and give feedback on how it works in your case. That's will help provide better edits.

@bat9r sorry,I am unfamiliar with vim code, and I have not enough time recently!

@zhonghuabao1 please update and have a try. @bat9r 's PR have fix the problem

@iamcco @bat9r
cool, it works well now!
I make a mistake before: I run :PluginInstall! to update code, but does not update correctly!

@iamcco After update my vim version to 8.1, get another bug: issue84