Mercurial > vim
diff runtime/doc/eval.txt @ 17756:a7afcea6f40a v8.1.1875
patch 8.1.1875: cannot get size and position of the popup menu
commit https://github.com/vim/vim/commit/e9bd57286a5cbb0e1ec18b5d194dc4af1bda9f3a
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 17 19:36:06 2019 +0200
patch 8.1.1875: cannot get size and position of the popup menu
Problem: Cannot get size and position of the popup menu.
Solution: Add pum_getpos(). (Ben Jackson, closes https://github.com/vim/vim/issues/4827)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 17 Aug 2019 19:45:03 +0200 |
parents | 55704f587945 |
children | f2c2f9126a82 |
line wrap: on
line diff
--- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -2613,6 +2613,7 @@ prop_type_delete({name} [, {props}]) prop_type_get([{name} [, {props}]) Dict get property type values prop_type_list([{props}]) List get list of property types +pum_getpos() Dict position and size of pum if visible pumvisible() Number whether popup menu is visible pyeval({expr}) any evaluate |Python| expression py3eval({expr}) any evaluate |python3| expression @@ -3477,6 +3478,10 @@ complete_info([{what}]) the items listed in {what} are returned. Unsupported items in {what} are silently ignored. + To get the position and size of the popup menu, see + |pum_getpos()|. It's also available in |v:event| during the + |CompleteChanged| event. + Examples: > " Get all items call complete_info() @@ -6977,6 +6982,20 @@ prompt_setprompt({buf}, {text}) *prom < prop_ functions are documented here: |text-prop-functions|. +pum_getpos() *pum_getpos()* + If the popup menu (see |ins-completion-menu|) is not visible, + returns an empty |Dictionary|, otherwise, returns a + |Dictionary| with the following keys: + height nr of items visible + width screen cells + row top screen row (0 first row) + col leftmost screen column (0 first col) + size total nr of items + scrollbar |TRUE| if visible + + The values are the same as in |v:event| during + |CompleteChanged|. + pumvisible() *pumvisible()* Returns non-zero when the popup menu is visible, zero otherwise. See |ins-completion-menu|.