FittenTech / fittencode.vim

Fitten Code AI Programming Assistant for Vim
63 stars 5 forks source link

fix errors when processing files with backslashes in the path #10

Closed luozhiya closed 3 months ago

luozhiya commented 3 months ago

Problem

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

Steps to reproduce

Solution

Also Fix #4

lzhengning commented 3 months ago

Thank you for your contribution!