Skip to content

Commit

Permalink
perf(handler): cancel symbols request on InsertEnter
Browse files Browse the repository at this point in the history
  • Loading branch information
chemzqm committed Jun 8, 2021
1 parent 1c39d51 commit c1bf9a1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/handler/symbols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export default class Symbols {
if (!this.functionUpdate || this.buffers.getItem(bufnr) == null) return
await this.getCurrentFunctionSymbol(bufnr)
}, null, this.disposables)
events.on('InsertEnter', (bufnr: number) => {
let buf = this.buffers.getItem(bufnr)
if (buf) buf.cancel()
}, null, this.disposables)
}

public get functionUpdate(): boolean {
Expand Down

0 comments on commit c1bf9a1

Please sign in to comment.