Skip to content

Commit

Permalink
fix(native): checkComplete for file/buffer/around
Browse files Browse the repository at this point in the history
  • Loading branch information
fannheyward committed Oct 24, 2023
1 parent e3f91b5 commit 89ef0cf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/completion/native/around.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export class Around extends Source {
}

public async doComplete(opt: CompleteOption, token: CancellationToken): Promise<CompleteResult<ExtendedCompleteItem>> {
const shouldRun = await this.checkComplete(opt)
if (!shouldRun) return null
let { bufnr, input, word, linenr, triggerForInComplete } = opt
if (input.length === 0) return null
let buf = this.keywords.getItem(bufnr)
Expand Down
2 changes: 2 additions & 0 deletions src/completion/native/buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export class Buffer extends Source {
}

public async doComplete(opt: CompleteOption, token: CancellationToken): Promise<CompleteResult<ExtendedCompleteItem>> {
const shouldRun = await this.checkComplete(opt)
if (!shouldRun) return null
let { bufnr, input, word, triggerForInComplete } = opt
if (input.length === 0) return null
await waitImmediate()
Expand Down
2 changes: 2 additions & 0 deletions src/completion/native/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ export class File extends Source {
}

public async doComplete(opt: CompleteOption, token: CancellationToken): Promise<CompleteResult<ExtendedCompleteItem>> {
const shouldRun = await this.checkComplete(opt)
if (!shouldRun) return null
let { filepath } = opt
let option = this.getPathOption(opt)
if (!option || option.startcol < opt.col) return null
Expand Down

0 comments on commit 89ef0cf

Please sign in to comment.