Mirror of the Vim source from https://github.com/vim/vim
リビジョン | 18604231a1d1cfe0c02fdd0a55b02ac6ddfc36bd (tree) |
---|---|
日時 | 2022-05-15 22:00:02 |
作者 | Bram Moolenaar <Bram@vim....> |
コミッター | Bram Moolenaar |
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
@@ -9788,43 +9788,40 @@ | ||
9788 | 9788 | } |
9789 | 9789 | |
9790 | 9790 | #ifdef FEAT_SPELL |
9791 | - if (*curwin->w_s->b_p_spl != NUL) | |
9792 | - { | |
9793 | - str = tv_get_string(&argvars[0]); | |
9794 | - if (argvars[1].v_type != VAR_UNKNOWN) | |
9795 | - { | |
9796 | - maxcount = (int)tv_get_number_chk(&argvars[1], &typeerr); | |
9797 | - if (maxcount <= 0) | |
9791 | + str = tv_get_string(&argvars[0]); | |
9792 | + if (argvars[1].v_type != VAR_UNKNOWN) | |
9793 | + { | |
9794 | + maxcount = (int)tv_get_number_chk(&argvars[1], &typeerr); | |
9795 | + if (maxcount <= 0) | |
9796 | + return; | |
9797 | + if (argvars[2].v_type != VAR_UNKNOWN) | |
9798 | + { | |
9799 | + need_capital = (int)tv_get_bool_chk(&argvars[2], &typeerr); | |
9800 | + if (typeerr) | |
9798 | 9801 | return; |
9799 | - if (argvars[2].v_type != VAR_UNKNOWN) | |
9800 | - { | |
9801 | - need_capital = (int)tv_get_bool_chk(&argvars[2], &typeerr); | |
9802 | - if (typeerr) | |
9803 | - return; | |
9804 | - } | |
9805 | - } | |
9802 | + } | |
9803 | + } | |
9804 | + else | |
9805 | + maxcount = 25; | |
9806 | + | |
9807 | + spell_suggest_list(&ga, str, maxcount, need_capital, FALSE); | |
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 | 9816 | else |
9807 | - maxcount = 25; | |
9808 | - | |
9809 | - spell_suggest_list(&ga, str, maxcount, need_capital, FALSE); | |
9810 | - | |
9811 | - for (i = 0; i < ga.ga_len; ++i) | |
9812 | - { | |
9813 | - str = ((char_u **)ga.ga_data)[i]; | |
9814 | - | |
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 | - } | |
9817 | + { | |
9818 | + li->li_tv.v_type = VAR_STRING; | |
9819 | + li->li_tv.v_lock = 0; | |
9820 | + li->li_tv.vval.v_string = str; | |
9821 | + list_append(rettv->vval.v_list, li); | |
9822 | + } | |
9823 | + } | |
9824 | + ga_clear(&ga); | |
9828 | 9825 | curwin->w_p_spell = wo_spell_save; |
9829 | 9826 | #endif |
9830 | 9827 | } |
@@ -2494,7 +2494,7 @@ | ||
2494 | 2494 | // store directory on the stack |
2495 | 2495 | if (vim_isAbsName(dirbuf) |
2496 | 2496 | || (*stackptr)->next == NULL |
2497 | - || (*stackptr && is_file_stack)) | |
2497 | + || is_file_stack) | |
2498 | 2498 | (*stackptr)->dirname = vim_strsave(dirbuf); |
2499 | 2499 | else |
2500 | 2500 | { |
@@ -747,6 +747,8 @@ | ||
747 | 747 | static int included_patches[] = |
748 | 748 | { /* Add new patch number below this line */ |
749 | 749 | /**/ |
750 | + 4958, | |
751 | +/**/ | |
750 | 752 | 4957, |
751 | 753 | /**/ |
752 | 754 | 4956, |