rcarriga / vim-ultest

The ultimate testing plugin for (Neo)Vim
MIT License
385 stars 15 forks source link

Set popup window height #103

Open cd-a opened 2 years ago

cd-a commented 2 years ago

I can't find a way to adjust the height of the popup window.

For example when I do either of those 2:

<Plug>(ultest-output-show)
<Plug>(ultest-attach)

The popup is just 20 lines high, which isn't really enough.

Is there a config option for that which I have overlooked?

wookayin commented 2 years ago

Relevant lines: autoload/ultest/output.vim, function s:NvimOpenFloat. There is no such options yet and it is simply set to the content height. Some options like max_height should be added.

rcarriga commented 2 years ago

I've added in config variables to control the window size. Please try the latest commit

                                                   *g:ultest_output_max_width*
Max width of the output window (default: 0)

                                                  *g:ultest_output_max_height*
Max height of the output window (default: 0)

                                                   *g:ultest_output_min_width*
Min width of the output window (default: 0)

                                                  *g:ultest_output_min_height*
Min height of the output window (default: 0)
cd-a commented 2 years ago

@rcarriga Thanks for taking this on, appreciate it.

A few things I noticed:

  1. The default width/height should probably be changed, without any settings it's just 20 wide. But that might also be because of the second point below
Screenshot 2022-02-19 at 10 50 23
  1. The width can not be higher than the height for some reason.
let g:ultest_output_min_width = 70
let g:ultest_output_max_width = 70 
let g:ultest_output_min_height = 10

This results in a 10:10 window

Screenshot 2022-02-19 at 10 59 13

Using the max here for the width has no effect. So the width seems to have the height as the upper boundary

When I set the height to 20 and keep width at 70, it is now 20:20

rcarriga commented 2 years ago

That's what happens when dealing with long and similar variable names :sweat_smile: Please try latest, should be working now

cd-a commented 2 years ago

Thank you so much, it works now, very cool!

One last thing: Is it possible to adjust the window distance at the bottom?

Screenshot 2022-02-19 at 12 53 09

My commandline is 2 lines high, and above that there is the status line. If I could add 2 extra lines distance then it would not clip. Is that possible?