Skip to content

Commit

Permalink
Enclose eventignore restoration in finally
Browse files Browse the repository at this point in the history
  • Loading branch information
uga-rosa committed Dec 8, 2023
1 parent 7c0c493 commit 270df7a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions denops/denippet/snippet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,12 @@ export class Snippet {
async update(tabstop?: number): Promise<void> {
await this.currentNode().updateInput();
const eventignore = await op.eventignore.get(this.denops);
await op.eventignore.set(this.denops, "all");
await this.snippet.updateRange(undefined, tabstop);
await op.eventignore.set(this.denops, eventignore);
try {
await op.eventignore.set(this.denops, "all");
await this.snippet.updateRange(undefined, tabstop);
} finally {
await op.eventignore.set(this.denops, eventignore);
}
// Extmark could disappear with updateRange().
await this.currentNode().setExtmark();
await this.setVar();
Expand Down

0 comments on commit 270df7a

Please sign in to comment.