aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2019-11-15 13:03:25 +0900
committerBjörn Linse <bjorn.linse@gmail.com>2020-01-17 11:36:28 +0100
commit7aff0340e1f0550ff1c04dc17474d7cb6e57a89b (patch)
tree0bb63c42374d65edd0b7352111ef6aeafed500d5
parented37d1081c8adbd33832b4140ba5368fa876bdb8 (diff)
downloadrneovim-7aff0340e1f0550ff1c04dc17474d7cb6e57a89b.tar.gz
rneovim-7aff0340e1f0550ff1c04dc17474d7cb6e57a89b.tar.bz2
rneovim-7aff0340e1f0550ff1c04dc17474d7cb6e57a89b.zip
Move ConPTY resize to os_win_conpty.c
-rw-r--r--src/nvim/os/os_win_conpty.c14
-rw-r--r--src/nvim/os/pty_process_win.c9
2 files changed, 14 insertions, 9 deletions
diff --git a/src/nvim/os/os_win_conpty.c b/src/nvim/os/os_win_conpty.c
index 9c6b7ad40f..bf6ec62818 100644
--- a/src/nvim/os/os_win_conpty.c
+++ b/src/nvim/os/os_win_conpty.c
@@ -166,7 +166,19 @@ bool os_conpty_spawn(conpty_t *conpty_object, HANDLE *process_handle,
return true;
}
-void os_conpty_free(conpty_t * conpty_object)
+void os_conpty_set_size(conpty_t *conpty_object,
+ uint16_t width, uint16_t height)
+{
+ assert(width <= SHRT_MAX);
+ assert(height <= SHRT_MAX);
+ COORD size = { (int16_t)width, (int16_t)height };
+ if (pResizePseudoConsole(conpty_object->pty, size) != S_OK) {
+ ELOG("ResizePseudoConsoel failed: error code: %d",
+ os_translate_sys_error((int)GetLastError()));
+ }
+}
+
+void os_conpty_free(conpty_t *conpty_object)
{
if (conpty_object != NULL) {
if (conpty_object->si_ex.lpAttributeList != NULL) {
diff --git a/src/nvim/os/pty_process_win.c b/src/nvim/os/pty_process_win.c
index 0fbe3e5fad..ffdececf94 100644
--- a/src/nvim/os/pty_process_win.c
+++ b/src/nvim/os/pty_process_win.c
@@ -231,14 +231,7 @@ void pty_process_resize(PtyProcess *ptyproc, uint16_t width,
{
if (ptyproc->type == PTY_TYPE_CONPTY
&& ptyproc->object.conpty != NULL) {
- assert(width <= SHRT_MAX);
- assert(height <= SHRT_MAX);
- COORD size = { (int16_t)width, (int16_t)height };
- if (pResizePseudoConsole(
- ptyproc->object.conpty->pty, size) != S_OK) {
- ELOG("ResizePseudoConsoel failed: error code: %d",
- os_translate_sys_error((int)GetLastError()));
- }
+ os_conpty_set_size(ptyproc->object.conpty, width, height);
} else if (ptyproc->object.winpty != NULL) {
winpty_set_size(ptyproc->object.winpty, width, height, NULL);
}