Skip to content

Commit b3eb410

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents b3e08b3 + 5bca906 commit b3eb410

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+4029
-979
lines changed

nsis/gvim.nsi

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,11 @@ RequestExecutionLevel highest
126126
# This adds '\Vim' to the user choice automagically. The actual value is
127127
# obtained below with CheckOldVim.
128128
!ifdef WIN64
129-
InstallDir "$PROGRAMFILES64\Vim"
129+
!define DEFAULT_INSTDIR "$PROGRAMFILES64\Vim"
130130
!else
131-
InstallDir "$PROGRAMFILES\Vim"
131+
!define DEFAULT_INSTDIR "$PROGRAMFILES\Vim"
132132
!endif
133+
InstallDir ${DEFAULT_INSTDIR}
133134

134135
# Types of installs we can perform:
135136
InstType $(str_type_typical)
@@ -710,8 +711,13 @@ Function .onInit
710711
!insertmacro MUI_LANGDLL_DISPLAY
711712
!endif
712713

713-
# Check $VIM
714-
ReadEnvStr $INSTDIR "VIM"
714+
${If} $INSTDIR == ${DEFAULT_INSTDIR}
715+
# Check $VIM
716+
ReadEnvStr $3 "VIM"
717+
${If} $3 != ""
718+
StrCpy $INSTDIR $3
719+
${EndIf}
720+
${EndIf}
715721

716722
call CheckOldVim
717723
Pop $3
@@ -721,20 +727,11 @@ Function .onInit
721727
SectionSetInstTypes ${id_section_old_ver} 0
722728
SectionSetText ${id_section_old_ver} ""
723729
${Else}
724-
${If} $INSTDIR == ""
730+
${If} $INSTDIR == ${DEFAULT_INSTDIR}
725731
StrCpy $INSTDIR $3
726732
${EndIf}
727733
${EndIf}
728734

729-
# If did not find a path: use the default dir.
730-
${If} $INSTDIR == ""
731-
!ifdef WIN64
732-
StrCpy $INSTDIR "$PROGRAMFILES64\Vim"
733-
!else
734-
StrCpy $INSTDIR "$PROGRAMFILES\Vim"
735-
!endif
736-
${EndIf}
737-
738735
${If} ${RunningX64}
739736
SetRegView 64
740737
${EndIf}

runtime/doc/digraph.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ An alternative is using the 'keymap' option.
3838
< Avoid defining a digraph with '_' (underscore) as the
3939
first character, it has a special meaning in the
4040
future.
41+
NOTE: This command cannot add a digraph that starts
42+
with a white space. If you want to add such digraph,
43+
you can use |setdigraph()| instead.
4144

4245
Vim is normally compiled with the |+digraphs| feature. If the feature is
4346
disabled, the ":digraph" command will display an error message.

runtime/doc/eval.txt

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2632,6 +2632,8 @@ getcompletion({pat}, {type} [, {filtered}])
26322632
getcurpos([{winnr}]) List position of the cursor
26332633
getcursorcharpos([{winnr}]) List character position of the cursor
26342634
getcwd([{winnr} [, {tabnr}]]) String get the current working directory
2635+
getdigraph({chars}) String get the digraph of {chars}
2636+
getdigraphlist([{listall}]) List get all |digraph|s
26352637
getenv({name}) String return environment variable
26362638
getfontname([{name}]) String name of font being used
26372639
getfperm({fname}) String file permissions of file {fname}
@@ -2898,6 +2900,8 @@ setcharpos({expr}, {list}) Number set the {expr} position to {list}
28982900
setcharsearch({dict}) Dict set character search from {dict}
28992901
setcmdpos({pos}) Number set cursor position in command-line
29002902
setcursorcharpos({list}) Number move cursor to position in {list}
2903+
setdigraph({chars}, {digraph}) Boolean register |digraph|
2904+
setdigraphlist({digraphlist}) Boolean register multiple |digraph|s
29012905
setenv({name}, {val}) none set environment variable
29022906
setfperm({fname}, {mode}) Number set {fname} file permissions to {mode}
29032907
setline({lnum}, {line}) Number set line {lnum} to {line}
@@ -5584,6 +5588,61 @@ getcwd([{winnr} [, {tabnr}]])
55845588
< Can also be used as a |method|: >
55855589
GetWinnr()->getcwd()
55865590
<
5591+
*getdigraph()* *E1214*
5592+
getdigraph({chars})
5593+
Return the digraph of {chars}. This should be a string with
5594+
exactly two characters. If {chars} are not just two
5595+
characters, or the digraph of {chars} does not exist, an error
5596+
is given and an empty string is returned.
5597+
5598+
The character will be converted from Unicode to 'encoding'
5599+
when needed. This does require the conversion to be
5600+
available, it might fail.
5601+
5602+
Also see |getdigraphlist()|.
5603+
5604+
Examples: >
5605+
" Get a built-in digraph
5606+
:echo getdigraph('00') " Returns '∞'
5607+
5608+
" Get a user-defined digraph
5609+
:call setdigraph('aa', 'あ')
5610+
:echo getdigraph('aa') " Returns 'あ'
5611+
<
5612+
Can also be used as a |method|: >
5613+
GetChars()->getdigraph()
5614+
<
5615+
This function works only when compiled with the |+digraphs|
5616+
feature. If this feature is disabled, this function will
5617+
display an error message.
5618+
5619+
5620+
getdigraphlist([{listall}]) *getdigraphlist()*
5621+
Return a list of digraphs. If the {listall} argument is given
5622+
and it is TRUE, return all digraphs, including the default
5623+
digraphs. Otherwise, return only user-defined digraphs.
5624+
5625+
The characters will be converted from Unicode to 'encoding'
5626+
when needed. This does require the conservation to be
5627+
available, it might fail.
5628+
5629+
Also see |getdigraph()|.
5630+
5631+
Examples: >
5632+
" Get user-defined digraphs
5633+
:echo getdigraphlist()
5634+
5635+
" Get all the digraphs, including default digraphs
5636+
:echo digraphlist(1)
5637+
<
5638+
Can also be used as a |method|: >
5639+
GetNumber()->getdigraphlist()
5640+
<
5641+
This function works only when compiled with the |+digraphs|
5642+
feature. If this feature is disabled, this function will
5643+
display an error message.
5644+
5645+
55875646
getenv({name}) *getenv()*
55885647
Return the value of environment variable {name}.
55895648
When the variable does not exist |v:null| is returned. That
@@ -9502,6 +9561,54 @@ setcursorcharpos({list})
95029561
Can also be used as a |method|: >
95039562
GetCursorPos()->setcursorcharpos()
95049563

9564+
9565+
setdigraph({chars}, {digraph}) *setdigraph()* *E1205*
9566+
Add digraph {chars} to the list. {chars} must be a string
9567+
with two characters. {digraph} is a string with one utf-8
9568+
encoded character. Be careful, composing characters are NOT
9569+
ignored. This function is similar to |:digraphs| command, but
9570+
useful to add digraphs start with a white space.
9571+
9572+
The function result is v:true if |digraph| is registered. If
9573+
this fails an error message is given and v:false is returned.
9574+
9575+
If you want to define multiple digraphs at once, you can use
9576+
|setdigraphlist()|.
9577+
9578+
Example: >
9579+
call setdigraph(' ', 'あ')
9580+
<
9581+
Can be used as a |method|: >
9582+
GetString()->setdigraph('あ')
9583+
<
9584+
This function works only when compiled with the |+digraphs|
9585+
feature. If this feature is disabled, this function will
9586+
display an error message.
9587+
9588+
9589+
setdigraphlist({digraphlist}) *setdigraphlist()*
9590+
Similar to |setdigraph()| but this function can add multiple
9591+
digraphs at once. {digraphlist} is a list composed of lists,
9592+
where each list contains two strings with {chars} and
9593+
{digraph} as in |setdigraph()|.
9594+
Example: >
9595+
call setdigraphlist([['aa', 'あ'], ['ii', 'い']])
9596+
<
9597+
It is similar to the following: >
9598+
for [chars, digraph] in [['aa', 'あ'], ['ii', 'い']]
9599+
call setdigraph(chars, digraph)
9600+
endfor
9601+
< Except that the function returns after the first error,
9602+
following digraphs will not be added.
9603+
9604+
Can be used as a |method|: >
9605+
GetList()->setdigraphlist()
9606+
<
9607+
This function works only when compiled with the |+digraphs|
9608+
feature. If this feature is disabled, this function will
9609+
display an error message.
9610+
9611+
95059612
setenv({name}, {val}) *setenv()*
95069613
Set environment variable {name} to {val}.
95079614
When {val} is |v:null| the environment variable is deleted.

runtime/doc/options.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1331,9 +1331,11 @@ A jump table for the options with a short description can be found at |Q_op|.
13311331
continuation (positive).
13321332
sbr Display the 'showbreak' value before applying the
13331333
additional indent.
1334-
list:{n} Adds an additional indent for lines that match a
1334+
list:{n} Adds an additional indent for lines that match a
13351335
numbered or bulleted list (using the
13361336
'formatlistpat' setting).
1337+
list:-1 Uses the length of a match with 'formatlistpat'
1338+
for indentation.
13371339
The default value for min is 20, shift and list is 0.
13381340

13391341
*'browsedir'* *'bsdir'*

runtime/doc/os_win32.txt

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ The 32 bit version also runs on 64 bit MS-Windows systems.
1818
4. Using the mouse |win32-mouse|
1919
5. Running under Windows 95 |win32-win95|
2020
6. Running under Windows 3.1 |win32-win3.1|
21-
7. Win32 mini FAQ |win32-faq|
21+
7. Installation package |win32-installer|
22+
8. Win32 mini FAQ |win32-faq|
2223

2324
Additionally, there are a number of common Win32 and DOS items:
2425
File locations |dos-locations|
@@ -175,7 +176,29 @@ There was a special version of gvim that runs under Windows 3.1 and 3.11.
175176
Support was removed in patch 7.4.1364.
176177

177178
==============================================================================
178-
7. Win32 mini FAQ *win32-faq*
179+
7. Installation package *win32-installer*
180+
181+
A simple installer for windows is available at http://www.vim.org/download.php
182+
(stable version) and nightly builds are also available at
183+
https://github.com/vim/vim-win32-installer/releases/
184+
185+
The nightly builds include 32bit and 64bit builds, have most features enabled
186+
and usually also contain an extra cryptographic signed installer, so Windows
187+
will not complain.
188+
189+
To use the installer, simply run the exe file. The following switches are
190+
also supported: >
191+
192+
gvim_<version>.exe /S -> silent install without any dialogues
193+
gvim_<version>.exe /D=C:\vim -> Install into directory c:\vim
194+
-> /D must be the last argument
195+
gvim_<version>.exe /S /D=c:\vim -> silent install into c:\vim
196+
<
197+
The default installation directory can alternatively be given by setting the
198+
$VIM environment variable.
199+
200+
==============================================================================
201+
8. Win32 mini FAQ *win32-faq*
179202

180203
Q. How do I change the font?
181204
A. In the GUI version, you can use the 'guifont' option. Example: >

runtime/doc/usr_41.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,10 @@ Mappings and Menus: *mapping-functions*
10001000
mapset() restore a mapping
10011001
menu_info() get information about a menu item
10021002
wildmenumode() check if the wildmode is active
1003+
getdigraph() get |digraph|
1004+
getdigraphlist() get all |digraph|s
1005+
setdigraph() register |digraph|
1006+
setdigraphlist() register multiple |digraph|s
10031007

10041008
Testing: *test-functions*
10051009
assert_equal() assert that two expressions values are equal

src/blob.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,10 @@ blob_set_range(blob_T *dest, long n1, long n2, typval_T *src)
415415
blob_remove(typval_T *argvars, typval_T *rettv)
416416
{
417417
int error = FALSE;
418-
long idx = (long)tv_get_number_chk(&argvars[1], &error);
418+
long idx;
419419
long end;
420420

421+
idx = (long)tv_get_number_chk(&argvars[1], &error);
421422
if (!error)
422423
{
423424
blob_T *b = argvars[0].vval.v_blob;

src/buffer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,7 +1946,7 @@ no_write_message(void)
19461946
emsg(_("E948: Job still running (add ! to end the job)"));
19471947
else
19481948
#endif
1949-
emsg(_("E37: No write since last change (add ! to override)"));
1949+
emsg(_(e_no_write_since_last_change_add_bang_to_override));
19501950
}
19511951

19521952
void
@@ -1957,7 +1957,7 @@ no_write_message_nobang(buf_T *buf UNUSED)
19571957
emsg(_("E948: Job still running"));
19581958
else
19591959
#endif
1960-
emsg(_("E37: No write since last change"));
1960+
emsg(_(e_no_write_since_last_change));
19611961
}
19621962

19631963
/*

src/change.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ f_listener_add(typval_T *argvars, typval_T *rettv)
241241
listener_T *lnr;
242242
buf_T *buf = curbuf;
243243

244+
if (in_vim9script() && check_for_opt_buffer_arg(argvars, 1) == FAIL)
245+
return;
246+
244247
callback = get_callback(&argvars[0]);
245248
if (callback.cb_name == NULL)
246249
return;

src/channel.c

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4333,6 +4333,11 @@ ch_expr_common(typval_T *argvars, typval_T *rettv, int eval)
43334333
rettv->v_type = VAR_STRING;
43344334
rettv->vval.v_string = NULL;
43354335

4336+
if (in_vim9script()
4337+
&& (check_for_chan_or_job_arg(argvars, 0) == FAIL
4338+
|| check_for_opt_dict_arg(argvars, 2) == FAIL))
4339+
return;
4340+
43364341
channel = get_channel_arg(&argvars[0], TRUE, FALSE, 0);
43374342
if (channel == NULL)
43384343
return;
@@ -4393,6 +4398,12 @@ ch_raw_common(typval_T *argvars, typval_T *rettv, int eval)
43934398
rettv->v_type = VAR_STRING;
43944399
rettv->vval.v_string = NULL;
43954400

4401+
if (in_vim9script()
4402+
&& (check_for_chan_or_job_arg(argvars, 0) == FAIL
4403+
|| check_for_string_or_blob_arg(argvars, 1) == FAIL
4404+
|| check_for_opt_dict_arg(argvars, 2) == FAIL))
4405+
return;
4406+
43964407
if (argvars[1].v_type == VAR_BLOB)
43974408
{
43984409
text = argvars[1].vval.v_blob->bv_ga.ga_data;
@@ -4878,9 +4889,16 @@ f_ch_close_in(typval_T *argvars, typval_T *rettv UNUSED)
48784889
void
48794890
f_ch_getbufnr(typval_T *argvars, typval_T *rettv)
48804891
{
4881-
channel_T *channel = get_channel_arg(&argvars[0], FALSE, FALSE, 0);
4892+
channel_T *channel;
48824893

48834894
rettv->vval.v_number = -1;
4895+
4896+
if (in_vim9script()
4897+
&& (check_for_chan_or_job_arg(argvars, 0) == FAIL
4898+
|| check_for_string_arg(argvars, 1) == FAIL))
4899+
return;
4900+
4901+
channel = get_channel_arg(&argvars[0], FALSE, FALSE, 0);
48844902
if (channel != NULL)
48854903
{
48864904
char_u *what = tv_get_string(&argvars[1]);
@@ -4935,9 +4953,15 @@ f_ch_info(typval_T *argvars, typval_T *rettv UNUSED)
49354953
void
49364954
f_ch_log(typval_T *argvars, typval_T *rettv UNUSED)
49374955
{
4938-
char_u *msg = tv_get_string(&argvars[0]);
4956+
char_u *msg;
49394957
channel_T *channel = NULL;
49404958

4959+
if (in_vim9script()
4960+
&& (check_for_string_arg(argvars, 0) == FAIL
4961+
|| check_for_opt_chan_or_job_arg(argvars, 1) == FAIL))
4962+
return;
4963+
4964+
msg = tv_get_string(&argvars[0]);
49414965
if (argvars[1].v_type != VAR_UNKNOWN)
49424966
channel = get_channel_arg(&argvars[1], FALSE, FALSE, 0);
49434967

@@ -4957,6 +4981,7 @@ f_ch_logfile(typval_T *argvars, typval_T *rettv UNUSED)
49574981
// Don't open a file in restricted mode.
49584982
if (check_restricted() || check_secure())
49594983
return;
4984+
49604985
if (in_vim9script()
49614986
&& (check_for_string_arg(argvars, 0) == FAIL
49624987
|| check_for_string_arg(argvars, 1) == FAIL))

0 commit comments

Comments
 (0)