aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/drawline.c10
-rw-r--r--src/nvim/ex_getln.c3
-rw-r--r--src/nvim/tag.c9
3 files changed, 15 insertions, 7 deletions
diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c
index 27e1632559..2268a7cd3e 100644
--- a/src/nvim/drawline.c
+++ b/src/nvim/drawline.c
@@ -656,7 +656,15 @@ static void get_statuscol_str(win_T *wp, linenr_T lnum, int virtnum, statuscol_T
wp->w_statuscol_line_count = wp->w_nrwidth_line_count;
set_vim_var_nr(VV_VIRTNUM, 0);
build_statuscol_str(wp, wp->w_nrwidth_line_count, 0, stcp);
- stcp->width += stcp->truncate;
+ if (stcp->truncate > 0) {
+ // Add truncated width to avoid unnecessary redraws
+ int addwidth = MIN(stcp->truncate, MAX_NUMBERWIDTH - wp->w_nrwidth);
+ stcp->truncate = 0;
+ stcp->width += addwidth;
+ wp->w_nrwidth += addwidth;
+ wp->w_nrwidth_width = wp->w_nrwidth;
+ wp->w_valid &= ~VALID_WCOL;
+ }
}
set_vim_var_nr(VV_VIRTNUM, virtnum);
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index ba403e3dd9..f3afbdcaaf 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -4209,7 +4209,8 @@ void f_setcmdline(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
}
}
- rettv->vval.v_number = set_cmdline_str(argvars[0].vval.v_string, pos);
+ // Use tv_get_string() to handle a NULL string like an empty string.
+ rettv->vval.v_number = set_cmdline_str(tv_get_string(&argvars[0]), pos);
}
/// "setcmdpos()" function
diff --git a/src/nvim/tag.c b/src/nvim/tag.c
index 401b43204e..cebc7d5d89 100644
--- a/src/nvim/tag.c
+++ b/src/nvim/tag.c
@@ -3322,11 +3322,10 @@ int get_tags(list_T *list, char *pat, char *buf_fname)
}
for (i = 0; i < num_matches; i++) {
- int parse_result = parse_match(matches[i], &tp);
-
- // Avoid an unused variable warning in release builds.
- (void)parse_result;
- assert(parse_result == OK);
+ if (parse_match(matches[i], &tp) == FAIL) {
+ xfree(matches[i]);
+ continue;
+ }
bool is_static = test_for_static(&tp);