Mercurial > vim
comparison src/screen.c @ 29098:cff23287478f v8.2.5070
patch 8.2.5070: unnecessary code
Commit: https://github.com/vim/vim/commit/b5f0801b1f043b5cf99380f58eca51b75b3236c7
Author: zeertzjq <zeertzjq@outlook.com>
Date: Thu Jun 9 13:55:28 2022 +0100
patch 8.2.5070: unnecessary code
Problem: Unnecessary code.
Solution: Remove code that isn't needed. (closes https://github.com/vim/vim/issues/10534)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 09 Jun 2022 15:00:07 +0200 |
parents | 9b292596a332 |
children | aea330cb546f |
comparison
equal
deleted
inserted
replaced
29097:8d1d4ddbc7ab | 29098:cff23287478f |
---|---|
4902 | 4902 |
4903 if (varp == &p_lcs || varp == &wp->w_p_lcs) | 4903 if (varp == &p_lcs || varp == &wp->w_p_lcs) |
4904 { | 4904 { |
4905 lcs_chars.tab1 = NUL; | 4905 lcs_chars.tab1 = NUL; |
4906 lcs_chars.tab3 = NUL; | 4906 lcs_chars.tab3 = NUL; |
4907 | |
4907 if (multispace_len > 0) | 4908 if (multispace_len > 0) |
4908 { | 4909 { |
4909 lcs_chars.multispace = ALLOC_MULT(int, multispace_len + 1); | 4910 lcs_chars.multispace = ALLOC_MULT(int, multispace_len + 1); |
4910 lcs_chars.multispace[multispace_len] = NUL; | 4911 lcs_chars.multispace[multispace_len] = NUL; |
4911 } | 4912 } |
5026 && p[len2 + 1] != NUL) | 5027 && p[len2 + 1] != NUL) |
5027 { | 5028 { |
5028 s = p + len2 + 1; | 5029 s = p + len2 + 1; |
5029 if (round == 0) | 5030 if (round == 0) |
5030 { | 5031 { |
5031 // Get length of lcsmultispace string in first round | 5032 // get length of lcs-leadmultispace string in first |
5033 // round | |
5032 last_lmultispace = p; | 5034 last_lmultispace = p; |
5033 lead_multispace_len = 0; | 5035 lead_multispace_len = 0; |
5034 while (*s != NUL && *s != ',') | 5036 while (*s != NUL && *s != ',') |
5035 { | 5037 { |
5036 c1 = get_encoded_char_adv(&s); | 5038 c1 = get_encoded_char_adv(&s); |
5037 if (char2cells(c1) > 1) | 5039 if (char2cells(c1) > 1) |
5038 return e_invalid_argument; | 5040 return e_invalid_argument; |
5039 ++lead_multispace_len; | 5041 ++lead_multispace_len; |
5040 } | 5042 } |
5041 if (lead_multispace_len == 0) | 5043 if (lead_multispace_len == 0) |
5042 // lcsmultispace cannot be an empty string | 5044 // lcs-leadmultispace cannot be an empty string |
5043 return e_invalid_argument; | 5045 return e_invalid_argument; |
5044 p = s; | 5046 p = s; |
5045 } | 5047 } |
5046 else | 5048 else |
5047 { | 5049 { |
5064 ++p; | 5066 ++p; |
5065 } | 5067 } |
5066 } | 5068 } |
5067 if (tab == lcstab) | 5069 if (tab == lcstab) |
5068 { | 5070 { |
5069 if (wp->w_lcs_chars.multispace != NULL) | 5071 vim_free(wp->w_lcs_chars.multispace); |
5070 vim_free(wp->w_lcs_chars.multispace); | 5072 vim_free(wp->w_lcs_chars.leadmultispace); |
5071 if (wp->w_lcs_chars.leadmultispace != NULL) | |
5072 vim_free(wp->w_lcs_chars.leadmultispace); | |
5073 wp->w_lcs_chars = lcs_chars; | 5073 wp->w_lcs_chars = lcs_chars; |
5074 } | 5074 } |
5075 | 5075 |
5076 return NULL; // no error | 5076 return NULL; // no error |
5077 } | 5077 } |