Mercurial > vim
comparison src/evalfunc.c @ 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 |
---|---|
111 static void f_col(typval_T *argvars, typval_T *rettv); | 111 static void f_col(typval_T *argvars, typval_T *rettv); |
112 #if defined(FEAT_INS_EXPAND) | 112 #if defined(FEAT_INS_EXPAND) |
113 static void f_complete(typval_T *argvars, typval_T *rettv); | 113 static void f_complete(typval_T *argvars, typval_T *rettv); |
114 static void f_complete_add(typval_T *argvars, typval_T *rettv); | 114 static void f_complete_add(typval_T *argvars, typval_T *rettv); |
115 static void f_complete_check(typval_T *argvars, typval_T *rettv); | 115 static void f_complete_check(typval_T *argvars, typval_T *rettv); |
116 static void f_complete_info(typval_T *argvars, typval_T *rettv); | |
116 #endif | 117 #endif |
117 static void f_confirm(typval_T *argvars, typval_T *rettv); | 118 static void f_confirm(typval_T *argvars, typval_T *rettv); |
118 static void f_copy(typval_T *argvars, typval_T *rettv); | 119 static void f_copy(typval_T *argvars, typval_T *rettv); |
119 #ifdef FEAT_FLOAT | 120 #ifdef FEAT_FLOAT |
120 static void f_cos(typval_T *argvars, typval_T *rettv); | 121 static void f_cos(typval_T *argvars, typval_T *rettv); |
591 {"col", 1, 1, f_col}, | 592 {"col", 1, 1, f_col}, |
592 #if defined(FEAT_INS_EXPAND) | 593 #if defined(FEAT_INS_EXPAND) |
593 {"complete", 2, 2, f_complete}, | 594 {"complete", 2, 2, f_complete}, |
594 {"complete_add", 1, 1, f_complete_add}, | 595 {"complete_add", 1, 1, f_complete_add}, |
595 {"complete_check", 0, 0, f_complete_check}, | 596 {"complete_check", 0, 0, f_complete_check}, |
597 {"complete_info", 0, 1, f_complete_info}, | |
596 #endif | 598 #endif |
597 {"confirm", 1, 4, f_confirm}, | 599 {"confirm", 1, 4, f_confirm}, |
598 {"copy", 1, 1, f_copy}, | 600 {"copy", 1, 1, f_copy}, |
599 #ifdef FEAT_FLOAT | 601 #ifdef FEAT_FLOAT |
600 {"cos", 1, 1, f_cos}, | 602 {"cos", 1, 1, f_cos}, |
2598 RedrawingDisabled = 0; | 2600 RedrawingDisabled = 0; |
2599 ins_compl_check_keys(0, TRUE); | 2601 ins_compl_check_keys(0, TRUE); |
2600 rettv->vval.v_number = compl_interrupted; | 2602 rettv->vval.v_number = compl_interrupted; |
2601 RedrawingDisabled = saved; | 2603 RedrawingDisabled = saved; |
2602 } | 2604 } |
2605 | |
2606 /* | |
2607 * "complete_info()" function | |
2608 */ | |
2609 static void | |
2610 f_complete_info(typval_T *argvars, typval_T *rettv) | |
2611 { | |
2612 list_T *what_list = NULL; | |
2613 | |
2614 if (rettv_dict_alloc(rettv) != OK) | |
2615 return; | |
2616 | |
2617 if (argvars[0].v_type != VAR_UNKNOWN) | |
2618 { | |
2619 if (argvars[0].v_type != VAR_LIST) | |
2620 { | |
2621 emsg(_(e_listreq)); | |
2622 return; | |
2623 } | |
2624 what_list = argvars[0].vval.v_list; | |
2625 } | |
2626 get_complete_info(what_list, rettv->vval.v_dict); | |
2627 } | |
2603 #endif | 2628 #endif |
2604 | 2629 |
2605 /* | 2630 /* |
2606 * "confirm(message, buttons[, default [, type]])" function | 2631 * "confirm(message, buttons[, default [, type]])" function |
2607 */ | 2632 */ |