开发者

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

开发者 https://www.devze.com 2023-01-31 06:28 出处:网络
I hav开发者_StackOverflowe code that looks like this: let s:append_file = \'\' let s:append_file = input(\"print messages to file: \", s:append_file)

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

精彩评论

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