[neovim] 01/03: vim-patch:8.0.0003

James McCoy jamessan at debian.org
Wed Aug 2 03:35:56 UTC 2017


This is an automated email from the git hooks/post-receive script.

jamessan pushed a commit to branch debian/sid
in repository neovim.

commit fb10b69aa91f5011980a3cd664c261fbe63a862d
Author: lonerover <pathfinder1644 at yahoo.com>
Date:   Sat Jul 15 21:02:15 2017 +0800

    vim-patch:8.0.0003
    
    Problem:    getwinvar() returns wrong Value of boolean and number options,
                especially non big endian systems. (James McCoy)
    Solution:   Cast the pointer to long or int. (closes vim/vim#1060)
    
    https://github.com/vim/vim/commit/789a5c0e3d27f09456678f0cfb6c1bd2d8ab4a35
---
 src/nvim/option.c                       |  5 ++++-
 src/nvim/testdir/test_bufwintabinfo.vim | 13 +++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/nvim/option.c b/src/nvim/option.c
index b8d1535..3211253 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -6992,8 +6992,11 @@ dict_T *get_winbuf_options(const int bufopt)
         if (opt->flags & P_STRING) {
           tv_dict_add_str(d, opt->fullname, strlen(opt->fullname),
                           *(const char **)varp);
+        } else if (opt->flags & P_NUM) {
+          tv_dict_add_nr(d, opt->fullname, strlen(opt->fullname),
+                         *(long *)varp);
         } else {
-          tv_dict_add_nr(d, opt->fullname, strlen(opt->fullname), *varp);
+          tv_dict_add_nr(d, opt->fullname, strlen(opt->fullname), *(int *)varp);
         }
       }
     }
diff --git a/src/nvim/testdir/test_bufwintabinfo.vim b/src/nvim/testdir/test_bufwintabinfo.vim
index 5c916e2..1c9350c 100644
--- a/src/nvim/testdir/test_bufwintabinfo.vim
+++ b/src/nvim/testdir/test_bufwintabinfo.vim
@@ -87,9 +87,17 @@ function Test_get_buf_options()
 endfunc
 
 function Test_get_win_options()
+  if has('folding')
+    set foldlevel=999
+  endif
+  set list
   let opts = getwinvar(1, '&')
   call assert_equal(v:t_dict, type(opts))
   call assert_equal(0, opts.linebreak)
+  call assert_equal(1, opts.list)
+  if has('folding')
+    call assert_equal(999, opts.foldlevel)
+  endif
   if has('signs')
     call assert_equal('auto', opts.signcolumn)
   endif
@@ -97,7 +105,12 @@ function Test_get_win_options()
   let opts = gettabwinvar(1, 1, '&')
   call assert_equal(v:t_dict, type(opts))
   call assert_equal(0, opts.linebreak)
+  call assert_equal(1, opts.list)
   if has('signs')
     call assert_equal('auto', opts.signcolumn)
   endif
+  set list&
+  if has('folding')
+    set foldlevel=0
+  endif
 endfunc

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-vim/neovim.git



More information about the pkg-vim-maintainers mailing list