hellokidder / cursor-dance

Apache License 2.0
0 stars 0 forks source link

Multi cursor support #1

Closed kassu11 closed 2 days ago

kassu11 commented 2 days ago

I noticed that ctrl+shift+o breaks if you have multiple cursors. Here is a quick example fix to add multi-cursor support.

const swapCursor = () => {
  try {
    const editor = vscode.window.activeTextEditor;
    if (editor) {
      editor.selections = editor.selections.map(selection => {
        if (!selection.isEmpty) {
          return new vscode.Selection(
            selection.active,
            selection.anchor
          );
        }

        return selection;
      });
    }
  } catch (err) {
    vscode.window.showErrorMessage(
      "An error occurred during command execution. Please check the console for details."
    );
  }
};
hellokidder commented 2 days ago

ok! thank you && I have fixed it in V0.0.4