1

To simplify the problem, run following command will get the same error

:py3 print(vim.eval('"\\<bs>"'))

And the real situation is

while 1:
    vimcmd("let nr = getchar()")
    vimcmd("let ch = type(nr) ? nr : nr2char(nr)")
    if vimeval('ch == "\\<bs>"') == '1':
        dosomething
    ...
ZhiyuanLck
  • 212
  • 1
  • 8
  • Just a guess but maybe related to :h Linux-backspace ...? – B Layer Dec 21 '20 at 12:33
  • Other folks have historically had problems with backspace. In addition to the help section above there's :h :fixdel and this from Vim wiki: https://vim.fandom.com/wiki/Backspace_and_delete_problems . ... perhaps some clues can be found there. – B Layer Dec 21 '20 at 12:41
  • @BLayer I have no problem using backspace with vim when editing file. Have you run :py3 print(vim.eval('"\\<bs>"')) and what is the result? – ZhiyuanLck Dec 21 '20 at 13:11
  • @BLayer Thanks for the information you provide and sorry for my word. I do not fill you bothered but want to know that you think the possible reason is more about linux or terminals but not vim itself? This is first time I came with this error. – ZhiyuanLck Dec 21 '20 at 14:40
  • 1
    https://github.com/vim/vim/issues/1053#issuecomment-749006074 – user938271 Dec 21 '20 at 14:42
  • Fixed in 8.2.2178 (as of 22 minutes ago, amazing!) @user938271 please post it as an answer. – filbranden Dec 21 '20 at 15:26
  • Unfortunately, it fixed the issue for some strings but not all apparently. "\<bs>" still raises an error (although a bit different). And the OP is interested in handling a string containing "\<bs>". – user938271 Dec 21 '20 at 15:45

0 Answers0