mirror of
https://github.com/SpaceVim/SpaceVim.git
synced 2025-01-23 13:00:04 +08:00
parent
c13465348d
commit
8dfafda38b
@ -163,14 +163,7 @@ function! s:open_default_shell(open_with_file_cwd) abort
|
||||
endif
|
||||
endfor
|
||||
|
||||
" no terminal window found. Open a new window
|
||||
let cmd = s:default_position ==# 'top' ?
|
||||
\ 'topleft split' :
|
||||
\ s:default_position ==# 'bottom' ?
|
||||
\ 'botright split' :
|
||||
\ s:default_position ==# 'right' ?
|
||||
\ 'rightbelow vsplit' : 'leftabove vsplit'
|
||||
if s:default_position == 'float'
|
||||
if s:default_position == 'float' && exists('*nvim_open_win')
|
||||
let s:term_win_id = s:FLOAT.open_win(bufnr('%'), v:true,
|
||||
\ {
|
||||
\ 'relative': 'editor',
|
||||
@ -182,6 +175,15 @@ function! s:open_default_shell(open_with_file_cwd) abort
|
||||
|
||||
exe win_id2win(s:term_win_id) . 'wincmd w'
|
||||
else
|
||||
" no terminal window found. Open a new window
|
||||
let cmd = s:default_position ==# 'float' ?
|
||||
\ 'topleft split' :
|
||||
\ s:default_position ==# 'top' ?
|
||||
\ 'topleft split' :
|
||||
\ s:default_position ==# 'bottom' ?
|
||||
\ 'botright split' :
|
||||
\ s:default_position ==# 'right' ?
|
||||
\ 'rightbelow vsplit' : 'leftabove vsplit'
|
||||
exe cmd
|
||||
let lines = &lines * s:default_height / 100
|
||||
if lines < winheight(0) && (s:default_position ==# 'top' || s:default_position ==# 'bottom')
|
||||
|
Loading…
Reference in New Issue
Block a user