diff options
author | Scott Prager <splinterofchaos@gmail.com> | 2015-04-05 16:07:54 -0400 |
---|---|---|
committer | Scott Prager <splinterofchaos@gmail.com> | 2015-04-05 16:07:54 -0400 |
commit | 013bd4461d95341fbd7c2f742844666a5e966f94 (patch) | |
tree | 5cb65dfa451b69c19e768b0f2fbba434964c8ea3 /src | |
parent | b8ae09b3cf990c9a374a46c644abe0191e09f2f8 (diff) | |
download | rneovim-013bd4461d95341fbd7c2f742844666a5e966f94.tar.gz rneovim-013bd4461d95341fbd7c2f742844666a5e966f94.tar.bz2 rneovim-013bd4461d95341fbd7c2f742844666a5e966f94.zip |
term: use window col offset to calculate width
fixes #2317
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/terminal.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index ed1a8f32b3..136aa0e401 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -338,7 +338,7 @@ void terminal_resize(Terminal *term, uint16_t width, uint16_t height) // terminal in the current tab. FOR_ALL_WINDOWS_IN_TAB(wp, curtab) { if (!wp->w_closing && wp->w_buffer == term->buf) { - width = (uint16_t)MIN(width, (uint16_t)wp->w_width); + width = (uint16_t)MIN(width, (uint16_t)(wp->w_width - win_col_off(wp))); height = (uint16_t)MIN(height, (uint16_t)wp->w_height); } } @@ -358,6 +358,9 @@ void terminal_enter(bool process_deferred) Terminal *term = curbuf->terminal; assert(term && "should only be called when curbuf has a terminal"); + // Ensure the terminal is properly sized. + terminal_resize(term, 0, 0); + checkpcmark(); setpcmark(); int save_state = State; |