diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-08-17 19:36:06 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-08-17 19:36:06 +0200 |
commit | e9bd57286a5cbb0e1ec18b5d194dc4af1bda9f3a (patch) | |
tree | 34510fae2da2db932e6a750cce702e3f1a4c8db2 /runtime | |
parent | 4dd751b95696957c7baabad2f19f9e02fc596eae (diff) | |
download | vim-git-e9bd57286a5cbb0e1ec18b5d194dc4af1bda9f3a.tar.gz |
patch 8.1.1875: cannot get size and position of the popup menuv8.1.1875
Problem: Cannot get size and position of the popup menu.
Solution: Add pum_getpos(). (Ben Jackson, closes #4827)
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/autocmd.txt | 4 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 19 |
2 files changed, 23 insertions, 0 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 0cab9d88c..78936519f 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -595,6 +595,10 @@ CompleteChanged *CompleteChanged* scrollbar TRUE if visible It is not allowed to change the text |textlock|. + + The size and position of the popup are also + available by calling |pum_getpos()|. + *CompleteDone* CompleteDone After Insert mode completion is done. Either when something was completed or abandoning diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 4bc4287ca..1e5b5a0a0 100644 --- 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}) *prompt_setprompt()* < 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|. |