From 89ef0cf7ec71ba043e616c9620553e6f0a3e61b5 Mon Sep 17 00:00:00 2001 From: Heyward Fann Date: Tue, 24 Oct 2023 09:13:12 +0800 Subject: [PATCH] fix(native): checkComplete for file/buffer/around --- src/completion/native/around.ts | 2 ++ src/completion/native/buffer.ts | 2 ++ src/completion/native/file.ts | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/completion/native/around.ts b/src/completion/native/around.ts index ec1538b7082..06e1c0bc06a 100644 --- a/src/completion/native/around.ts +++ b/src/completion/native/around.ts @@ -12,6 +12,8 @@ export class Around extends Source { } public async doComplete(opt: CompleteOption, token: CancellationToken): Promise> { + 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) diff --git a/src/completion/native/buffer.ts b/src/completion/native/buffer.ts index ebd7cd91a40..73ca2bdaa02 100644 --- a/src/completion/native/buffer.ts +++ b/src/completion/native/buffer.ts @@ -16,6 +16,8 @@ export class Buffer extends Source { } public async doComplete(opt: CompleteOption, token: CancellationToken): Promise> { + const shouldRun = await this.checkComplete(opt) + if (!shouldRun) return null let { bufnr, input, word, triggerForInComplete } = opt if (input.length === 0) return null await waitImmediate() diff --git a/src/completion/native/file.ts b/src/completion/native/file.ts index 9eff6dffdde..a8e61f30821 100644 --- a/src/completion/native/file.ts +++ b/src/completion/native/file.ts @@ -146,6 +146,8 @@ export class File extends Source { } public async doComplete(opt: CompleteOption, token: CancellationToken): Promise> { + 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