Mercurial > vim
comparison runtime/doc/insert.txt @ 18396:ba5d8c5d77d7 v8.1.2192
patch 8.1.2192: cannot easily fill the info popup asynchronously
Commit: https://github.com/vim/vim/commit/dca7abe79cc4f0933473c3e4bcc75b46cc2c48fd
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Oct 20 18:17:57 2019 +0200
patch 8.1.2192: cannot easily fill the info popup asynchronously
Problem: Cannot easily fill the info popup asynchronously.
Solution: Add the "popuphidden" value to 'completeopt'. (closes https://github.com/vim/vim/issues/4924)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 20 Oct 2019 18:30:04 +0200 |
parents | 03b854983b14 |
children | 14d2a210fab1 |
comparison
equal
deleted
inserted
replaced
18395:dbfbbb32cf07 | 18396:ba5d8c5d77d7 |
---|---|
1 *insert.txt* For Vim version 8.1. Last change: 2019 Sep 27 | 1 *insert.txt* For Vim version 8.1. Last change: 2019 Oct 20 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
1136 below the text, and the bottom of the menu otherwise. | 1136 below the text, and the bottom of the menu otherwise. |
1137 | 1137 |
1138 After the info popup is created it can be found with |popup_findinfo()| and | 1138 After the info popup is created it can be found with |popup_findinfo()| and |
1139 properties can be changed with |popup_setoptions()|. | 1139 properties can be changed with |popup_setoptions()|. |
1140 | 1140 |
1141 *complete-popuphidden* | |
1142 If the information for the popup is obtained asynchronously, use "popuphidden" | |
1143 in 'completeopt'. The info popup will then be initally hidden and | |
1144 |popup_show()| must be called once it has been filled with the info. This can | |
1145 be done with a |CompleteChanged| autocommand, something like this: > | |
1146 set completeopt+=popuphidden | |
1147 au CompleteChanged * call UpdateCompleteInfo() | |
1148 func UpdateCompleteInfo() | |
1149 " Cancel any pending info fetch | |
1150 let item = v:event.completed_item | |
1151 " Start fetching info for the item then call ShowCompleteInfo(info) | |
1152 endfunc | |
1153 func ShowCompleteInfo(info) | |
1154 let id = popup_findinfo() | |
1155 if id | |
1156 call popup_settext(id, 'async info: ' .. a:info) | |
1157 call popup_show(id) | |
1158 endif | |
1159 endfunc | |
1160 | |
1161 < *complete-item-kind* | |
1141 The "kind" item uses a single letter to indicate the kind of completion. This | 1162 The "kind" item uses a single letter to indicate the kind of completion. This |
1142 may be used to show the completion differently (different color or icon). | 1163 may be used to show the completion differently (different color or icon). |
1143 Currently these types can be used: | 1164 Currently these types can be used: |
1144 v variable | 1165 v variable |
1145 f function or method | 1166 f function or method |