Patch 8.2.2969
Problem:    Subtracting from number option fails when result is zero. (Ingo
            Karkat)
Solution:   Reset the string value when using the numeric value.
            (closes #8351)
Files:      src/evalvars.c, src/testdir/test_vimscript.vim


*** ../vim-8.2.2968/src/evalvars.c      2021-05-07 17:55:51.971584412 +0200
--- src/evalvars.c      2021-06-10 18:42:54.611700953 +0200
***************
*** 1439,1444 ****
--- 1439,1445 ----
                            case '%': n = (long)num_modulus(numval, n,
                                                               &failed); break;
                        }
+                       s = NULL;
                    }
                    else if (opt_type == gov_string
                                             && stringval != NULL && s != NULL)
*** ../vim-8.2.2968/src/testdir/test_vimscript.vim      2021-03-26 
20:41:24.773620612 +0100
--- src/testdir/test_vimscript.vim      2021-06-10 18:42:14.043784722 +0200
***************
*** 7083,7088 ****
--- 7083,7097 ----
      call assert_fails('let &scrolljump .= "j"', 'E734:')
      set scrolljump&vim
  
+     let &foldlevelstart = 2
+     let &foldlevelstart -= 1
+     call assert_equal(1, &foldlevelstart)
+     let &foldlevelstart -= 1
+     call assert_equal(0, &foldlevelstart)
+     let &foldlevelstart = 2
+     let &foldlevelstart -= 2
+     call assert_equal(0, &foldlevelstart)
+ 
      " Test for register
      let @/ = 1
      call assert_fails('let @/ += 1', 'E734:')
*** ../vim-8.2.2968/src/version.c       2021-06-09 20:50:42.255103073 +0200
--- src/version.c       2021-06-10 18:43:10.027669117 +0200
***************
*** 752,753 ****
--- 752,755 ----
  {   /* Add new patch number below this line */
+ /**/
+     2969,
  /**/

-- 
LARGE MAN:   Who's that then?
CART DRIVER: (Grudgingly) I dunno, Must be a king.
LARGE MAN:   Why?
CART DRIVER: He hasn't got shit all over him.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202106101644.15AGiEnG1412613%40masaka.moolenaar.net.

Raspunde prin e-mail lui