Closed smjonas closed 1 year ago
This seems more like an upstream issue: https://github.com/neovim/neovim/issues/20094, closing for now.
That's unfortunate. I do have a hack in place that has fixed some of the title positioning issues https://github.com/stevearc/dressing.nvim/blob/9cdb3e0f0973447b940b35d3175dc780301de427/lua/dressing/util.lua#L104-L106
But as you say it appears to not be working when opened from a "preview" callback. I tried some other basic hacks (vim.schedule_wrap
) but the issue persists. I think we may have to wait for the upstream fix :/
Yes, it's a bit strange that redrawing is completely disabled inside the callback. I'm looking forward to zeertzjq's fix / FFI workaround :D
Describe the bug When using
vim.ui.input
inside a command preview callback, the window title is not immediately positioned at the correct position.System information
To Reproduce Steps to reproduce the behavior:
Define a user command such as the following which calls
vim.ui.input
inside the preview callback:Type![image](https://user-images.githubusercontent.com/40792180/188493007-fa76083b-cd07-402d-885d-8f5c8415756b.png)
:X
. Notice how the title is positioned at the top left of the screen:Type
(space). The title has now moved to the correct position:![image](https://user-images.githubusercontent.com/40792180/188493053-747fd136-da85-4650-bbf2-cfcc9d8b65e1.png)
Additional context It seems like Nvim only executes one "step" of the window creation, while the last "step" of moving the title (which I believe is also a window) is scheduled to run later. Though I'm not exactly sure what causes this (probably somewhere in add_title_to_win).