Skip to content

Commit a14a858

Browse files
committed
Remove changedTick
1 parent d4d36f5 commit a14a858

File tree

3 files changed

+2
-15
lines changed

3 files changed

+2
-15
lines changed

denops/ddc/context.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@ class Custom {
276276
type World = {
277277
bufnr: number;
278278
changedByCompletion: boolean;
279-
changedTick: number;
280279
cursor: (number | undefined)[];
281280
event: DdcEvent;
282281
filetype: string;
@@ -293,7 +292,6 @@ function initialWorld(): World {
293292
return {
294293
bufnr: 0,
295294
changedByCompletion: false,
296-
changedTick: 0,
297295
cursor: [],
298296
event: "Manual",
299297
filetype: "",
@@ -344,15 +342,13 @@ async function cacheWorld(denops: Denops, event: DdcEvent): Promise<World> {
344342

345343
const [
346344
bufnr,
347-
changedTick,
348345
cursor,
349346
iminsert,
350347
isPaste,
351348
lineNr,
352349
wildMenuMode,
353350
] = await collect(denops, (denops) => [
354351
fn.bufnr(denops),
355-
vars.b.get(denops, "changedtick") as Promise<number>,
356352
fn.getcurpos(denops),
357353
op.iminsert.getLocal(denops),
358354
// NOTE: op.paste is deprecated in neovim
@@ -377,7 +373,6 @@ async function cacheWorld(denops: Denops, event: DdcEvent): Promise<World> {
377373
return {
378374
bufnr,
379375
changedByCompletion,
380-
changedTick,
381376
cursor,
382377
event,
383378
filetype,
@@ -424,7 +419,6 @@ export class ContextBuilderImpl implements ContextBuilder {
424419
}
425420

426421
const context = {
427-
changedTick: world.changedTick,
428422
cursor: world.cursor,
429423
event: event,
430424
filetype: world.filetype,

denops/ddc/ddc.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,6 @@ export class Ddc {
519519

520520
await (async function write(ddc: Ddc) {
521521
await batch(denops, async (denops: Denops) => {
522-
await vars.g.set(denops, "ddc#_changedtick", context.changedTick);
523522
await vars.g.set(denops, "ddc#_complete_pos", completePos);
524523
await vars.g.set(denops, "ddc#_items", items);
525524
await vars.g.set(denops, "ddc#_sources", options.sources);
@@ -532,14 +531,9 @@ export class Ddc {
532531
}
533532
})(this);
534533

535-
const changedTick = vars.b.get(denops, "changedtick") as Promise<number>;
534+
const input = denops.call("ddc#util#get_input", context.event);
536535
const mode = fn.mode(denops);
537-
const cursor = fn.getcurpos(denops);
538-
if (
539-
context.changedTick !== await changedTick ||
540-
context.mode !== await mode ||
541-
!equal(context.cursor, await cursor)
542-
) {
536+
if (context.input !== await input || context.mode !== await mode) {
543537
// Input is changed. Skip invalid completion.
544538
await this.hide(denops, context, options);
545539
return;

denops/ddc/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export type SourceName = string;
1616
export type FilterName = string;
1717

1818
export type Context = {
19-
changedTick: number;
2019
cursor: (number | undefined)[];
2120
event: DdcEvent;
2221
filetype: string;

0 commit comments

Comments
 (0)