1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 00:40:05 +08:00

Revert "change nvim floating window API in flygrep, guide"

stay the same with spc
This reverts commit 2604904c8e.
This commit is contained in:
alanding 2019-04-03 12:49:01 +08:00
parent a57db5788b
commit 9e5134001d
2 changed files with 13 additions and 19 deletions

View File

@ -392,13 +392,11 @@ function! s:start_buffer() abort " {{{
setlocal modifiable setlocal modifiable
if exists('*nvim_open_win') if exists('*nvim_open_win')
call nvim_win_set_config(win_getid(s:gwin), call nvim_win_config(win_getid(s:gwin), &columns, layout.win_dim + 2,
\ { \ {
\ 'relative': 'editor', \ 'relative': 'editor',
\ 'width' : &columns, \ 'row': &lines - layout.win_dim - 4,
\ 'height' : layout.win_dim + 2, \ 'col': 0
\ 'row' : &lines - layout.win_dim - 4,
\ 'col' : 0
\ }) \ })
else else
@ -506,13 +504,11 @@ function! s:winopen() abort " {{{
if !bufexists(s:bufnr) if !bufexists(s:bufnr)
let s:bufnr = nvim_create_buf(v:false,v:false) let s:bufnr = nvim_create_buf(v:false,v:false)
endif endif
call nvim_open_win(s:bufnr, v:true, call nvim_open_win(s:bufnr, v:true, &columns, 12,
\ { \ {
\ 'relative': 'editor', \ 'relative': 'editor',
\ 'width' : &columns, \ 'row': &lines - 14,
\ 'height' : 12, \ 'col': 0
\ 'row' : &lines - 14,
\ 'col' : 0
\ }) \ })
else else
if bufexists(s:bufnr) if bufexists(s:bufnr)

View File

@ -599,13 +599,11 @@ function! SpaceVim#plugins#flygrep#open(agrv) abort
if exists('*nvim_open_win') if exists('*nvim_open_win')
let s:buffer_id = nvim_create_buf(v:false, v:false) let s:buffer_id = nvim_create_buf(v:false, v:false)
let flygrep_win_height = 16 let flygrep_win_height = 16
let s:flygrep_win_id = nvim_open_win(s:buffer_id, v:true, let s:flygrep_win_id = nvim_open_win(s:buffer_id, v:true, &columns, flygrep_win_height,
\ { \ {
\ 'relative': 'editor', \ 'relative': 'editor',
\ 'width' : &columns, \ 'row': &lines - flygrep_win_height - 2,
\ 'height' : flygrep_win_height, \ 'col': 0
\ 'row' : &lines - flygrep_win_height - 2,
\ 'col' : 0
\ }) \ })
else else
noautocmd rightbelow split __flygrep__ noautocmd rightbelow split __flygrep__
@ -678,12 +676,12 @@ function! s:create_statusline() abort
let s:statusline_buf_id = nvim_create_buf(0,0) let s:statusline_buf_id = nvim_create_buf(0,0)
let s:statusline_win_id = nvim_open_win(s:statusline_buf_id, let s:statusline_win_id = nvim_open_win(s:statusline_buf_id,
\ v:true, \ v:true,
\ &columns ,
\ 1,
\ { \ {
\ 'relative': 'editor', \ 'relative': 'editor',
\ 'width' : &columns, \ 'row': &lines ,
\ 'height' : 1, \ 'col': 10
\ 'row' : &lines ,
\ 'col' : 10
\ }) \ })
call setbufvar(s:statusline_buf_id, '&relativenumber', 0) call setbufvar(s:statusline_buf_id, '&relativenumber', 0)
call setbufvar(s:statusline_buf_id, '&number', 0) call setbufvar(s:statusline_buf_id, '&number', 0)