comparison runtime/doc/eval.txt @ 16127:0375e54f0adc v8.1.1068

patch 8.1.1068: cannot get all the information about current completion commit https://github.com/vim/vim/commit/fd133323d4e1cc9c0e61c0ce357df4d36ea148e3 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Mar 29 12:20:27 2019 +0100 patch 8.1.1068: cannot get all the information about current completion Problem: Cannot get all the information about current completion. Solution: Add complete_info(). (Shougo, Hirohito Higashi, closes https://github.com/vim/vim/issues/4106)
author Bram Moolenaar <Bram@vim.org>
date Fri, 29 Mar 2019 12:30:06 +0100
parents 518f44125207
children eb087f8a26a8
comparison
equal deleted inserted replaced
16126:b792e47f7a2d 16127:0375e54f0adc
1 *eval.txt* For Vim version 8.1. Last change: 2019 Mar 23 1 *eval.txt* For Vim version 8.1. Last change: 2019 Mar 29
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
2265 clearmatches() none clear all matches 2265 clearmatches() none clear all matches
2266 col({expr}) Number column nr of cursor or mark 2266 col({expr}) Number column nr of cursor or mark
2267 complete({startcol}, {matches}) none set Insert mode completion 2267 complete({startcol}, {matches}) none set Insert mode completion
2268 complete_add({expr}) Number add completion match 2268 complete_add({expr}) Number add completion match
2269 complete_check() Number check for key typed during completion 2269 complete_check() Number check for key typed during completion
2270 complete_info([{what}]) Dict get current completion information
2270 confirm({msg} [, {choices} [, {default} [, {type}]]]) 2271 confirm({msg} [, {choices} [, {default} [, {type}]]])
2271 Number number of choice picked by user 2272 Number number of choice picked by user
2272 copy({expr}) any make a shallow copy of {expr} 2273 copy({expr}) any make a shallow copy of {expr}
2273 cos({expr}) Float cosine of {expr} 2274 cos({expr}) Float cosine of {expr}
2274 cosh({expr}) Float hyperbolic cosine of {expr} 2275 cosh({expr}) Float hyperbolic cosine of {expr}
3450 When {lnum} is invalid or Vim was not compiled the |+cindent| 3451 When {lnum} is invalid or Vim was not compiled the |+cindent|
3451 feature, -1 is returned. 3452 feature, -1 is returned.
3452 See |C-indenting|. 3453 See |C-indenting|.
3453 3454
3454 clearmatches() *clearmatches()* 3455 clearmatches() *clearmatches()*
3455 Clears all matches previously defined by |matchadd()| and the 3456 Clears all matches previously defined for the current window
3456 |:match| commands. 3457 by |matchadd()| and the |:match| commands.
3457 3458
3458 *col()* 3459 *col()*
3459 col({expr}) The result is a Number, which is the byte index of the column 3460 col({expr}) The result is a Number, which is the byte index of the column
3460 position given with {expr}. The accepted positions are: 3461 position given with {expr}. The accepted positions are:
3461 . the cursor position 3462 . the cursor position
3536 Returns |TRUE| when searching for matches is to be aborted, 3537 Returns |TRUE| when searching for matches is to be aborted,
3537 zero otherwise. 3538 zero otherwise.
3538 Only to be used by the function specified with the 3539 Only to be used by the function specified with the
3539 'completefunc' option. 3540 'completefunc' option.
3540 3541
3542 *complete_info()*
3543 complete_info([{what}])
3544 Returns a Dictionary with information about Insert mode
3545 completion. See |ins-completion|.
3546 The items are:
3547 mode Current completion mode name string.
3548 See |completion_info_mode| for the values.
3549 pum_visible |TRUE| if popup menu is visible.
3550 See |pumvisible()|.
3551 items List of completion matches. Each item is a
3552 dictionary containing the entries "word",
3553 "abbr", "menu", "kind", "info" and "user_data".
3554 See |complete-items|.
3555 selected Selected item index. First index is zero.
3556 Index is -1 if no item is selected (showing
3557 typed text only)
3558 inserted Inserted string. [NOT IMPLEMENT YET]
3559
3560 *complete_info_mode*
3561 mode values are:
3562 "" Not in completion mode
3563 "keyword" Keyword completion |i_CTRL-X_CTRL-N|
3564 "ctrl_x" Just pressed CTRL-X |i_CTRL-X|
3565 "whole_line" Whole lines |i_CTRL-X_CTRL-L|
3566 "files" File names |i_CTRL-X_CTRL-F|
3567 "tags" Tags |i_CTRL-X_CTRL-]|
3568 "path_defines" Definition completion |i_CTRL-X_CTRL-D|
3569 "path_patterns" Include completion |i_CTRL-X_CTRL-I|
3570 "dictionary" Dictionary |i_CTRL-X_CTRL-K|
3571 "thesaurus" Thesaurus |i_CTRL-X_CTRL-T|
3572 "cmdline" Vim Command line |i_CTRL-X_CTRL-V|
3573 "function" User defined completion |i_CTRL-X_CTRL-U|
3574 "omni" Omni completion |i_CTRL-X_CTRL-O|
3575 "spell" Spelling suggestions |i_CTRL-X_s|
3576 "eval" |complete()| completion
3577 "unknown" Other internal modes
3578
3579 If the optional {what} list argument is supplied, then only
3580 the items listed in {what} are returned. Unsupported items in
3581 {what} are silently ignored.
3582
3583 Examples: >
3584 " Get all items
3585 call complete_info()
3586 " Get only 'mode'
3587 call complete_info(['mode'])
3588 " Get only 'mode' and 'pum_visible'
3589 call complete_info(['mode', 'pum_visible'])
3590 <
3541 *confirm()* 3591 *confirm()*
3542 confirm({msg} [, {choices} [, {default} [, {type}]]]) 3592 confirm({msg} [, {choices} [, {default} [, {type}]]])
3543 confirm() offers the user a dialog, from which a choice can be 3593 confirm() offers the user a dialog, from which a choice can be
3544 made. It returns the number of the choice. For the first 3594 made. It returns the number of the choice. For the first
3545 choice this is 1. 3595 choice this is 1.
4976 location list window. See 5026 location list window. See
4977 |location-list-file-window| for more 5027 |location-list-file-window| for more
4978 details. 5028 details.
4979 5029
4980 getmatches() *getmatches()* 5030 getmatches() *getmatches()*
4981 Returns a |List| with all matches previously defined by 5031 Returns a |List| with all matches previously defined for the
4982 |matchadd()| and the |:match| commands. |getmatches()| is 5032 current window by |matchadd()| and the |:match| commands.
4983 useful in combination with |setmatches()|, as |setmatches()| 5033 |getmatches()| is useful in combination with |setmatches()|,
4984 can restore a list of matches saved by |getmatches()|. 5034 as |setmatches()| can restore a list of matches saved by
5035 |getmatches()|.
4985 Example: > 5036 Example: >
4986 :echo getmatches() 5037 :echo getmatches()
4987 < [{'group': 'MyGroup1', 'pattern': 'TODO', 5038 < [{'group': 'MyGroup1', 'pattern': 'TODO',
4988 'priority': 10, 'id': 1}, {'group': 'MyGroup2', 5039 'priority': 10, 'id': 1}, {'group': 'MyGroup2',
4989 'pattern': 'FIXME', 'priority': 10, 'id': 2}] > 5040 'pattern': 'FIXME', 'priority': 10, 'id': 2}] >
7837 If the optional {what} dictionary argument is supplied, then 7888 If the optional {what} dictionary argument is supplied, then
7838 only the items listed in {what} are set. Refer to |setqflist()| 7889 only the items listed in {what} are set. Refer to |setqflist()|
7839 for the list of supported keys in {what}. 7890 for the list of supported keys in {what}.
7840 7891
7841 setmatches({list}) *setmatches()* 7892 setmatches({list}) *setmatches()*
7842 Restores a list of matches saved by |getmatches()|. Returns 0 7893 Restores a list of matches saved by |getmatches() for the
7843 if successful, otherwise -1. All current matches are cleared 7894 current window|. Returns 0 if successful, otherwise -1. All
7844 before the list is restored. See example for |getmatches()|. 7895 current matches are cleared before the list is restored. See
7896 example for |getmatches()|.
7845 7897
7846 *setpos()* 7898 *setpos()*
7847 setpos({expr}, {list}) 7899 setpos({expr}, {list})
7848 Set the position for {expr}. Possible values: 7900 Set the position for {expr}. Possible values:
7849 . the cursor 7901 . the cursor