Patch 9.0.0644
Problem:    'smoothscroll' is not copied to a new window on :split.
Solution:   Copy the option value.  Add a test.
Files:      src/option.c, src/testdir/test_options.vim


*** ../vim-9.0.0643/src/option.c        2022-10-02 21:29:18.416089542 +0100
--- src/option.c        2022-10-02 23:18:40.460021223 +0100
***************
*** 5679,5684 ****
--- 5679,5685 ----
      to->wo_wcr = copy_option_val(from->wo_wcr);
      to->wo_scb = from->wo_scb;
      to->wo_scb_save = from->wo_scb_save;
+     to->wo_sms = from->wo_sms;
      to->wo_crb = from->wo_crb;
      to->wo_crb_save = from->wo_crb_save;
  #ifdef FEAT_SPELL
*** ../vim-9.0.0643/src/testdir/test_options.vim        2022-09-30 
21:57:07.543153405 +0100
--- src/testdir/test_options.vim        2022-10-03 11:21:05.741239162 +0100
***************
*** 721,727 ****
    let &backupskip = backupskip
  endfunc
  
! func Test_copy_winopt()
    set hidden
  
    " Test copy option from current buffer in window
--- 721,727 ----
    let &backupskip = backupskip
  endfunc
  
! func Test_buf_copy_winopt()
    set hidden
  
    " Test copy option from current buffer in window
***************
*** 775,780 ****
--- 775,882 ----
    set hidden&
  endfunc
  
+ def Test_split_copy_options()
+   var values = [
+     ['cursorbind', true, false],
+     ['fillchars', '"vert:-"', '"' .. &fillchars .. '"'],
+     ['list', true, 0],
+     ['listchars', '"space:-"', '"' .. &listchars .. '"'],
+     ['number', true, 0],
+     ['relativenumber', true, false],
+     ['scrollbind', true, false],
+     ['smoothscroll', true, false],
+     ['virtualedit', '"block"', '"' .. &virtualedit .. '"'],
+     ['wincolor', '"Search"', '"' .. &wincolor .. '"'],
+     ['wrap', false, true],
+   ]
+   if has('linebreak')
+     values += [
+       ['breakindent', true, false],
+       ['breakindentopt', '"min:5"', '"' .. &breakindentopt .. '"'],
+       ['linebreak', true, false],
+       ['numberwidth', 7, 4],
+       ['showbreak', '"++"', '"' .. &showbreak .. '"'],
+     ]
+   endif
+   if has('rightleft')
+     values += [
+       ['rightleft', true, false],
+       ['rightleftcmd', '"search"', '"' .. &rightleftcmd .. '"'],
+     ]
+   endif
+   if has('statusline')
+     values += [
+       ['statusline', '"---%f---"', '"' .. &statusline .. '"'],
+     ]
+   endif
+   if has('spell')
+     values += [
+       ['spell', true, false],
+     ]
+   endif
+   if has('syntax')
+     values += [
+       ['cursorcolumn', true, false],
+       ['cursorline', true, false],
+       ['cursorlineopt', '"screenline"', '"' .. &cursorlineopt .. '"'],
+       ['colorcolumn', '"+1"', '"' .. &colorcolumn .. '"'],
+     ]
+   endif
+   if has('diff')
+     values += [
+       ['diff', true, false],
+     ]
+   endif
+   if has('conceal')
+     values += [
+       ['concealcursor', '"nv"', '"' .. &concealcursor .. '"'],
+       ['conceallevel', '3', &conceallevel],
+     ]
+   endif
+   if has('terminal')
+     values += [
+       ['termwinkey', '"<C-X>"', '"' .. &termwinkey .. '"'],
+       ['termwinsize', '"10x20"', '"' .. &termwinsize .. '"'],
+     ]
+   endif
+   if has('folding')
+     values += [
+       ['foldcolumn', 5,  &foldcolumn],
+       ['foldenable', false, true],
+       ['foldexpr', '"2 + 3"', '"' .. &foldexpr .. '"'],
+       ['foldignore', '"+="', '"' .. &foldignore .. '"'],
+       ['foldlevel', 4,  &foldlevel],
+       ['foldmarker', '">>,<<"', '"' .. &foldmarker .. '"'],
+       ['foldmethod', '"marker"', '"' .. &foldmethod .. '"'],
+       ['foldminlines', 3,  &foldminlines],
+       ['foldnestmax', 17,  &foldnestmax],
+       ['foldtext', '"closed"', '"' .. &foldtext .. '"'],
+     ]
+   endif
+   if has('signs')
+     values += [
+       ['signcolumn', '"number"', '"' .. &signcolumn .. '"'],
+     ]
+   endif
+ 
+   # set options to non-default value
+   for item in values
+     exe $'&l:{item[0]} = {item[1]}'
+   endfor
+ 
+   # check values are set in new window
+   split
+   for item in values
+     exe $'assert_equal({item[1]}, &{item[0]}, "{item[0]}")'
+   endfor
+ 
+   # restore
+   close
+   for item in values
+     exe $'&l:{item[0]} = {item[2]}'
+   endfor
+ enddef
+ 
  func Test_shortmess_F()
    new
    call assert_match('\[No Name\]', execute('file'))
*** ../vim-9.0.0643/src/version.c       2022-10-02 22:32:05.052990430 +0100
--- src/version.c       2022-10-03 11:21:46.365156172 +0100
***************
*** 701,702 ****
--- 701,704 ----
  {   /* Add new patch number below this line */
+ /**/
+     644,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
251. You've never seen your closest friends who usually live WAY too far away.

 /// 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/20221003102339.0406D1C0A0D%40moolenaar.net.

Raspunde prin e-mail lui