-
Notifications
You must be signed in to change notification settings - Fork 26
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 enbale_start_key_flag #19
base: master
Are you sure you want to change the base?
Conversation
@omrisarig13 Thanks your PR, and so sorry about my late response. I read your PR. |
@simeji - I don't think that this would solve the issue as I have experienced it. In my vim configuration, I wanted to have functionality of this plugin, but I didn't want to have specific mapping that would activated it (I want to activate it manually by the command). However, I you want to avoid the extra key, I can check if the key is empty before mapping it. This should make the error disappear as well. How does that sound? |
@omrisarig13
|
The plugin maps the some keys to run the commands of the plugin automatically by themselves. Until now, those commands were always mapped, regardless of the state of the plugin and the mapping themselves. This caused two problems: * When the plugin was not enabled the mapping still existed. * When the mapping was empty, an error massage was generated. To fix both of those problems, I added two tests before running the mappings: first, it checks that the plugins is indeed enabled, and then it checks that the mapping is not empty. Only in case both of those tests passes, the commands are mapped.
710508f
to
044f327
Compare
@simeji - I just reread my original PR and saw that I was very unclear there about the use case that I thought as a problem. I wanted to have the functionality of the plugin, but I didn't wanted to have a mapping to run it, I wanted to always call it manually (by running the wanted command). To do this, I tried to set the start key to '', but vim raised an error every time I opened it (about having a map command with empty value). The problem you understood might be a problem as well, but it wasn't the one I have experience. To fix both of those problems, and avoid adding any more configuration to the plugin, I added two tests, instead of the one you have proposed. I hope that this fix solves both of the problems. |
Maybe use
|
@simeji - I noticed that there weren't any way to disable the start key of the plugin. Meaning, that the plugin always was remapped to a given key in vim.
I tried to set the key to none (by using
let g:winresizer_start_key = ''
) but then the plugin had an error when it tried to run the nnoremap function.To fix this, I added a new flag to the flags of the plugin - g:winresizer_enable_start_key. This key is on by default, so the behavior of the plugin stays the same. But, if someone wouldn't want the plugin to run over any vim key (like I did), he would be able to do it by setting this flag to 0 (
let g:winresizer_enable_start_key = 0
), and the remap function won't happen.I think I added all the doc needed for the new flag (both in the doc file and in the README file).