keep statusline within window width. @oni-link fix #858

PR #866
ref #858
This commit is contained in:
Justin M. Keyes
2014-06-29 15:23:24 -04:00
parent 2ddeb74202
commit d723e7fd61

View File

@@ -5099,7 +5099,7 @@ win_redr_custom (
curattr = attr; curattr = attr;
p = buf; p = buf;
for (n = 0; hltab[n].start != NULL; n++) { 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); screen_puts_len(p, len, row, col, curattr);
col += vim_strnsize(p, len); col += vim_strnsize(p, len);
p = hltab[n].start; p = hltab[n].start;
@@ -5113,7 +5113,8 @@ win_redr_custom (
else else
curattr = highlight_user[hltab[n].userhl - 1]; 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) { if (wp == NULL) {
/* Fill the TabPageIdxs[] array for clicking in the tab pagesline. */ /* Fill the TabPageIdxs[] array for clicking in the tab pagesline. */