coolwanglu / neovim-e

Electron UI for Neovim
MIT License
271 stars 29 forks source link

in Windows the window resizes to minimal size on its own #16

Closed jmlucjav closed 9 years ago

jmlucjav commented 9 years ago

Hi,

I tried to run this on windows. I was more or less successful, but found one weird issue for now. First a big caveat, I am not comfortable in the js/coffescript world, so not sure if I did everything as needed, probably screwed up somewhere...

What I did was:

This successfully launches neovim.as with nvim. But the window resizes by itself most of the time time it is tiny, see the video here: http://tinypic.com/player.php?v=2wgxb1c&s=8#.VOmxqVXF-zY

Other than that, seem usable, I can enter insert mode etc.

coolwanglu commented 9 years ago

I see, something still wrong with the resize event handler.

rygwdn commented 9 years ago

@coolwanglu that looks similar to something I saw while working on #13. I suspect that what's happening is:

This is not a problem for OS X (and I assume Linux?), but if the calculation of window size in nv_size produces a window that's too small, then it will trigger a loop that keeps reducing the rows/cols until it hits a minimum size.

13 may fix this (I changed the conditions under which nv_resize calls window.resizeTo)

jmlucjav commented 9 years ago

@rygwdn , I tried to manually apply your change locally, but get a compilation failure:

In file: src/nvim/ui.coffee On line: 95 if not @resize_timer ^ Warning: CoffeeScript failed to compile. Use --force to continue.

So I just commented out the line with the if (first time I look at coffescript code so not much else I can do). Tested and now I don't get the previous behavior.

rygwdn commented 9 years ago

@jmlucjav: #13 was merged, can you try master again?

jmlucjav commented 9 years ago

I just tested 2d3fc60d8768961a921bb526a71b05a91b73172a and the weird behaviour is gone. Also, I can resize the window, and it works.

Next issue I see:

I have not tried loadding my _vimrc yet, will try another time.

jmlucjav commented 9 years ago

should I close this and open a new issue or we can reuse this for 'all things Windows'?

coolwanglu commented 9 years ago

@jmlucjav Please create a new issue for this, thanks!