ale icon indicating copy to clipboard operation
ale copied to clipboard

Allow callbacks for floating preview popups

Open shaunduncan opened this issue 3 years ago • 2 comments

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 :)

shaunduncan avatar Jul 08 '22 02:07 shaunduncan

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

michaelorr avatar Jul 08 '22 02:07 michaelorr

This sounds very similar to what #4221 wants to achieve.

hsanson avatar Jul 12 '22 12:07 hsanson

@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

michaelorr avatar Aug 15 '22 13:08 michaelorr

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 avatar Aug 16 '22 12:08 hsanson

@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.

shaunduncan avatar Aug 17 '22 03:08 shaunduncan

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 avatar Aug 20 '22 00:08 hsanson

@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.

shaunduncan avatar Aug 22 '22 13:08 shaunduncan