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