diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-06-29 15:23:24 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-06-29 15:25:06 -0400 |
commit | d723e7fd61d48b037a2b8360162efa1cddad64d2 (patch) | |
tree | 51b0157ceb67a1fcb79776dbb36866beaf3502c1 | |
parent | 2ddeb74202633784b9ebb4b963e2df06ed7332df (diff) | |
download | rneovim-d723e7fd61d48b037a2b8360162efa1cddad64d2.tar.gz rneovim-d723e7fd61d48b037a2b8360162efa1cddad64d2.tar.bz2 rneovim-d723e7fd61d48b037a2b8360162efa1cddad64d2.zip |
keep statusline within window width. @oni-link fix #858
PR #866
ref #858
-rw-r--r-- | src/nvim/screen.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 54dcaff39e..67e00d6a27 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -5099,7 +5099,7 @@ win_redr_custom ( curattr = attr; p = buf; for (n = 0; hltab[n].start != NULL; n++) { - len = (int)(hltab[n].start - p); + int len = (int)(hltab[n].start - p); screen_puts_len(p, len, row, col, curattr); col += vim_strnsize(p, len); p = hltab[n].start; @@ -5113,7 +5113,8 @@ win_redr_custom ( else curattr = highlight_user[hltab[n].userhl - 1]; } - screen_puts(p, row, col, curattr); + // Make sure to use an empty string instead of p, if p is beyond buf + len. + screen_puts(p >= buf + len ? (char_u *)"" : p, row, col, curattr); if (wp == NULL) { /* Fill the TabPageIdxs[] array for clicking in the tab pagesline. */ |