Skip to content

Commit cbd4a57

Browse files
committed
fixup bufTracker expected type
1 parent fd0f219 commit cbd4a57

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

node/magenta.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ ${lines.join("\n")}
453453
args.length < 3 ||
454454
typeof args[0] !== "string" ||
455455
typeof args[1] !== "string" ||
456-
typeof args[2] !== "string"
456+
typeof args[2] !== "number"
457457
) {
458458
throw new Error(
459459
`Expected buffer tracker args to be [eventType, filePath, bufnr]`,
@@ -473,13 +473,12 @@ ${lines.join("\n")}
473473
}
474474

475475
const absFilePath = args[1] as AbsFilePath;
476-
const bufnr = parseInt(args[2]) as BufNr;
476+
const bufnr = args[2] as BufNr;
477477

478478
magenta.onBufferTrackerEvent(eventType, absFilePath, bufnr);
479479
} catch (err) {
480480
nvim.logger?.error(
481-
`Error handling buffer tracker event for ${JSON.stringify(args)}:`,
482-
err,
481+
`Error handling buffer tracker event for ${JSON.stringify(args)}: ${err instanceof Error ? err.message + "\n" + err.stack : JSON.stringify(err)}`,
483482
);
484483
}
485484
});

0 commit comments

Comments
 (0)