Skip to content

Commit 0cbe2b7

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents 923602e + e0c3c3d commit 0cbe2b7

22 files changed

Lines changed: 653 additions & 52 deletions

runtime/doc/change.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,6 +1688,10 @@ B When joining lines, don't insert a space between two multi-byte
16881688
characters. Overruled by the 'M' flag.
16891689
1 Don't break a line after a one-letter word. It's broken before it
16901690
instead (if possible).
1691+
] Respect textwidth rigorously. With this flag set, no line can be
1692+
longer than textwidth, unless line-break-prohibition rules make this
1693+
impossible. Mainly for CJK scripts and works only if 'encoding' is
1694+
"utf-8".
16911695
j Where it makes sense, remove a comment leader when joining lines. For
16921696
example, joining:
16931697
int i; // the index ~

runtime/doc/eval.txt

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*eval.txt* For Vim version 8.2. Last change: 2020 May 25
1+
*eval.txt* For Vim version 8.2. Last change: 2020 Jun 03
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2358,7 +2358,6 @@ assert_notmatch({pat}, {text} [, {msg}])
23582358
Number assert {pat} not matches {text}
23592359
assert_report({msg}) Number report a test failure
23602360
assert_true({actual} [, {msg}]) Number assert {actual} is true
2361-
asin({expr}) Float arc sine of {expr}
23622361
atan({expr}) Float arc tangent of {expr}
23632362
atan2({expr1}, {expr2}) Float arc tangent of {expr1} / {expr2}
23642363
balloon_gettext() String current text in the balloon
@@ -2449,12 +2448,12 @@ executable({expr}) Number 1 if executable {expr} exists
24492448
execute({command}) String execute {command} and get the output
24502449
exepath({expr}) String full path of the command {expr}
24512450
exists({expr}) Number |TRUE| if {expr} exists
2452-
extend({expr1}, {expr2} [, {expr3}])
2453-
List/Dict insert items of {expr2} into {expr1}
24542451
exp({expr}) Float exponential of {expr}
24552452
expand({expr} [, {nosuf} [, {list}]])
24562453
any expand special keywords in {expr}
24572454
expandcmd({expr}) String expand {expr} like with `:edit`
2455+
extend({expr1}, {expr2} [, {expr3}])
2456+
List/Dict insert items of {expr2} into {expr1}
24582457
feedkeys({string} [, {mode}]) Number add key sequence to typeahead buffer
24592458
filereadable({file}) Number |TRUE| if {file} is a readable file
24602459
filewritable({file}) Number |TRUE| if {file} is a writable file
@@ -2549,8 +2548,8 @@ histadd({history}, {item}) Number add an item to a history
25492548
histdel({history} [, {item}]) Number remove an item from a history
25502549
histget({history} [, {index}]) String get the item {index} from a history
25512550
histnr({history}) Number highest index of a history
2552-
hlexists({name}) Number |TRUE| if highlight group {name} exists
25532551
hlID({name}) Number syntax ID of highlight group {name}
2552+
hlexists({name}) Number |TRUE| if highlight group {name} exists
25542553
hostname() String name of the machine Vim is running on
25552554
iconv({expr}, {from}, {to}) String convert encoding of {expr}
25562555
indent({lnum}) Number indent of line {lnum}
@@ -2650,16 +2649,16 @@ popup_findpreview() Number get window ID of preview popup window
26502649
popup_getoptions({id}) Dict get options of popup window {id}
26512650
popup_getpos({id}) Dict get position of popup window {id}
26522651
popup_hide({id}) none hide popup menu {id}
2653-
popup_list() List get a list of window IDs of al popups
2652+
popup_list() List get a list of window IDs of all popups
26542653
popup_locate({row}, {col}) Number get window ID of popup at position
26552654
popup_menu({what}, {options}) Number create a popup window used as a menu
26562655
popup_move({id}, {options}) none set position of popup window {id}
26572656
popup_notification({what}, {options})
26582657
Number create a notification popup window
2659-
popup_show({id}) none unhide popup window {id}
26602658
popup_setoptions({id}, {options})
26612659
none set options for popup window {id}
26622660
popup_settext({id}, {text}) none set the text of popup window {id}
2661+
popup_show({id}) none unhide popup window {id}
26632662
pow({x}, {y}) Float {x} to the power of {y}
26642663
prevnonblank({lnum}) Number line nr of non-blank line <= {lnum}
26652664
printf({fmt}, {expr1}...) String format text
@@ -2684,8 +2683,8 @@ prop_type_get([{name} [, {props}]])
26842683
prop_type_list([{props}]) List get list of property types
26852684
pum_getpos() Dict position and size of pum if visible
26862685
pumvisible() Number whether popup menu is visible
2687-
pyeval({expr}) any evaluate |Python| expression
26882686
py3eval({expr}) any evaluate |python3| expression
2687+
pyeval({expr}) any evaluate |Python| expression
26892688
pyxeval({expr}) any evaluate |python_x| expression
26902689
rand([{expr}]) Number get pseudo-random number
26912690
range({expr} [, {max} [, {stride}]])
@@ -2812,9 +2811,9 @@ str2list({expr} [, {utf8}]) List convert each character of {expr} to
28122811
ASCII/UTF8 value
28132812
str2nr({expr} [, {base} [, {quoted}]])
28142813
Number convert String to Number
2815-
strchars({expr} [, {skipcc}]) Number character length of the String {expr}
28162814
strcharpart({str}, {start} [, {len}])
28172815
String {len} characters of {str} at {start}
2816+
strchars({expr} [, {skipcc}]) Number character length of the String {expr}
28182817
strdisplaywidth({expr} [, {col}]) Number display length of the String {expr}
28192818
strftime({format} [, {time}]) String format time with a specified format
28202819
strgetchar({str}, {index}) Number get char {index} from {str}
@@ -2847,8 +2846,8 @@ systemlist({expr} [, {input}]) List output of shell command/filter {expr}
28472846
tabpagebuflist([{arg}]) List list of buffer numbers in tab page
28482847
tabpagenr([{arg}]) Number number of current or last tab page
28492848
tabpagewinnr({tabarg} [, {arg}]) Number number of current window in tab page
2850-
taglist({expr} [, {filename}]) List list of tags matching {expr}
28512849
tagfiles() List tags files used
2850+
taglist({expr} [, {filename}]) List list of tags matching {expr}
28522851
tan({expr}) Float tangent of {expr}
28532852
tanh({expr}) Float hyperbolic tangent of {expr}
28542853
tempname() String name for a temporary file
@@ -2872,9 +2871,9 @@ term_gettty({buf}, [{input}]) String get the tty name of a terminal
28722871
term_list() List get the list of terminal buffers
28732872
term_scrape({buf}, {row}) List get row of a terminal screen
28742873
term_sendkeys({buf}, {keys}) none send keystrokes to a terminal
2875-
term_setapi({buf}, {expr}) none set |terminal-api| function name prefix
28762874
term_setansicolors({buf}, {colors})
28772875
none set ANSI palette in GUI color mode
2876+
term_setapi({buf}, {expr}) none set |terminal-api| function name prefix
28782877
term_setkill({buf}, {how}) none set signal to stop job in terminal
28792878
term_setrestore({buf}, {command}) none set command to restore terminal
28802879
term_setsize({buf}, {rows}, {cols})
@@ -2897,16 +2896,16 @@ test_null_job() Job null value for testing
28972896
test_null_list() List null value for testing
28982897
test_null_partial() Funcref null value for testing
28992898
test_null_string() String null value for testing
2900-
test_unknown() any unknown value for testing
2901-
test_void() any void value for testing
29022899
test_option_not_set({name}) none reset flag indicating option was set
29032900
test_override({expr}, {val}) none test with Vim internal overrides
29042901
test_refcount({expr}) Number get the reference count of {expr}
29052902
test_scrollbar({which}, {value}, {dragging})
29062903
none scroll in the GUI for testing
29072904
test_setmouse({row}, {col}) none set the mouse position for testing
2908-
test_srand_seed([seed]) none set seed for testing srand()
29092905
test_settime({expr}) none set current time for testing
2906+
test_srand_seed([seed]) none set seed for testing srand()
2907+
test_unknown() any unknown value for testing
2908+
test_void() any void value for testing
29102909
timer_info([{id}]) List information about timers
29112910
timer_pause({id}, {pause}) none pause or unpause a timer
29122911
timer_start({time}, {callback} [, {options}])
@@ -4409,7 +4408,7 @@ feedkeys({string} [, {mode}]) *feedkeys()*
44094408
script continues.
44104409
Note that if you manage to call feedkeys() while
44114410
executing commands, thus calling it recursively, then
4412-
all typehead will be consumed by the last call.
4411+
all typeahead will be consumed by the last call.
44134412
'!' When used with 'x' will not end Insert mode. Can be
44144413
used in a test when a timer is set to exit Insert mode
44154414
a little later. Useful for testing CursorHoldI.
@@ -4445,7 +4444,7 @@ filewritable({file}) *filewritable()*
44454444
directory, and we can write to it, the result is 2.
44464445

44474446
Can also be used as a |method|: >
4448-
GetName()->filewriteable()
4447+
GetName()->filewritable()
44494448

44504449

44514450
filter({expr1}, {expr2}) *filter()*
@@ -5446,7 +5445,7 @@ getmousepos() *getmousepos()*
54465445
"screenrow" and "screencol" are valid, the others are zero.
54475446

54485447
When on the status line below a window or the vertical
5449-
separater right of a window, the "line" and "column" values
5448+
separator right of a window, the "line" and "column" values
54505449
are zero.
54515450

54525451
When the position is after the text then "column" is the
@@ -6962,7 +6961,7 @@ mapset({mode}, {abbr}, {dict}) *mapset()*
69626961
call mapset('n', 0, save_map)
69636962
< Note that if you are going to replace a map in several modes,
69646963
e.g. with `:map!`, you need to save the mapping for all of
6965-
them, since they can differe.
6964+
them, since they can differ.
69666965

69676966

69686967
match({expr}, {pat} [, {start} [, {count}]]) *match()*
@@ -8559,8 +8558,10 @@ searchcount([{options}]) *searchcount()*
85598558
recompute |Boolean| if |TRUE|, recompute the count
85608559
like |n| or |N| was executed.
85618560
otherwise returns the last
8562-
result by |n|, |N|, or this
8563-
function is returned.
8561+
computed result (when |n| or
8562+
|N| was used when "S" is not
8563+
in 'shortmess', or this
8564+
function was called).
85648565
(default: |TRUE|)
85658566
pattern |String| recompute if this was given
85668567
and different with |@/|.

runtime/doc/usr_41.txt

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*usr_41.txt* For Vim version 8.2. Last change: 2020 Mar 15
1+
*usr_41.txt* For Vim version 8.2. Last change: 2020 Jun 01
22

33
VIM USER MANUAL - by Bram Moolenaar
44

@@ -41,6 +41,11 @@ prefer. And you can use any colon command in it (commands that start with a
4141
specific file type. A complicated macro can be defined by a separate Vim
4242
script file. You can think of other uses yourself.
4343

44+
Note: if you are familiar with Python, you can find a comparison between
45+
Python and Vim script here, with pointers to other documents:
46+
https://gist.github.com/yegappan/16d964a37ead0979b05e655aa036cad0
47+
48+
4449
Let's start with a simple example: >
4550
4651
:let i = 1
@@ -631,6 +636,7 @@ List manipulation: *list-functions*
631636
deepcopy() make a full copy of a List
632637
filter() remove selected items from a List
633638
map() change each List item
639+
reduce() reduce a List to a value
634640
sort() sort a List
635641
reverse() reverse the order of a List
636642
uniq() remove copies of repeated adjacent items
@@ -687,6 +693,7 @@ Floating point computation: *float-functions*
687693
sinh() hyperbolic sine
688694
cosh() hyperbolic cosine
689695
tanh() hyperbolic tangent
696+
isinf() check for infinity
690697
isnan() check for not a number
691698

692699
Other computation: *bitwise-function*
@@ -695,6 +702,8 @@ Other computation: *bitwise-function*
695702
or() bitwise OR
696703
xor() bitwise XOR
697704
sha256() SHA-256 hash
705+
rand() get a pseudo-random number
706+
srand() initialize seed used by rand()
698707

699708
Variables: *var-functions*
700709
type() type of a variable
@@ -744,6 +753,7 @@ Working with text in the current buffer: *text-functions*
744753
prevnonblank() find previous non-blank line
745754
search() find a match for a pattern
746755
searchpos() find a match for a pattern
756+
searchcount() get number of matches before/after the cursor
747757
searchpair() find the other end of a start/skip/end
748758
searchpairpos() find the other end of a start/skip/end
749759
searchdecl() search for the declaration of a name
@@ -828,9 +838,11 @@ Buffers, windows and the argument list:
828838
listener_remove() remove a listener callback
829839
win_findbuf() find windows containing a buffer
830840
win_getid() get window ID of a window
841+
win_gettype() get type of window
831842
win_gotoid() go to window with ID
832843
win_id2tabwin() get tab and window nr from window ID
833844
win_id2win() get window nr from window ID
845+
win_splitmove() move window to a split of another window
834846
getbufinfo() get a list with buffer information
835847
gettabinfo() get a list with tab page information
836848
getwininfo() get a list with window information
@@ -907,6 +919,7 @@ Interactive: *interactive-functions*
907919
getchar() get a character from the user
908920
getcharmod() get modifiers for the last typed character
909921
getmousepos() get last known mouse position
922+
echoraw() output characters as-is
910923
feedkeys() put characters in the typeahead queue
911924
input() get a line from the user
912925
inputlist() let the user pick an entry from a list
@@ -948,6 +961,7 @@ Mappings and Menus: *mapping-functions*
948961
hasmapto() check if a mapping exists
949962
mapcheck() check if a matching mapping exists
950963
maparg() get rhs of a mapping
964+
mapset() restore a mapping
951965
menu_info() get information about a menu item
952966
wildmenumode() check if the wildmode is active
953967

@@ -968,11 +982,13 @@ Testing: *test-functions*
968982
test_autochdir() enable 'autochdir' during startup
969983
test_override() test with Vim internal overrides
970984
test_garbagecollect_now() free memory right now
985+
test_garbagecollect_soon() set a flag to free memory soon
971986
test_getvalue() get value of an internal variable
972987
test_ignore_error() ignore a specific error message
973988
test_null_blob() return a null Blob
974989
test_null_channel() return a null Channel
975990
test_null_dict() return a null Dict
991+
test_null_function() return a null Funcref
976992
test_null_job() return a null Job
977993
test_null_list() return a null List
978994
test_null_partial() return a null Partial function
@@ -982,6 +998,10 @@ Testing: *test-functions*
982998
test_feedinput() add key sequence to input buffer
983999
test_option_not_set() reset flag indicating option was set
9841000
test_scrollbar() simulate scrollbar movement in the GUI
1001+
test_refcount() return an expression's reference count
1002+
test_srand_seed() set the seed value for srand()
1003+
test_unknown() return a value with unknown type
1004+
test_void() return a value with void type
9851005

9861006
Inter-process communication: *channel-functions*
9871007
ch_canread() check if there is something to read
@@ -993,8 +1013,8 @@ Inter-process communication: *channel-functions*
9931013
ch_readraw() read a raw message from a channel
9941014
ch_sendexpr() send a JSON message over a channel
9951015
ch_sendraw() send a raw message over a channel
996-
ch_evalexpr() evaluates an expression over channel
997-
ch_evalraw() evaluates a raw string over channel
1016+
ch_evalexpr() evaluate an expression over channel
1017+
ch_evalraw() evaluate a raw string over channel
9981018
ch_status() get status of a channel
9991019
ch_getbufnr() get the buffer number of a channel
10001020
ch_getjob() get the job associated with a channel
@@ -1007,7 +1027,7 @@ Inter-process communication: *channel-functions*
10071027
js_encode() encode an expression to a JSON string
10081028
js_decode() decode a JSON string to Vim types
10091029

1010-
Jobs: *job-functions*
1030+
Jobs: *job-functions*
10111031
job_start() start a job
10121032
job_stop() stop a job
10131033
job_status() get the status of a job
@@ -1050,6 +1070,7 @@ Terminal window: *terminal-functions*
10501070
term_setkill() set signal to stop job in a terminal
10511071
term_setrestore() set command to restore a terminal
10521072
term_setsize() set the size of a terminal
1073+
term_setapi() set terminal JSON API function name prefix
10531074

10541075
Popup window: *popup-window-functions*
10551076
popup_create() create popup centered in the screen
@@ -1068,9 +1089,13 @@ Popup window: *popup-window-functions*
10681089
popup_close() close one popup
10691090
popup_clear() close all popups
10701091
popup_filter_menu() select from a list of items
1071-
popup_filter_yesno() blocks until 'y' or 'n' is pressed
1092+
popup_filter_yesno() block until 'y' or 'n' is pressed
10721093
popup_getoptions() get current options for a popup
10731094
popup_getpos() get actual position and size of a popup
1095+
popup_findinfo() get window ID for popup info window
1096+
popup_findpreview() get window ID for popup preview window
1097+
popup_list() get list of all popup window IDs
1098+
popup_locate() get popup window ID from its screen position
10741099

10751100
Timers: *timer-functions*
10761101
timer_start() create a timer
@@ -1090,8 +1115,27 @@ Prompt Buffer: *promptbuffer-functions*
10901115
prompt_setinterrupt() set interrupt callback for a buffer
10911116
prompt_setprompt() set the prompt text for a buffer
10921117

1118+
Text Properties: *text-property-functions*
1119+
prop_add() attach a property at a position
1120+
prop_clear() remove all properties from a line or lines
1121+
prop_find() search for a property
1122+
prop_list() return a list of all properties in a line
1123+
prop_remove() remove a property from a line
1124+
prop_type_add() add/define a property type
1125+
prop_type_change() change properties of a type
1126+
prop_type_delete() remove a text property type
1127+
prop_type_get() return the properties of a type
1128+
prop_type_list() return a list of all property types
1129+
1130+
Sound: *sound-functions*
1131+
sound_clear() stop playing all sounds
1132+
sound_playevent() play an event's sound
1133+
sound_playfile() play a sound file
1134+
sound_stop() stop playing a sound
1135+
10931136
Various: *various-functions*
10941137
mode() get current editing mode
1138+
state() get current busy state
10951139
visualmode() last visual mode used
10961140
exists() check if a variable, function, etc. exists
10971141
has() check if a feature is supported in Vim
@@ -1100,6 +1144,9 @@ Various: *various-functions*
11001144
did_filetype() check if a FileType autocommand was used
11011145
eventhandler() check if invoked by an event handler
11021146
getpid() get process ID of Vim
1147+
getimstatus() check if IME status is active
1148+
interrupt() interrupt script execution
1149+
windowsversion() get MS-Windows version
11031150

11041151
libcall() call a function in an external library
11051152
libcallnr() idem, returning a number
@@ -1117,12 +1164,14 @@ Various: *various-functions*
11171164

11181165
wordcount() get byte/word/char count of buffer
11191166

1120-
luaeval() evaluate Lua expression
1167+
luaeval() evaluate |Lua| expression
11211168
mzeval() evaluate |MzScheme| expression
11221169
perleval() evaluate Perl expression (|+perl|)
11231170
py3eval() evaluate Python expression (|+python3|)
11241171
pyeval() evaluate Python expression (|+python|)
11251172
pyxeval() evaluate |python_x| expression
1173+
rubyeval() evaluate |Ruby| expression
1174+
11261175
debugbreak() interrupt a program being debugged
11271176

11281177
==============================================================================

src/Make_cyg_ming.mak

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ endif
625625

626626
ifeq ($(CHANNEL),yes)
627627
DEFINES += -DFEAT_JOB_CHANNEL -DFEAT_IPV6
628-
ifeq ($(shell expr "$(WINVER)" \>= 0x600),1)
628+
ifeq ($(shell expr "$$(($(WINVER)))" \>= "$$((0x600))"),1)
629629
DEFINES += -DHAVE_INET_NTOP
630630
endif
631631
endif

src/getchar.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2368,7 +2368,8 @@ handle_mapping(
23682368
// Skip ":lmap" mappings if keys were mapped.
23692369
if (mp->m_keys[0] == tb_c1
23702370
&& (mp->m_mode & local_State)
2371-
&& !(mp->m_simplified && seenModifyOtherKeys)
2371+
&& !(mp->m_simplified && seenModifyOtherKeys
2372+
&& typebuf.tb_maplen == 0)
23722373
&& ((mp->m_mode & LANGMAP) == 0 || typebuf.tb_maplen == 0))
23732374
{
23742375
#ifdef FEAT_LANGMAP

0 commit comments

Comments
 (0)