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

wip: allow ordinary menus #353

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jwhitaker-gridcog
Copy link

@jwhitaker-gridcog jwhitaker-gridcog commented Dec 17, 2024

Heya, thanks for maintaining this.

When playing with Strackeror's great Helix mode contribution, I was having trouble getting a command-hx menu to feel right due to the single hot key system. E.g. distilled to a three item menu, "fmt / Format", "w / Write", and "wbc / Write and Close", w and wbc can't be distinguished in the current system.

As a proof of concept, I wondered if menus could have a menu_type: "hotkey" (current behaviour, and default) or alternatively a menu_type: "palette", which is just a stock-standard vscode quickpick. Palette menus don't have the hotkey system but can just use vscode's already great type/select system which I've been using locally quite happily.

Demo:

Kooha-2024-12-18-08-42-33.webm.mp4
From menus config:
    "dance.menus": {
        "leader-hx": {
            "title": "Space",
            "items": {
                "f": {
                    "text": "Open file picker",
                    "command": "workbench.action.quickOpen"
                }
            }
        },
        "command-hx": {
            "title": "Helix command mode",
            "menu_type": "palette",
            "items": {
                "fmt": {
                    "text": "format",
                    "command": "editor.action.formatDocument"
                },
                "w": {
                    "text": "write",
                    "command": "workbench.action.files.save"
                },
                // "wbc": {
                //     "text": "write-buffer-close",
                //     "command": "dance.run",
                //     "args": [
                //         {
                //             "commands": [
                //                 "workbench.action.files.save",
                //                 "workbench.action.closeeditor"
                //             ]
                //         }
                //     ]
                // }
            }
        }
    },

This probably isn't wired up the best way, but was hoping to get some feedback on if this would be accepted in principal or not before fiddling further.

Thanks!

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

Successfully merging this pull request may close these issues.

1 participant