mirror of https://github.com/onivim/oni.git
Fixed problem when some visual artifacts may appear after resize (#2578)
This commit is contained in:
parent
1987c9fb06
commit
5c9a9cd05e
|
@ -64,7 +64,8 @@ export class NeovimRenderer extends React.PureComponent<INeovimRendererProps, {}
|
|||
const width = this._element.offsetWidth
|
||||
const height = this._element.offsetHeight
|
||||
|
||||
this.props.neovimInstance.resize(width, height)
|
||||
this.props.renderer.redrawAll(this.props.screen)
|
||||
this.props.neovimInstance
|
||||
.resize(width, height)
|
||||
.then(() => this.props.renderer.redrawAll(this.props.screen))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -683,13 +683,13 @@ export class NeovimInstance extends EventEmitter implements INeovimInstance {
|
|||
})
|
||||
}
|
||||
|
||||
public resize(widthInPixels: number, heightInPixels: number): void {
|
||||
public resize(widthInPixels: number, heightInPixels: number): Promise<{}> {
|
||||
this._lastWidthInPixels = widthInPixels
|
||||
this._lastHeightInPixels = heightInPixels
|
||||
|
||||
const size = this._getSize()
|
||||
|
||||
this._resizeInternal(size.rows, size.cols)
|
||||
return this._resizeInternal(size.rows, size.cols)
|
||||
}
|
||||
|
||||
public async getApiVersion(): Promise<INeovimApiVersion> {
|
||||
|
@ -742,7 +742,7 @@ export class NeovimInstance extends EventEmitter implements INeovimInstance {
|
|||
})
|
||||
}
|
||||
|
||||
private _resizeInternal(rows: number, columns: number): void {
|
||||
private _resizeInternal(rows: number, columns: number): Promise<{}> {
|
||||
if (this._configuration.hasValue("debug.fixedSize")) {
|
||||
const fixedSize = this._configuration.getValue("debug.fixedSize")
|
||||
rows = fixedSize.rows
|
||||
|
@ -751,7 +751,7 @@ export class NeovimInstance extends EventEmitter implements INeovimInstance {
|
|||
}
|
||||
|
||||
if (rows === this._rows && columns === this._cols) {
|
||||
return
|
||||
return Promise.resolve({})
|
||||
}
|
||||
|
||||
this._rows = rows
|
||||
|
@ -760,10 +760,10 @@ export class NeovimInstance extends EventEmitter implements INeovimInstance {
|
|||
// If _initPromise isn't initialized, it means the UI hasn't attached to NeoVim
|
||||
// yet. In that case, we don't need to call uiTryResize
|
||||
if (!this._initPromise) {
|
||||
return
|
||||
return Promise.resolve({})
|
||||
}
|
||||
|
||||
this._initPromise.then(() => {
|
||||
return this._initPromise.then(() => {
|
||||
return this._neovim.request("nvim_ui_try_resize", [columns, rows])
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue