-
Notifications
You must be signed in to change notification settings - Fork 15
Floating window for summary pane #67
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
Comments
So I've gone with not adding built-in floating windows but rather leaving the opening of the window to the user to give the most flexibility and to reduce complexity within the plugin (want to avoid more translating between Vim and NeoVim options). To have a floating summary you can do something like this (assuming you're using NeoVim) function M.open_summary()
local round = function (num) return math.floor(num + 0.5) end
vim.api.nvim_open_win(0, true, {
relative = "editor",
row = vim.opt.lines:get() * 0.1,
col = vim.opt.columns:get() * 0.1,
height = round(vim.opt.lines:get() * 0.8),
width = round(vim.opt.columns:get() * 0.8),
border = "rounded",
})
end and then in your config have vim.g.ultest_summary_open = "lua require('<module containing the above function>').open_summary()" |
The above code just opens the summary pane in floating window,
|
let g:ultest_summary_open = 'call nvim_open_win(nvim_get_current_buf(), 1, { "relative" : "editor", "row" : &lines * 0.1, "col": &columns * 0.1, "height": float2nr(round(&lines * 0.8)), "width": float2nr(round(&columns * 0.8)), "border": "rounded" })' |
Nice. Thanks @rcarriga. I appreciate the help.
|
|
That works, Thanks @rcarriga .
|
Sorry @sahilsehwag been quite busy, if some mappings are working then it sounds like a different issue. Can you post the details specified in the bug report template please. Do the tests you're trying to run work as expected when using |
It would be amazing if we could have support for showing summary pane as a floating window, since a lot of times, the test description strings are long. So floating window seems better for those kind of scenarios
The text was updated successfully, but these errors were encountered: