fix: fix vim extension linebreak bug (#73)

* update

* remove fs
add-more-languages
Meng Zhang 2023-04-09 21:12:18 +08:00 committed by GitHub
parent 5ad9746747
commit 0ddc1bc087
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 5 deletions

View File

@ -244,7 +244,7 @@ function! s:GetPrompt()
let first_line = max([1, line('.') - max_lines])
let lines = getbufline('%', first_line, line('.'))
let lines[-1] = lines[-1][:col('.') - 2]
return join(lines, '\n')
return join(lines, "\n")
endfunction
function! s:GetLanguage()
@ -275,7 +275,7 @@ function! tabby#Show()
if (type(choice.text) != v:t_string) || (len(choice.text) == 0)
return
endif
let lines = split(choice.text, '\\n')
let lines = split(choice.text, "\n")
call prop_add(line('.'), col('.'), #{
\ type: s:prop_type,
\ text: lines[0],

View File

@ -4,7 +4,7 @@
"description": "Tabby client for vim.",
"main": "./dist/tabby.js",
"scripts": {
"watch": "webpack --watch",
"dev": "webpack --watch",
"build": "webpack --mode=production"
},
"devDependencies": {

View File

@ -80,12 +80,17 @@ export class TabbyClient extends EventEmitter {
return this.tabbyServerUrl;
}
public async getCompletion(request: TabbyCompletionRequest): Promise<TabbyCompletion | null> {
public async getCompletion(
request: TabbyCompletionRequest
): Promise<TabbyCompletion | null> {
if (this.status == "disconnected") {
this.ping();
}
try {
const response = await axios.post<TabbyCompletion>(`${this.tabbyServerUrl}/v1/completions`, request);
const response = await axios.post<TabbyCompletion>(
`${this.tabbyServerUrl}/v1/completions`,
request
);
assert(response.status == 200);
return response.data;
} catch (e) {

View File

@ -35,6 +35,7 @@ Below is the URL for your API endpoint.
### Clients
* [Vim](https://github.com/TabbyML/tabby/tree/main/clients/vim)
* [VSCode](https://marketplace.visualstudio.com/items?itemName=TabbyML.vscode-tabby)
""".replace(