When opening a file by dragging in Windows, fittencode.vim will report an error.
The log is as follows
Messages maintainer: The Vim Project
"C:\Hello" 0L, 0B
Error detected while processing function CodeCompletion:
line 58:
E716: Key not present in Dictionary: "generated_text"
line 59:
E121: Undefined variable: l:generated_text
E116: Invalid arguments for function substitute(l:generated_text, '<.endoftext.>', '', 'g')
line 61:
E121: Undefined variable: l:generated_text
E116: Invalid arguments for function empty(l:generated_text)
line 67:
E121: Undefined variable: l:generated_text
E116: Invalid arguments for function split(l:generated_text, "\n", 1)
line 68:
E121: Undefined variable: l:text
E116: Invalid arguments for function empty(l:text[-1])
line 73:
E121: Undefined variable: text
line 85:
E121: Undefined variable: l:generated_text
Problem
When opening a file by dragging in Windows,
fittencode.vim
will report an error.The log is as follows
Steps to reproduce
fittencode.vim
C:\Hello
to the gvim window<c-l>
{'detail': [{'ctx': {'error': 'Invalid \escape'}, 'type': 'json_invalid', 'msg': 'JSON decode error', 'input': {}, 'loc': ['body', 75]}]}
Solution
filename
completion_data
containsgenerated_text
fieldsAlso Fix #4