From bf1f442a522c2262f84aeef4022d5b4ebf200e24 Mon Sep 17 00:00:00 2001 From: AlanDing <395577197@qq.com> Date: Mon, 6 May 2019 11:35:43 +0800 Subject: [PATCH] Change: nvim floating window API in flygrep,guide.vim (#2762) * change nvim floating window API in flygrep,guide.vim * update ipynb.vim --- autoload/SpaceVim/mapping/guide.vim | 16 ++++++++++------ autoload/SpaceVim/plugins/flygrep.vim | 12 +++++++----- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/autoload/SpaceVim/mapping/guide.vim b/autoload/SpaceVim/mapping/guide.vim index 71f731bca..48a70e023 100644 --- a/autoload/SpaceVim/mapping/guide.vim +++ b/autoload/SpaceVim/mapping/guide.vim @@ -393,11 +393,13 @@ function! s:start_buffer() abort " {{{ setlocal modifiable if exists('*nvim_open_win') - call nvim_win_config(win_getid(s:gwin), &columns, layout.win_dim + 2, + call nvim_win_set_config(win_getid(s:gwin), \ { \ 'relative': 'editor', - \ 'row': &lines - layout.win_dim - 4, - \ 'col': 0 + \ 'width' : &columns, + \ 'height' : layout.win_dim + 2, + \ 'row' : &lines - layout.win_dim - 4, + \ 'col' : 0 \ }) else @@ -507,11 +509,13 @@ function! s:winopen() abort " {{{ if !bufexists(s:bufnr) let s:bufnr = nvim_create_buf(v:false,v:false) endif - call nvim_open_win(s:bufnr, v:true, &columns, 12, + call nvim_open_win(s:bufnr, v:true, \ { \ 'relative': 'editor', - \ 'row': &lines - 14, - \ 'col': 0 + \ 'width' : &columns, + \ 'height' : 12, + \ 'row' : &lines - 14, + \ 'col' : 0 \ }) else if bufexists(s:bufnr) diff --git a/autoload/SpaceVim/plugins/flygrep.vim b/autoload/SpaceVim/plugins/flygrep.vim index b4cd0262f..46d1c5db7 100644 --- a/autoload/SpaceVim/plugins/flygrep.vim +++ b/autoload/SpaceVim/plugins/flygrep.vim @@ -599,9 +599,11 @@ function! SpaceVim#plugins#flygrep#open(agrv) abort if exists('*nvim_open_win') let s:buffer_id = nvim_create_buf(v:false, v:false) let flygrep_win_height = 16 - let s:flygrep_win_id = nvim_open_win(s:buffer_id, v:true, &columns, flygrep_win_height, + let s:flygrep_win_id = nvim_open_win(s:buffer_id, v:true, \ { \ 'relative': 'editor', + \ 'width' : &columns, + \ 'height' : flygrep_win_height, \ 'row': &lines - flygrep_win_height - 2, \ 'col': 0 \ }) @@ -676,12 +678,12 @@ function! s:create_statusline() abort let s:statusline_buf_id = nvim_create_buf(0,0) let s:statusline_win_id = nvim_open_win(s:statusline_buf_id, \ v:true, - \ &columns , - \ 1, \ { \ 'relative': 'editor', - \ 'row': &lines , - \ 'col': 10 + \ 'width' : &columns , + \ 'height' : 1, + \ 'row' : &lines , + \ 'col' : 10 \ }) call setbufvar(s:statusline_buf_id, '&relativenumber', 0) call setbufvar(s:statusline_buf_id, '&number', 0)