Mercurial > vim
comparison src/evalfunc.c @ 28871:18604231a1d1 v8.2.4958
patch 8.2.4958: a couple conditions are always true
Commit: https://github.com/vim/vim/commit/dd41037552c1be3548d2ce34bb1c889f14edb553
Author: =?UTF-8?q?Dundar=20G=C3=B6c?= <gocdundar@gmail.com>
Date: Sun May 15 13:59:11 2022 +0100
patch 8.2.4958: a couple conditions are always true
Problem: A couple conditions are always true.
Solution: Remove the conditions. (Goc Dundar, closes https://github.com/vim/vim/issues/10428)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 15 May 2022 15:00:02 +0200 |
parents | 3754393e05bc |
children | c5862dfaf0bd |
comparison
equal
deleted
inserted
replaced
28870:a865bf1c3ca9 | 28871:18604231a1d1 |
---|---|
9786 #endif | 9786 #endif |
9787 return; | 9787 return; |
9788 } | 9788 } |
9789 | 9789 |
9790 #ifdef FEAT_SPELL | 9790 #ifdef FEAT_SPELL |
9791 if (*curwin->w_s->b_p_spl != NUL) | 9791 str = tv_get_string(&argvars[0]); |
9792 { | 9792 if (argvars[1].v_type != VAR_UNKNOWN) |
9793 str = tv_get_string(&argvars[0]); | 9793 { |
9794 if (argvars[1].v_type != VAR_UNKNOWN) | 9794 maxcount = (int)tv_get_number_chk(&argvars[1], &typeerr); |
9795 { | 9795 if (maxcount <= 0) |
9796 maxcount = (int)tv_get_number_chk(&argvars[1], &typeerr); | 9796 return; |
9797 if (maxcount <= 0) | 9797 if (argvars[2].v_type != VAR_UNKNOWN) |
9798 { | |
9799 need_capital = (int)tv_get_bool_chk(&argvars[2], &typeerr); | |
9800 if (typeerr) | |
9798 return; | 9801 return; |
9799 if (argvars[2].v_type != VAR_UNKNOWN) | 9802 } |
9800 { | 9803 } |
9801 need_capital = (int)tv_get_bool_chk(&argvars[2], &typeerr); | 9804 else |
9802 if (typeerr) | 9805 maxcount = 25; |
9803 return; | 9806 |
9804 } | 9807 spell_suggest_list(&ga, str, maxcount, need_capital, FALSE); |
9805 } | 9808 |
9809 for (i = 0; i < ga.ga_len; ++i) | |
9810 { | |
9811 str = ((char_u **)ga.ga_data)[i]; | |
9812 | |
9813 li = listitem_alloc(); | |
9814 if (li == NULL) | |
9815 vim_free(str); | |
9806 else | 9816 else |
9807 maxcount = 25; | 9817 { |
9808 | 9818 li->li_tv.v_type = VAR_STRING; |
9809 spell_suggest_list(&ga, str, maxcount, need_capital, FALSE); | 9819 li->li_tv.v_lock = 0; |
9810 | 9820 li->li_tv.vval.v_string = str; |
9811 for (i = 0; i < ga.ga_len; ++i) | 9821 list_append(rettv->vval.v_list, li); |
9812 { | 9822 } |
9813 str = ((char_u **)ga.ga_data)[i]; | 9823 } |
9814 | 9824 ga_clear(&ga); |
9815 li = listitem_alloc(); | |
9816 if (li == NULL) | |
9817 vim_free(str); | |
9818 else | |
9819 { | |
9820 li->li_tv.v_type = VAR_STRING; | |
9821 li->li_tv.v_lock = 0; | |
9822 li->li_tv.vval.v_string = str; | |
9823 list_append(rettv->vval.v_list, li); | |
9824 } | |
9825 } | |
9826 ga_clear(&ga); | |
9827 } | |
9828 curwin->w_p_spell = wo_spell_save; | 9825 curwin->w_p_spell = wo_spell_save; |
9829 #endif | 9826 #endif |
9830 } | 9827 } |
9831 | 9828 |
9832 static void | 9829 static void |