是否可以在 VimScript 中检测拆分窗口是否触及真实窗口的底部和/或右边距?
最佳答案
尝试这个。
位坏了:
func! IsMostBottomRight(nr)
let oldw = winnr()
silent! exe "normal! \<c-w>l"
silent! exe "normal! \<c-w>j"
let neww = winnr()
silent! exe oldw.'wincmd w'
return oldw == neww
endfunction
" echo IsMostBottomRight(winnr())
固定的:
func! IsMostBottomRight()
let oldw = winnr()
silent! exe "normal! \<c-w>l"
silent! exe "normal! \<c-w>j"
let neww = winnr()
silent! exe oldw.'wincmd w'
return oldw == neww
endfunction
" echo IsMostBottomRight()
关于vim - 检查 Vim 拆分窗口是否最底部/最右侧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6435792/