comparison src/ex_cmds.c @ 14218:539b070778b0 v8.1.0126

patch 8.1.0126: various problems with 'vartabstop' commit https://github.com/vim/vim/commit/307ac5c68e9e624ab713136d79f35bb73f780d2d Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 28 22:23:00 2018 +0200 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 #3076)
author Christian Brabandt <cb@256bit.org>
date Thu, 28 Jun 2018 22:30:06 +0200
parents f2ab259ef88a
children 90bed90d1130
comparison
equal deleted inserted replaced
14217:30af25836c8d 14218:539b070778b0
864 864
865 if (tabstop_count(old_vts_ary) > 0 || tabstop_count(new_vts_array) > 1) 865 if (tabstop_count(old_vts_ary) > 0 || tabstop_count(new_vts_array) > 1)
866 { 866 {
867 set_string_option_direct((char_u *)"vts", -1, new_ts_str, 867 set_string_option_direct((char_u *)"vts", -1, new_ts_str,
868 OPT_FREE|OPT_LOCAL, 0); 868 OPT_FREE|OPT_LOCAL, 0);
869 vim_free(new_ts_str);
870 curbuf->b_p_vts_array = new_vts_array; 869 curbuf->b_p_vts_array = new_vts_array;
871 vim_free(old_vts_ary); 870 vim_free(old_vts_ary);
872 } 871 }
873 else 872 else
874 { 873 {
875 // 'vartabstop' wasn't in use and a single value was given to 874 // 'vartabstop' wasn't in use and a single value was given to
876 // retab then update 'tabstop'. 875 // retab then update 'tabstop'.
877 curbuf->b_p_ts = tabstop_first(new_vts_array); 876 curbuf->b_p_ts = tabstop_first(new_vts_array);
878 vim_free(new_vts_array); 877 vim_free(new_vts_array);
879 } 878 }
879 vim_free(new_ts_str);
880 } 880 }
881 #else 881 #else
882 curbuf->b_p_ts = new_ts; 882 curbuf->b_p_ts = new_ts;
883 #endif 883 #endif
884 coladvance(curwin->w_curswant); 884 coladvance(curwin->w_curswant);