Allow callbacks for floating preview popups
I'm not sure if this PR will be useful to anyone else, but I wanted a better way to customize how the floating preview popup was being displayed. The simplest way I could think to do this was to just allow a callback function that could supply custom popup options.
I have added some documentation for this and I am currently using it with vim 8.2. I haven't tried it with neovim but I will assume it doesn't work (I don't use neovim so I can't say for sure).
Just wanted to share :)
Yesssss. I love the floating window but having it in the upper right corner (for example) is way better than covering up the context around the issue. This allows for reasonable defaults but also full customization, love it
This sounds very similar to what #4221 wants to achieve.
@hsanson definitely similar in concept. I'd love to see either change land. I've been using this patch daily for the past month and a half with great results and would love to see it merged
I think this kind of new functionality should be implemented in a way compatible with both vim and neovim. Unfortuntelly I do not have resources (time) to try figuring out a common ground that would allow this to work equally on both.
Also would be nice if we spend some time trying to figure out how to write tests for this functionality to ensure future changes in ALE, vim, or neovim do not break it.
@hsanson I've included changes based on your suggestions. I am not well-versed enough on vim-vader tests to write some otherwise I would be happy to do so. I did, however, add the callback for showing the neovim floating preview. I am not a regular neovim user so it is somewhat difficult to test, but by doing a quick check it appeared to honor my configuration.
CI failed with some linter issues. Please add ale custom linter to your config so vim informs you of these issue:
'vim': ['ale_custom_linting_rules']
@hsanson I've made corrections based on the lint errors. For some reason though adding the vim lint configuration never showed any errors for me. Not sure why. Hopefully I've made the changes correctly.