Skip to content

Commit 6bb8b62

Browse files
Merge pull request #317 from gjsjohnmurray/fix-316
fix #316 correct routine names on status bar, and extend from INTs to MACs
2 parents 588b87a + 67c5621 commit 6bb8b62

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/extension.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,13 +442,21 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
442442
});
443443
vscode.window.onDidChangeTextEditorSelection((event: vscode.TextEditorSelectionChangeEvent) => {
444444
posPanel.text = "";
445-
const intMatch = event.textEditor.document.fileName.match(/\/?(.*)\.int$/i);
446-
if (!intMatch || event.selections.length > 1 || !event.selections[0].isEmpty) {
445+
const document = event.textEditor.document;
446+
if (document.languageId !== "objectscript") {
447447
return;
448448
}
449+
if (event.selections.length > 1 || !event.selections[0].isEmpty) {
450+
return;
451+
}
452+
453+
const file = currentFile(document);
454+
const nameMatch = file.name.match(/(.*)\.(int|mac)$/i);
455+
if (!nameMatch) {
456+
return;
457+
}
458+
const [, routine] = nameMatch;
449459
const line = event.selections[0].start.line;
450-
const [, routine] = intMatch;
451-
const { document } = event.textEditor;
452460
let label = "";
453461
let pos = 0;
454462
for (let i = line; i > 0; i--) {

0 commit comments

Comments
 (0)