mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
commit
5679ceb3a8
@ -1718,6 +1718,21 @@ v:swapcommand Normal mode command to be executed after a file has been
|
||||
example, when jumping to a tag the value is ":tag tagname\r".
|
||||
For ":edit +cmd file" the value is ":cmd\r".
|
||||
|
||||
*v:t_TYPE* *v:t_bool* *t_bool-varialble*
|
||||
v:t_bool Value of Boolean type. Read-only. See: |type()|
|
||||
*v:t_dict* *t_dict-varialble*
|
||||
v:t_dict Value of Dictionary type. Read-only. See: |type()|
|
||||
*v:t_float* *t_float-varialble*
|
||||
v:t_float Value of Float type. Read-only. See: |type()|
|
||||
*v:t_func* *t_func-varialble*
|
||||
v:t_func Value of Funcref type. Read-only. See: |type()|
|
||||
*v:t_list* *t_list-varialble*
|
||||
v:t_list Value of List type. Read-only. See: |type()|
|
||||
*v:t_number* *t_number-varialble*
|
||||
v:t_number Value of Number type. Read-only. See: |type()|
|
||||
*v:t_string* *t_string-varialble*
|
||||
v:t_string Value of String type. Read-only. See: |type()|
|
||||
|
||||
*v:termresponse* *termresponse-variable*
|
||||
v:termresponse The escape sequence returned by the terminal for the |t_RV|
|
||||
termcap entry. It is set when Vim receives an escape sequence
|
||||
|
@ -387,6 +387,13 @@ static struct vimvar {
|
||||
VV(VV__NULL_LIST, "_null_list", VAR_LIST, VV_RO),
|
||||
VV(VV__NULL_DICT, "_null_dict", VAR_DICT, VV_RO),
|
||||
VV(VV_VIM_DID_ENTER, "vim_did_enter", VAR_NUMBER, VV_RO),
|
||||
VV(VV_TYPE_NUMBER, "t_number", VAR_NUMBER, VV_RO),
|
||||
VV(VV_TYPE_STRING, "t_string", VAR_NUMBER, VV_RO),
|
||||
VV(VV_TYPE_FUNC, "t_func", VAR_NUMBER, VV_RO),
|
||||
VV(VV_TYPE_LIST, "t_list", VAR_NUMBER, VV_RO),
|
||||
VV(VV_TYPE_DICT, "t_dict", VAR_NUMBER, VV_RO),
|
||||
VV(VV_TYPE_FLOAT, "t_float", VAR_NUMBER, VV_RO),
|
||||
VV(VV_TYPE_BOOL, "t_bool", VAR_NUMBER, VV_RO),
|
||||
};
|
||||
#undef VV
|
||||
|
||||
@ -400,7 +407,7 @@ static struct vimvar {
|
||||
#define vv_dict vv_di.di_tv.vval.v_dict
|
||||
#define vv_tv vv_di.di_tv
|
||||
|
||||
static dictitem_T vimvars_var; /* variable used for v: */
|
||||
static dictitem_T vimvars_var; // variable used for v:
|
||||
#define vimvarht vimvardict.dv_hashtab
|
||||
|
||||
typedef struct {
|
||||
@ -563,6 +570,13 @@ void eval_init(void)
|
||||
set_vim_var_nr(VV_SEARCHFORWARD, 1L);
|
||||
set_vim_var_nr(VV_HLSEARCH, 1L);
|
||||
set_vim_var_nr(VV_COUNT1, 1);
|
||||
set_vim_var_nr(VV_TYPE_NUMBER, VAR_TYPE_NUMBER);
|
||||
set_vim_var_nr(VV_TYPE_STRING, VAR_TYPE_STRING);
|
||||
set_vim_var_nr(VV_TYPE_FUNC, VAR_TYPE_FUNC);
|
||||
set_vim_var_nr(VV_TYPE_LIST, VAR_TYPE_LIST);
|
||||
set_vim_var_nr(VV_TYPE_DICT, VAR_TYPE_DICT);
|
||||
set_vim_var_nr(VV_TYPE_FLOAT, VAR_TYPE_FLOAT);
|
||||
set_vim_var_nr(VV_TYPE_BOOL, VAR_TYPE_BOOL);
|
||||
|
||||
set_vim_var_special(VV_FALSE, kSpecialVarFalse);
|
||||
set_vim_var_special(VV_TRUE, kSpecialVarTrue);
|
||||
@ -16801,17 +16815,17 @@ static void f_type(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
int n = -1;
|
||||
|
||||
switch (argvars[0].v_type) {
|
||||
case VAR_NUMBER: n = 0; break;
|
||||
case VAR_STRING: n = 1; break;
|
||||
case VAR_FUNC: n = 2; break;
|
||||
case VAR_LIST: n = 3; break;
|
||||
case VAR_DICT: n = 4; break;
|
||||
case VAR_FLOAT: n = 5; break;
|
||||
case VAR_NUMBER: n = VAR_TYPE_NUMBER; break;
|
||||
case VAR_STRING: n = VAR_TYPE_STRING; break;
|
||||
case VAR_FUNC: n = VAR_TYPE_FUNC; break;
|
||||
case VAR_LIST: n = VAR_TYPE_LIST; break;
|
||||
case VAR_DICT: n = VAR_TYPE_DICT; break;
|
||||
case VAR_FLOAT: n = VAR_TYPE_FLOAT; break;
|
||||
case VAR_SPECIAL: {
|
||||
switch (argvars[0].vval.v_special) {
|
||||
case kSpecialVarTrue:
|
||||
case kSpecialVarFalse: {
|
||||
n = 6;
|
||||
n = VAR_TYPE_BOOL;
|
||||
break;
|
||||
}
|
||||
case kSpecialVarNull: {
|
||||
|
@ -127,6 +127,13 @@ typedef enum {
|
||||
VV__NULL_LIST, // List with NULL value. For test purposes only.
|
||||
VV__NULL_DICT, // Dictionary with NULL value. For test purposes only.
|
||||
VV_VIM_DID_ENTER,
|
||||
VV_TYPE_NUMBER,
|
||||
VV_TYPE_STRING,
|
||||
VV_TYPE_FUNC,
|
||||
VV_TYPE_LIST,
|
||||
VV_TYPE_DICT,
|
||||
VV_TYPE_FLOAT,
|
||||
VV_TYPE_BOOL,
|
||||
} VimVarIndex;
|
||||
|
||||
/// All recognized msgpack types
|
||||
|
@ -949,6 +949,14 @@ func Test_type()
|
||||
call assert_equal(6, type(v:false))
|
||||
call assert_equal(6, type(v:true))
|
||||
call assert_equal(7, type(v:null))
|
||||
call assert_equal(v:t_number, type(0))
|
||||
call assert_equal(v:t_string, type(""))
|
||||
call assert_equal(v:t_func, type(function("tr")))
|
||||
call assert_equal(v:t_list, type([]))
|
||||
call assert_equal(v:t_dict, type({}))
|
||||
call assert_equal(v:t_float, type(0.0))
|
||||
call assert_equal(v:t_bool, type(v:false))
|
||||
call assert_equal(v:t_bool, type(v:true))
|
||||
endfunc
|
||||
|
||||
"-------------------------------------------------------------------------------
|
||||
|
@ -371,7 +371,7 @@ static int included_patches[] = {
|
||||
// 2074,
|
||||
// 2073,
|
||||
// 2072,
|
||||
// 2071,
|
||||
2071,
|
||||
// 2070 NA
|
||||
// 2069,
|
||||
// 2068,
|
||||
|
@ -123,6 +123,14 @@ Error: configure did not run properly.Check auto/config.log.
|
||||
#define FAIL 0
|
||||
#define NOTDONE 2 /* not OK or FAIL but skipped */
|
||||
|
||||
// Type values for type().
|
||||
#define VAR_TYPE_NUMBER 0
|
||||
#define VAR_TYPE_STRING 1
|
||||
#define VAR_TYPE_FUNC 2
|
||||
#define VAR_TYPE_LIST 3
|
||||
#define VAR_TYPE_DICT 4
|
||||
#define VAR_TYPE_FLOAT 5
|
||||
#define VAR_TYPE_BOOL 6
|
||||
|
||||
/*
|
||||
* values for xp_context when doing command line completion
|
||||
|
Loading…
Reference in New Issue
Block a user