Closed xelra closed 3 years ago
I can confirm this, we just discussed it in https://www.reddit.com/r/neovim/comments/5xm887/neovimqt_wont_read_my_configuration_files/
No idea what is going on there, the default behaviour should be to set the window to about 2/3 of the widht/height. But it sometime gets a lot smaller.
Same issue: Windows 10 v1607, neovim v0.2.0.855 64 bit, nvim-qt v0.2.6... I think :) I actually don't know how to see the version number of nvim-qt!
Having invalid settings in init.vim
can cause this (tiny window), try typing nvim
in bash (instead of launching it from a icon) to see if any errors are printed.
I have the same problem using arch-linux. Starting nvim-qt from the command line does not show any errors. I think it happens when the content is not loaded fast enough. For example when using a sftp mount.
It's possible to impose the window size through the command line flag --geometry (width)x(height)
For example $ nvim-qt --geometry 1400x900
I've defined an alias of nvim-qt in my .bashrc
@feanor12 I made a mistake in my previous comment, typing nvim
instead of nvim-qt
in the command line, I've corrected it.
@qwfy nvim
does not create any errors on the command line, either.
I experince very similar issue as @xelra. On my Windows 10 machine (freshly installed and updated) nvim
always starts with a tiny window as @xelra showed disregarding whether it's a first execution or not after startup and disregarding whether it's plain execution from using a double click directly on the bundled nvim-qt.exe
file or whether it's executed by Windows 10 when clicking on a text file associated (based on the file extension - you know the Windows way of handling "mime types") with nvim-qt.exe
.
In ginit.vim
file, add call rpcnotify(0, 'Gui', 'WindowMaximized', 1)
, can show maximized!
In my case it was an echom
command in my init.vim
file that prevented the window from reaching its size.
Edit: It really seems to be caused by any message during startup for me.
I have the same issue. Seems more common when I have an external monitor (in my case I have a different ratio for enlarging applications for hiDPI)
I've had similar issue when on windows 10. My issue seemed to be plugins that had unmet requirement in regards to what flags nvim was compiled with. By disabling the plugins, the window opens in a proper size.
I had the same problem and it ended up being caused by the YouCompleteMe plugin which wasn't starting up properly because I hadn't configured the Python provider yet.
But this bug is actually probably a symptom of another bug related to startup error messages. It's easy to recreate by doing something simple like setting colorscheme
to something bad. nvim-qt.exe
will start up with a tiny window (and broken colours of course) but no error messages. On the other hand nvim.exe
will show the error messages but fail to start and has to be killed.
I'm running into this problem here on Mageia Linux v7 using the Plasma 5 desktop and latest nvim and nvim-qt. I can reproduce it all the time by issuing nvim-qt +mak
.
hey, I have a temporary solution as follows
if !has('nvim') | finish | endif
fun! s:set_size(...)
py3 << EOF
from ctypes import *
u32 = WinDLL('user32.dll')
# Fix me
LEFT = 160
TOP = 50
WIDTH = 888
HEIGHT = 666
GetForegroundWindow = u32.GetForegroundWindow
GetSystemMetrics = u32.GetSystemMetrics
SetWindowPos = u32.SetWindowPos
cw = GetForegroundWindow()
SetWindowPos(cw, 0, LEFT, TOP, WIDTH, HEIGHT, 0)
EOF
endf
fun! s:start()
" call timer_start(50, funcref('s:set_size'))
call s:set_size()
endf
au GUIEnter * call <sid>start()
:o GUIEnter
should not even be called in nvim. @luzhlon is s:start() getting called?
@equalsraf thanks.
I added doautocmd GUIEnter
in my ginit.vim 😀
Was it working before? It might just work as a side effect of waiting for the python provider to load.
I get the exact same problem but only calling neovim-qt <some file>
and only on Windows.
I'm new to neovim-qt
, I added --maximized
to nvim-qt.desktop
in order to have it start always maximized but sometimes the window appears small after startup and looks like it's chopped off (can't see what commands I'm typing):
Edit:
It happens even if not using the desktop file, when simply running nvim-qt --maximized
from the terminal.
Modified the code @luzhlon posted to correctly center windows on different resolution monitors and to also scale the size based on the resolution.
The code is rather large so I put it in a gist.
@AdnoC It's too complicated, but it is more perfect as well.
@luzhlon True enough. Removing the pid stuff and just grabbing the foreground window makes it a bit more reasonable.
Problem was that I opened vim and clicked something else while it was opening, which caused that thing's window to be resized instead of nvim's.
On Windows 10 you should use -qwindowgeometry 1030x608
you can create a shortcut for nvim-qt.vim and change the target to something like C:\tools\neovim\Neovim\bin\nvim-qt.exe -qwindowgeometry 1030x608
and the window becomes the size you specified.
thanks to @Himura2la
/Applications/nvim-qt.app/Contents/MacOS/nvim-qt --qwindowgeometry 6x4
opens it on maximum
We now store the window size on close, and restore on open.
This issue should not occur anymore. Marking as closed.
This issue is constant when running in Windows Sandbox (which I use a lot for testing and development). I do not see this issue anywhere else. Can you see from the work on the fix above a way to fix the "tiny-window glitch" for neovim running in a Windows Sandbox container?
This might be specific to Windows.
Sometimes the Neovim-Qt window is really small after starting it. It's hard to predict when it will happen, but it's more likely to happen on the first startup after a reboot. It never happens for consecutive startups.
This is how it looks:
Then I just close the window and start Neovim-Qt again: