mirror of
https://github.com/inkarkat/vim-ingo-library.git
synced 2026-05-29 11:18:51 +02:00
24 lines
665 B
VimL
24 lines
665 B
VimL
" ingo/gui/position.vim: Functions for the GVIM position and size.
|
|
"
|
|
" DEPENDENCIES:
|
|
"
|
|
" Copyright: (C) 2013-2023 Ingo Karkat
|
|
" The VIM LICENSE applies to this script; see ':help copyright'.
|
|
"
|
|
" Maintainer: Ingo Karkat <ingo@karkat.de>
|
|
|
|
if exists('*getwinpos')
|
|
function! ingo#gui#position#Get() abort
|
|
return [&columns, &lines] + getwinpos()
|
|
endfunction
|
|
else
|
|
function! ingo#gui#position#Get() abort
|
|
redir => l:winpos
|
|
silent! winpos
|
|
redir END
|
|
return [&columns, &lines, str2nr(matchstr(l:winpos, '\CX \zs-\?\d\+')), str2nr(matchstr(l:winpos, '\CY \zs-\?\d\+'))]
|
|
endfunction
|
|
endif
|
|
|
|
" vim: set ts=8 sts=4 sw=4 noexpandtab ff=unix fdm=syntax :
|