Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dance selection not matching VSCode #331

Open
noonien opened this issue Mar 11, 2024 · 1 comment
Open

Dance selection not matching VSCode #331

noonien opened this issue Mar 11, 2024 · 1 comment

Comments

@noonien
Copy link

noonien commented Mar 11, 2024

Using

    "dance.modes": {
        "normal": {
            "cursorStyle": "block",
            "selectionBehavior": "character",
            "lineNumbers": "off",
            "decorations": {
                "isWholeLine": false,
            },
        },
    },

While the block is selecting the last character, it is not marked as a selection in VScode, this results in some weird behavior:

In the following screenshot, info is selected, but having "Editor: Selection Highlight" enabled, the next occurrence of inf is selected, instead of the complete info:

image

This also means that when double clicking on info, because VScode selects the entire word, Dance also has the closing bracket selected:
image

@71
Copy link
Owner

71 commented Jun 14, 2024

This is done on purpose, though I agree this isn't ideal. The problem is that the VS Code block character appears after the selection; for users that don't use extensions like Dance this is probably fine, but in Dance it is very confusing as you can often perform operations that appear to have the block character selected, when they in fact do not.

When the block cursor is selected, Dance will add +1 to the length of selections when performing actions to account for that block character, but regular VS Code behavior (like highlighting of matches) will behave slightly differently.

For instance, in your first screenshot, pressing d will remove info (which, IMO, makes more sense visually), but VS Code internally thinks that o is not part of the selection.

Some time ago Dance used the native VS Code selection, but this was changed due to how strange it looked to users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants