开发者

calling vim's input() function sometimes puts ^L at the prompt for some reason

I hav开发者_StackOverflowe code that looks like this:

let s:append_file = ''
let s:append_file = input("print messages to file: ", s:append_file)

This code executes fine, but sometimes the prompt looks like this:

print messages to file: ^L

Why does the ^L character appear there and how can I get rid of it?


That ^L may come from a mapping or some autocmd using feedkeys(). You need to use inputsave() before input() and inputrestore() after input() to avoid that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜