-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
[BUG] api.uncomment.linewise.*
give error when nothing to uncomment
#221
Comments
I would say that it's not a bug to uncomment a line which is not commented to begin with, but the panic makes it look like one. |
Yeah it's definitely useless, but can happen by mistake.. I think it should just do nothing |
To make this nicer I have to add checks in multiple places that's why left the panic as it is. But I'll think about it as I might also need to handle some other cases as well. |
I have encountered the same issue. |
FYI, extended keybindings are deprecated 20772ed but that is not an excuse to hide the underlying issue which is with API itself. I am going fix the panics sooner or later. |
g<c
give error when nothing to uncommentapi.linewise.comment
give error when nothing to uncomment
api.linewise.comment
give error when nothing to uncommentapi.comment.linewise.*
give error when nothing to uncomment
api.comment.linewise.*
give error when nothing to uncommentapi.uncomment.linewise.*
give error when nothing to uncomment
This adds error handling to the plugin, implemented with the help of `assert` and `xpcall`. Adding explicit error handling for the following cases for now: - Invalid commenstring / Commenting is not supported like `json` - When filetype doesn't support block comments like `yaml` - Graceful handling of certain cases like uncommenting when there is nothing to uncomment. --- fixes #221 supersedes #277
Great, thanks 😀👍 |
Plugin version: 728f38e
Using following config:
Given some file
foo.c
:With the cursor on the line, using
g<c
will give the following error:The text was updated successfully, but these errors were encountered: