import { commands, window } from 'vscode';
import * as subwordNavigation from './commands';

export function activate() {
    commands.registerCommand(
        'subwordNavigation.cursorSubwordLeft',
        () => subwordNavigation.cursorSubwordLeft(window.activeTextEditor));

    commands.registerCommand(
        'subwordNavigation.cursorSubwordRight',
        () => subwordNavigation.cursorSubwordRight(window.activeTextEditor));

    commands.registerCommand(
        'subwordNavigation.cursorSubwordLeftSelect',
        () => subwordNavigation.cursorSubwordLeftSelect(window.activeTextEditor));

    commands.registerCommand(
        'subwordNavigation.cursorSubwordRightSelect',
        () => subwordNavigation.cursorSubwordRightSelect(window.activeTextEditor));

    commands.registerCommand(
        'subwordNavigation.deleteSubwordLeft',
        () => subwordNavigation.deleteSubwordLeft(window.activeTextEditor));

    commands.registerCommand(
        'subwordNavigation.deleteSubwordRight',
        () => subwordNavigation.deleteSubwordRight(window.activeTextEditor));
}

import { commands } from 'vscode';
import * as subwordNavigation from './commands';

export function activate() {
    commands.registerTextEditorCommand(
        'subwordNavigation.cursorSubwordLeft',
        subwordNavigation.cursorSubwordLeft);

    commands.registerTextEditorCommand(
        'subwordNavigation.cursorSubwordRight',
        subwordNavigation.cursorSubwordRight);

    commands.registerTextEditorCommand(
        'subwordNavigation.cursorSubwordLeftSelect',
        subwordNavigation.cursorSubwordLeftSelect);

    commands.registerTextEditorCommand(
        'subwordNavigation.cursorSubwordRightSelect',
        subwordNavigation.cursorSubwordRightSelect);

    commands.registerTextEditorCommand(
        'subwordNavigation.deleteSubwordLeft',
        subwordNavigation.deleteSubwordLeft);

    commands.registerTextEditorCommand(
        'subwordNavigation.deleteSubwordRight',
        subwordNavigation.deleteSubwordRight);
}

--- 
+++ 
@@ -1,28 +1,28 @@
-import { commands } from 'vscode';
+import { commands, window } from 'vscode';
 import * as subwordNavigation from './commands';
 
 export function activate() {
-    commands.registerTextEditorCommand(
+    commands.registerCommand(
         'subwordNavigation.cursorSubwordLeft',
-        subwordNavigation.cursorSubwordLeft);
+        () => subwordNavigation.cursorSubwordLeft(window.activeTextEditor));
 
-    commands.registerTextEditorCommand(
+    commands.registerCommand(
         'subwordNavigation.cursorSubwordRight',
-        subwordNavigation.cursorSubwordRight);
+        () => subwordNavigation.cursorSubwordRight(window.activeTextEditor));
 
-    commands.registerTextEditorCommand(
+    commands.registerCommand(
         'subwordNavigation.cursorSubwordLeftSelect',
-        subwordNavigation.cursorSubwordLeftSelect);
+        () => subwordNavigation.cursorSubwordLeftSelect(window.activeTextEditor));
 
-    commands.registerTextEditorCommand(
+    commands.registerCommand(
         'subwordNavigation.cursorSubwordRightSelect',
-        subwordNavigation.cursorSubwordRightSelect);
+        () => subwordNavigation.cursorSubwordRightSelect(window.activeTextEditor));
 
-    commands.registerTextEditorCommand(
+    commands.registerCommand(
         'subwordNavigation.deleteSubwordLeft',
-        subwordNavigation.deleteSubwordLeft);
+        () => subwordNavigation.deleteSubwordLeft(window.activeTextEditor));
 
-    commands.registerTextEditorCommand(
+    commands.registerCommand(
         'subwordNavigation.deleteSubwordRight',
-        subwordNavigation.deleteSubwordRight);
+        () => subwordNavigation.deleteSubwordRight(window.activeTextEditor));
 }
Stop navigation needlessly entering editor history
