forked from aniani/vim
patch 8.2.2339: cannot get the type of a value as a string
Problem: Cannot get the type of a value as a string. Solution: Add typename().
This commit is contained in:
@@ -3016,7 +3016,8 @@ tr({src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr}
|
||||
trim({text} [, {mask} [, {dir}]])
|
||||
String trim characters in {mask} from {text}
|
||||
trunc({expr}) Float truncate Float {expr}
|
||||
type({name}) Number type of variable {name}
|
||||
type({expr}) Number type of value {expr}
|
||||
typename({expr}) String representation of the type of {expr}
|
||||
undofile({name}) String undo file name for {name}
|
||||
undotree() List undo file tree
|
||||
uniq({list} [, {func} [, {dict}]])
|
||||
@@ -11129,6 +11130,14 @@ type({expr}) The result is a Number representing the type of {expr}.
|
||||
< Can also be used as a |method|: >
|
||||
mylist->type()
|
||||
|
||||
|
||||
typename({expr}) *typename()*
|
||||
Return a string representation of the type of {expr}.
|
||||
Example: >
|
||||
echo typename([1, 2, 3])
|
||||
list<number>
|
||||
|
||||
|
||||
undofile({name}) *undofile()*
|
||||
Return the name of the undo file that would be used for a file
|
||||
with name {name} when writing. This uses the 'undodir'
|
||||
|
||||
@@ -720,7 +720,8 @@ Other computation: *bitwise-function*
|
||||
srand() initialize seed used by rand()
|
||||
|
||||
Variables: *var-functions*
|
||||
type() type of a variable
|
||||
type() type of a variable as a number
|
||||
typename() type of a variable as text
|
||||
islocked() check if a variable is locked
|
||||
funcref() get a Funcref for a function reference
|
||||
function() get a Funcref for a function name
|
||||
|
||||
Reference in New Issue
Block a user