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

Add mode parameter for command #3

Open
fpohtmeh opened this issue Oct 16, 2024 · 1 comment
Open

Add mode parameter for command #3

fpohtmeh opened this issue Oct 16, 2024 · 1 comment

Comments

@fpohtmeh
Copy link

Add mode parameter for command.

  • Normal is the default value.
  • {"n", "v"} for commands which work in both modes
  • Commands are hidden if they aren't supported in the current mode. Or the user gets a notification if he uses a command in the wrong mode. 2nd is better IMO because the user still sees the full list of commands

Reason:

  • Some commands make a mess if a visual selection is empty. For example: sort
@DanWlker
Copy link
Owner

DanWlker commented Oct 17, 2024

I thought about this for a while. This is implementable, but I don't think its necessary.

When you're in visual mode and press :, it auto shows visual selection, then you can type in your command. If you don't want a visual selection then you should not select in the first place, and the command should error.

The current behavior now is in line with the default neovim behavior. Therefore I am probably not going to add something that has a different default behavior from what neovim does. It would also have the benefit of being somewhat consistent and easy to debug for the end user.

However, I will keep this open as i think i need some time to think about it as well.

Thank you for the suggestion.

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