comparison runtime/doc/eval.txt @ 19657:da791e5c0139 v8.2.0385

patch 8.2.0385: menu functionality insufficiently tested Commit: https://github.com/vim/vim/commit/0eabd4dc8ff50658f0ea0e92c7918a42242f6b80 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Mar 15 16:13:53 2020 +0100 patch 8.2.0385: menu functionality insufficiently tested Problem: Menu functionality insufficiently tested. Solution: Add tests. Add menu_info(). (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5760)
author Bram Moolenaar <Bram@vim.org>
date Sun, 15 Mar 2020 16:15:04 +0100
parents 847a300aa244
children bceeded72898
comparison
equal deleted inserted replaced
19656:df9b03a56543 19657:da791e5c0139
2599 matchstr({expr}, {pat} [, {start} [, {count}]]) 2599 matchstr({expr}, {pat} [, {start} [, {count}]])
2600 String {count}'th match of {pat} in {expr} 2600 String {count}'th match of {pat} in {expr}
2601 matchstrpos({expr}, {pat} [, {start} [, {count}]]) 2601 matchstrpos({expr}, {pat} [, {start} [, {count}]])
2602 List {count}'th match of {pat} in {expr} 2602 List {count}'th match of {pat} in {expr}
2603 max({expr}) Number maximum value of items in {expr} 2603 max({expr}) Number maximum value of items in {expr}
2604 menu_info({name} [, {mode}]) Dict get menu item information
2604 min({expr}) Number minimum value of items in {expr} 2605 min({expr}) Number minimum value of items in {expr}
2605 mkdir({name} [, {path} [, {prot}]]) 2606 mkdir({name} [, {path} [, {prot}]])
2606 Number create directory {name} 2607 Number create directory {name}
2607 mode([expr]) String current editing mode 2608 mode([expr]) String current editing mode
2608 mzeval({expr}) any evaluate |MzScheme| expression 2609 mzeval({expr}) any evaluate |MzScheme| expression
7122 The type isn't changed, it's not necessarily a String. 7123 The type isn't changed, it's not necessarily a String.
7123 7124
7124 Can also be used as a |method|: > 7125 Can also be used as a |method|: >
7125 GetText()->matchstrpos('word') 7126 GetText()->matchstrpos('word')
7126 < 7127 <
7128
7127 *max()* 7129 *max()*
7128 max({expr}) Return the maximum value of all items in {expr}. 7130 max({expr}) Return the maximum value of all items in {expr}.
7129 {expr} can be a List or a Dictionary. For a Dictionary, 7131 {expr} can be a List or a Dictionary. For a Dictionary,
7130 it returns the maximum of all values in the Dictionary. 7132 it returns the maximum of all values in the Dictionary.
7131 If {expr} is neither a List nor a Dictionary, or one of the 7133 If {expr} is neither a List nor a Dictionary, or one of the
7132 items in {expr} cannot be used as a Number this results in 7134 items in {expr} cannot be used as a Number this results in
7133 an error. An empty |List| or |Dictionary| results in zero. 7135 an error. An empty |List| or |Dictionary| results in zero.
7134 7136
7135 Can also be used as a |method|: > 7137 Can also be used as a |method|: >
7136 mylist->max() 7138 mylist->max()
7139
7140
7141 menu_info({name} [, {mode}]) *menu_info()*
7142 Return information about the specified menu {name} in
7143 mode {mode}. The menu name should be specified without the
7144 shortcut character ('&').
7145
7146 {mode} can be one of these strings:
7147 "n" Normal
7148 "v" Visual (including Select)
7149 "o" Operator-pending
7150 "i" Insert
7151 "c" Cmd-line
7152 "s" Select
7153 "x" Visual
7154 "t" Terminal-Job
7155 "" Normal, Visual and Operator-pending
7156 "!" Insert and Cmd-line
7157 When {mode} is omitted, the modes for "" are used.
7158
7159 Returns a |Dictionary| containing the following items:
7160 accel menu item accelerator text |menu-text|
7161 display display name (name without '&')
7162 enabled v:true if this menu item is enabled
7163 Refer to |:menu-enable|
7164 icon name of the icon file (for toolbar)
7165 |toolbar-icon|
7166 iconidx index of a built-in icon
7167 modes modes for which the menu is defined. In
7168 addition to the modes mentioned above, these
7169 characters will be used:
7170 " " Normal, Visual and Operator-pending
7171 name menu item name.
7172 noremenu v:true if the {rhs} of the menu item is not
7173 remappable else v:false.
7174 priority menu order priority |menu-priority|
7175 rhs right-hand-side of the menu item. The returned
7176 string has special characters translated like
7177 in the output of the ":menu" command listing.
7178 When the {rhs} of a menu item is empty, then
7179 "<Nop>" is returned.
7180 script v:true if script-local remapping of {rhs} is
7181 allowed else v:false. See |:menu-script|.
7182 shortcut shortcut key (character after '&' in
7183 the menu name) |menu-shortcut|
7184 silent v:true if the menu item is created
7185 with <silent> argument |:menu-silent|
7186 submenus |List| containing the names of
7187 all the submenus. Present only if the menu
7188 item has submenus.
7189
7190 Returns an empty dictionary if the menu item is not found.
7191
7192 Examples: >
7193 :echo maparg('Edit.Cut')
7194 :echo maparg('File.Save', 'n')
7195 <
7196 Can also be used as a |method|: >
7197 GetMenuName()->maparg('v')
7198
7137 7199
7138 < *min()* 7200 < *min()*
7139 min({expr}) Return the minimum value of all items in {expr}. 7201 min({expr}) Return the minimum value of all items in {expr}.
7140 {expr} can be a List or a Dictionary. For a Dictionary, 7202 {expr} can be a List or a Dictionary. For a Dictionary,
7141 it returns the minimum of all values in the Dictionary. 7203 it returns the minimum of all values in the Dictionary.