comparison runtime/doc/eval.txt @ 17366:9843fbfa0ee5 v8.1.1682

patch 8.1.1682: placing a larger number of signs is slow commit https://github.com/vim/vim/commit/809ce4d317fe12db0b2c17f16b4f77200fb060c4 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 13 21:21:40 2019 +0200 patch 8.1.1682: placing a larger number of signs is slow Problem: Placing a larger number of signs is slow. Solution: Add functions for dealing with a list of signs. (Yegappan Lakshmanan, closes #4636)
author Bram Moolenaar <Bram@vim.org>
date Sat, 13 Jul 2019 21:30:04 +0200
parents 8a095d343c59
children 6604ecb7a615
comparison
equal deleted inserted replaced
17365:c6491636f12e 17366:9843fbfa0ee5
1 *eval.txt* For Vim version 8.1. Last change: 2019 Jul 04 1 *eval.txt* For Vim version 8.1. Last change: 2019 Jul 13
2 2
3 3
4 VIM REFERENCE MANUAL by Bram Moolenaar 4 VIM REFERENCE MANUAL by Bram Moolenaar
5 5
6 6
2658 shellescape({string} [, {special}]) 2658 shellescape({string} [, {special}])
2659 String escape {string} for use as shell 2659 String escape {string} for use as shell
2660 command argument 2660 command argument
2661 shiftwidth([{col}]) Number effective value of 'shiftwidth' 2661 shiftwidth([{col}]) Number effective value of 'shiftwidth'
2662 sign_define({name} [, {dict}]) Number define or update a sign 2662 sign_define({name} [, {dict}]) Number define or update a sign
2663 sign_define({list}) List define or update a list of signs
2663 sign_getdefined([{name}]) List get a list of defined signs 2664 sign_getdefined([{name}]) List get a list of defined signs
2664 sign_getplaced([{expr} [, {dict}]]) 2665 sign_getplaced([{expr} [, {dict}]])
2665 List get a list of placed signs 2666 List get a list of placed signs
2666 sign_jump({id}, {group}, {expr}) 2667 sign_jump({id}, {group}, {expr})
2667 Number jump to a sign 2668 Number jump to a sign
2668 sign_place({id}, {group}, {name}, {expr} [, {dict}]) 2669 sign_place({id}, {group}, {name}, {expr} [, {dict}])
2669 Number place a sign 2670 Number place a sign
2671 sign_placelist({list}) List place a list of signs
2670 sign_undefine([{name}]) Number undefine a sign 2672 sign_undefine([{name}]) Number undefine a sign
2673 sign_undefine({list}) List undefine a list of signs
2671 sign_unplace({group} [, {dict}]) 2674 sign_unplace({group} [, {dict}])
2672 Number unplace a sign 2675 Number unplace a sign
2676 sign_unplacelist({list}) List unplace a list of signs
2673 simplify({filename}) String simplify filename as much as possible 2677 simplify({filename}) String simplify filename as much as possible
2674 sin({expr}) Float sine of {expr} 2678 sin({expr}) Float sine of {expr}
2675 sinh({expr}) Float hyperbolic sine of {expr} 2679 sinh({expr}) Float hyperbolic sine of {expr}
2676 sort({list} [, {func} [, {dict}]]) 2680 sort({list} [, {func} [, {dict}]])
2677 List sort {list}, using {func} to compare 2681 List sort {list}, using {func} to compare
6492 values, see |bufname()|. When {buf} is omitted the current 6496 values, see |bufname()|. When {buf} is omitted the current
6493 buffer is used. 6497 buffer is used.
6494 6498
6495 listener_remove({id}) *listener_remove()* 6499 listener_remove({id}) *listener_remove()*
6496 Remove a listener previously added with listener_add(). 6500 Remove a listener previously added with listener_add().
6501 Returns zero when {id} could not be found, one when {id} was
6502 removed.
6497 6503
6498 localtime() *localtime()* 6504 localtime() *localtime()*
6499 Return the current time, measured as seconds since 1st Jan 6505 Return the current time, measured as seconds since 1st Jan
6500 1970. See also |strftime()| and |getftime()|. 6506 1970. See also |strftime()| and |getftime()|.
6501 6507
8622 for which to return the 'shiftwidth' value. This matters for the 8628 for which to return the 'shiftwidth' value. This matters for the
8623 'vartabstop' feature. If the 'vartabstop' setting is enabled and 8629 'vartabstop' feature. If the 'vartabstop' setting is enabled and
8624 no {col} argument is given, column 1 will be assumed. 8630 no {col} argument is given, column 1 will be assumed.
8625 8631
8626 sign_define({name} [, {dict}]) *sign_define()* 8632 sign_define({name} [, {dict}]) *sign_define()*
8633 sign_define({list})
8627 Define a new sign named {name} or modify the attributes of an 8634 Define a new sign named {name} or modify the attributes of an
8628 existing sign. This is similar to the |:sign-define| command. 8635 existing sign. This is similar to the |:sign-define| command.
8629 8636
8630 Prefix {name} with a unique text to avoid name collisions. 8637 Prefix {name} with a unique text to avoid name collisions.
8631 There is no {group} like with placing signs. 8638 There is no {group} like with placing signs.
8641 texthl highlight group used for the text item 8648 texthl highlight group used for the text item
8642 8649
8643 If the sign named {name} already exists, then the attributes 8650 If the sign named {name} already exists, then the attributes
8644 of the sign are updated. 8651 of the sign are updated.
8645 8652
8646 Returns 0 on success and -1 on failure. 8653 The one argument {list} can be used to define a list of signs.
8654 Each list item is a dictionary with the above items in {dict}
8655 and a 'name' item for the sign name.
8656
8657 Returns 0 on success and -1 on failure. When the one argument
8658 {list} is used, then returns a List of values one for each
8659 defined sign.
8647 8660
8648 Examples: > 8661 Examples: >
8649 call sign_define("mySign", {"text" : "=>", "texthl" : 8662 call sign_define("mySign", {
8650 \ "Error", "linehl" : "Search"}) 8663 \ "text" : "=>",
8664 \ "texthl" : "Error",
8665 \ "linehl" : "Search"})
8666 call sign_define([
8667 \ {'name' : 'sign1',
8668 \ 'text' : '=>'},
8669 \ {'name' : 'sign2',
8670 \ 'text' : '!!'}
8671 \ ])
8651 < 8672 <
8652 sign_getdefined([{name}]) *sign_getdefined()* 8673 sign_getdefined([{name}]) *sign_getdefined()*
8653 Get a list of defined signs and their attributes. 8674 Get a list of defined signs and their attributes.
8654 This is similar to the |:sign-list| command. 8675 This is similar to the |:sign-list| command.
8655 8676
8799 " Place a sign named sign4 with id 10 in group 'g3' 8820 " Place a sign named sign4 with id 10 in group 'g3'
8800 " at line 40 in buffer json.c with priority 90 8821 " at line 40 in buffer json.c with priority 90
8801 call sign_place(10, 'g3', 'sign4', 'json.c', 8822 call sign_place(10, 'g3', 'sign4', 'json.c',
8802 \ {'lnum' : 40, 'priority' : 90}) 8823 \ {'lnum' : 40, 'priority' : 90})
8803 < 8824 <
8825 *sign_placelist()*
8826 sign_placelist({list})
8827 Place one or more signs. This is similar to the
8828 |sign_place()| function. The {list} argument specifies the
8829 List of signs to place. Each list item is a dict with the
8830 following sign attributes:
8831 buffer buffer name or number. For the accepted
8832 values, see |bufname()|.
8833 group sign group. {group} functions as a namespace
8834 for {id}, thus two groups can use the same
8835 IDs. If not specified or set to an empty
8836 string, then the global group is used. See
8837 |sign-group| for more information.
8838 id sign identifier. If not specified or zero,
8839 then a new unique identifier is allocated.
8840 Otherwise the specified number is used. See
8841 |sign-identifier| for more information.
8842 lnum line number in the buffer {expr} where the
8843 sign is to be placed. For the accepted values,
8844 see |line()|.
8845 name name of the sign to place. See |sign_define()|
8846 for more information.
8847 priority priority of the sign. When multiple signs are
8848 placed on a line, the sign with the highest
8849 priority is used. If not specified, the
8850 default value of 10 is used. See
8851 |sign-priority| for more information.
8852
8853 If {id} refers to an existing sign, then the existing sign is
8854 modified to use the specified {name} and/or {priority}.
8855
8856 Returns a List of sign identifiers. If failed to place a
8857 sign, the corresponding list item is set to -1.
8858
8859 Examples: >
8860 " Place sign s1 with id 5 at line 20 and id 10 at line
8861 " 30 in buffer a.c
8862 let [n1, n2] = sign_place([
8863 \ {'id' : 5,
8864 \ 'name' : 's1',
8865 \ 'buffer' : 'a.c',
8866 \ 'lnum' : 20},
8867 \ {'id' : 10,
8868 \ 'name' : 's1',
8869 \ 'buffer' : 'a.c',
8870 \ 'lnum' : 30}
8871 \ ])
8872
8873 " Place sign s1 in buffer a.c at line 40 and 50
8874 " with auto-generated identifiers
8875 let [n1, n2] = sign_place([
8876 \ {'name' : 's1',
8877 \ 'buffer' : 'a.c',
8878 \ 'lnum' : 40},
8879 \ {'name' : 's1',
8880 \ 'buffer' : 'a.c',
8881 \ 'lnum' : 50}
8882 \ ])
8883 <
8804 sign_undefine([{name}]) *sign_undefine()* 8884 sign_undefine([{name}]) *sign_undefine()*
8885 sign_undefine({list})
8805 Deletes a previously defined sign {name}. This is similar to 8886 Deletes a previously defined sign {name}. This is similar to
8806 the |:sign-undefine| command. If {name} is not supplied, then 8887 the |:sign-undefine| command. If {name} is not supplied, then
8807 deletes all the defined signs. 8888 deletes all the defined signs.
8808 8889
8809 Returns 0 on success and -1 on failure. 8890 The one argument {list} can be used to undefine a list of
8891 signs. Each list item is the name of a sign.
8892
8893 Returns 0 on success and -1 on failure. For the one argument
8894 {list} call, returns a list of values one for each undefined
8895 sign.
8810 8896
8811 Examples: > 8897 Examples: >
8812 " Delete a sign named mySign 8898 " Delete a sign named mySign
8813 call sign_undefine("mySign") 8899 call sign_undefine("mySign")
8900
8901 " Delete signs 'sign1' and 'sign2'
8902 call sign_undefine(["sign1", "sign2"])
8814 8903
8815 " Delete all the signs 8904 " Delete all the signs
8816 call sign_undefine() 8905 call sign_undefine()
8817 < 8906 <
8818 sign_unplace({group} [, {dict}]) *sign_unplace()* 8907 sign_unplace({group} [, {dict}]) *sign_unplace()*
8854 " Remove sign 40 from all the buffers 8943 " Remove sign 40 from all the buffers
8855 call sign_unplace('*', {'id' : 40}) 8944 call sign_unplace('*', {'id' : 40})
8856 8945
8857 " Remove all the placed signs from all the buffers 8946 " Remove all the placed signs from all the buffers
8858 call sign_unplace('*') 8947 call sign_unplace('*')
8948 <
8949 sign_unplacelist({list}) *sign_unplacelist()*
8950 Remove previously placed signs from one or more buffers. This
8951 is similar to the |sign_unplace()| function.
8952
8953 The {list} argument specifies the List of signs to remove.
8954 Each list item is a dict with the following sign attributes:
8955 buffer buffer name or number. For the accepted
8956 values, see |bufname()|. If not specified,
8957 then the specified sign is removed from all
8958 the buffers.
8959 group sign group name. If not specified or set to an
8960 empty string, then the global sign group is
8961 used. If set to '*', then all the groups
8962 including the global group are used.
8963 id sign identifier. If not specified, then all
8964 the signs in the specified group are removed.
8965
8966 Returns a List where an entry is set to 0 if the corresponding
8967 sign was successfully removed or -1 on failure.
8968
8969 Example: >
8970 " Remove sign with id 10 from buffer a.vim and sign
8971 " with id 20 from buffer b.vim
8972 call sign_unplace([{'id' : 10, 'buffer' : "a.vim"},
8973 \ {'id' : 20, 'buffer' : 'b.vim'}])
8859 < 8974 <
8860 simplify({filename}) *simplify()* 8975 simplify({filename}) *simplify()*
8861 Simplify the file name as much as possible without changing 8976 Simplify the file name as much as possible without changing
8862 the meaning. Shortcuts (on MS-Windows) or symbolic links (on 8977 the meaning. Shortcuts (on MS-Windows) or symbolic links (on
8863 Unix) are not resolved. If the first path component in 8978 Unix) are not resolved. If the first path component in
9915 10030
9916 {only available when compiled with the |+timers| feature} 10031 {only available when compiled with the |+timers| feature}
9917 10032
9918 timer_stopall() *timer_stopall()* 10033 timer_stopall() *timer_stopall()*
9919 Stop all timers. The timer callbacks will no longer be 10034 Stop all timers. The timer callbacks will no longer be
9920 invoked. Useful if some timers is misbehaving. If there are 10035 invoked. Useful if a timer is misbehaving. If there are no
9921 no timers there is no error. 10036 timers there is no error.
9922 10037
9923 {only available when compiled with the |+timers| feature} 10038 {only available when compiled with the |+timers| feature}
9924 10039
9925 tolower({expr}) *tolower()* 10040 tolower({expr}) *tolower()*
9926 The result is a copy of the String given, with all uppercase 10041 The result is a copy of the String given, with all uppercase