Skip to content

Commit

Permalink
Fix triggerForIncomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Mar 11, 2024
1 parent d37dcaa commit 1c5c511
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions denops/ddc/ddc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,16 +282,17 @@ export class Ddc {
? this.#prevResults[s.name]
: null;

const checkCompleteStr = completeStr.length < o.minAutoCompleteLength ||
completeStr.length > o.maxAutoCompleteLength;

const triggerForIncomplete = (checkPrevResult?.isIncomplete ?? false) &&
context.lineNr === checkPrevResult?.lineNr &&
completePos === checkPrevResult?.completePos;
completePos === checkPrevResult?.completePos && !checkCompleteStr;

if (
completePos < 0 ||
(!forceCompletion && !triggerForIncomplete &&
(context.event !== "Manual" && context.event !== "Update") &&
(completeStr.length < o.minAutoCompleteLength ||
completeStr.length > o.maxAutoCompleteLength))
(!forceCompletion && !triggerForIncomplete && checkCompleteStr &&
(context.event !== "Manual" && context.event !== "Update"))
) {
delete this.#prevResults[s.name];
return;
Expand Down

0 comments on commit 1c5c511

Please sign in to comment.