nvim-neotest / neotest

An extensible framework for interacting with tests within NeoVim.
MIT License
2.26k stars 110 forks source link

Weird cursor position in output buf when test result is short #266

Open scottming opened 1 year ago

scottming commented 1 year ago

This is my test output

image

This is the test output buf:

image

My expectation is that the cursor can move to the first line, and also, the height and width of float do not need to be so big.

I have checked this function: https://github.com/nvim-neotest/neotest/blob/master/lua/neotest/consumers/output.lua#L41, but I don't know the specific reason, my lines variable is: { "Test passed in 0.00ms"}

image
scottming commented 1 year ago

ok, if my lines is { "Test passed in 0.00ms", ""}, I can fix the cursor position error, but the buffer size issue still exists.

scottming commented 1 year ago

Furthermore, I think the windows displayed by these two commands are very different. I suggest keeping them consistent.

<cmd>lua require('neotest').run.run()<cr>

image

<cmd>lua require("neotest").output.open({ enter = true })<cr>

image