aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/statusline.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/statusline.c')
-rw-r--r--src/nvim/statusline.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/statusline.c b/src/nvim/statusline.c
index 434d4c8a6f..b8515fa3e2 100644
--- a/src/nvim/statusline.c
+++ b/src/nvim/statusline.c
@@ -772,8 +772,7 @@ void draw_tabline(void)
if (modified || wincount > 1) {
if (wincount > 1) {
- vim_snprintf(NameBuff, MAXPATHL, "%d", wincount);
- int len = (int)strlen(NameBuff);
+ int len = vim_snprintf(NameBuff, MAXPATHL, "%d", wincount);
if (col + len >= Columns - 3) {
break;
}
@@ -798,7 +797,8 @@ void draw_tabline(void)
len -= ptr2cells(p);
MB_PTR_ADV(p);
}
- len = MIN(len, Columns - col - 1);
+ int n = Columns - col - 1;
+ len = MIN(len, n);
grid_line_puts(col, p, -1, attr);
col += len;
@@ -832,7 +832,8 @@ void draw_tabline(void)
// Draw the 'showcmd' information if 'showcmdloc' == "tabline".
if (p_sc && *p_sloc == 't') {
- const int sc_width = MIN(10, (int)Columns - col - (tabcount > 1) * 3);
+ int n = Columns - col - (tabcount > 1) * 3;
+ const int sc_width = MIN(10, n);
if (sc_width > 0) {
grid_line_puts(Columns - sc_width - (tabcount > 1) * 2,