1
1
mirror of https://github.com/qvacua/vimr.git synced 2024-11-24 03:25:03 +03:00

Resize neovim when resized not by live resizing

This commit is contained in:
Tae Won Ha 2016-07-06 19:11:53 +02:00
parent 670c19043c
commit 4075b49fa7
No known key found for this signature in database
GPG Key ID: E40743465B5B8B44

View File

@ -108,16 +108,24 @@ public class NeoVimView: NSView {
Swift.print(self.grid)
}
// override public func setFrameSize(newSize: NSSize) {
// super.setFrameSize(newSize)
//
// // initial resizing is done when grid has data
// guard self.grid.hasData else {
// return
// }
//
// self.resizeNeoVimUiTo(size: newSize)
// }
override public func setFrameSize(newSize: NSSize) {
super.setFrameSize(newSize)
// initial resizing is done when grid has data
guard self.grid.hasData else {
return
}
if self.inLiveResize {
// TODO: Turn of live resizing for now.
// self.resizeNeoVimUiTo(size: newSize)
return
}
// There can be cases where the frame is resized not by live resizing, eg when the window is resized by window
// management tools. Thus, we make sure that the resize call is made when this happens.
self.resizeNeoVimUiTo(size: newSize)
}
override public func viewDidEndLiveResize() {
super.viewDidEndLiveResize()