vim-patch:8.1.0126: various problems with 'vartabstop'

Problem:    Various problems with 'vartabstop'.
Solution:   Fix memory leak.  Fix crash. Add a few more tests. (Christian
            Brabandt, closes vim/vim#3076)
307ac5c68e
This commit is contained in:
VVKot
2021-01-31 17:19:39 +00:00
parent 7ee09c61fe
commit 2922f6e34b
4 changed files with 32 additions and 9 deletions

View File

@@ -853,7 +853,6 @@ void ex_retab(exarg_T *eap)
if (tabstop_count(old_vts_ary) > 0 || tabstop_count(new_vts_array) > 1) {
set_string_option_direct("vts", -1, new_ts_str,
OPT_FREE | OPT_LOCAL, 0);
xfree(new_ts_str);
curbuf->b_p_vts_array = new_vts_array;
xfree(old_vts_ary);
} else {
@@ -862,6 +861,7 @@ void ex_retab(exarg_T *eap)
curbuf->b_p_ts = tabstop_first(new_vts_array);
xfree(new_vts_array);
}
xfree(new_ts_str);
}
coladvance(curwin->w_curswant);