Skip to content

Commit 9227ed4

Browse files
committed
Merge remote-tracking branch 'vim/master'
2 parents ea2a2be + 7237cab commit 9227ed4

70 files changed

Lines changed: 2754 additions & 268 deletions

Some content is hidden

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

runtime/doc/eval.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3034,6 +3034,8 @@ test_feedinput({string}) none add key sequence to input buffer
30343034
test_garbagecollect_now() none free memory right now for testing
30353035
test_garbagecollect_soon() none free memory soon for testing
30363036
test_getvalue({string}) any get value of an internal variable
3037+
test_gui_mouse_event({button}, {row}, {col}, {repeated}, {mods})
3038+
none add a mouse event to the input buffer
30373039
test_ignore_error({expr}) none ignore a specific error
30383040
test_null_blob() Blob null value for testing
30393041
test_null_channel() Channel null value for testing
@@ -5853,7 +5855,10 @@ getqflist([{what}]) *getqflist()*
58535855
bufname() to get the name
58545856
module module name
58555857
lnum line number in the buffer (first line is 1)
5858+
end_lnum
5859+
end of line number if the item is multiline
58565860
col column number (first column is 1)
5861+
end_col end of column number if the item has range
58575862
vcol |TRUE|: "col" is visual column
58585863
|FALSE|: "col" is byte index
58595864
nr error number
@@ -11983,6 +11988,7 @@ scrollbind Compiled with 'scrollbind' support. (always true)
1198311988
showcmd Compiled with 'showcmd' support.
1198411989
signs Compiled with |:sign| support.
1198511990
smartindent Compiled with 'smartindent' support.
11991+
sodium Compiled with libsodium for better crypt support
1198611992
sound Compiled with sound support, e.g. `sound_playevent()`
1198711993
spell Compiled with spell checking support |spell|.
1198811994
startuptime Compiled with |--startuptime| support.

runtime/doc/options.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2399,6 +2399,23 @@ A jump table for the options with a short description can be found at |Q_op|.
23992399
you write the file the encrypted bytes will be
24002400
different. The whole undo file is encrypted, not just
24012401
the pieces of text.
2402+
*E1193* *E1194* *E1195* *E1196*
2403+
*E1197* *E1198* *E1199* *E1200* *E1201*
2404+
xchacha20 XChaCha20 Cipher with Poly1305 Message Authentication
2405+
Code. Medium strong till strong encryption.
2406+
Encryption is provided by the libsodium library, it
2407+
requires Vim to be built with |+sodium|
2408+
It adds a seed and a message authentication code (MAC)
2409+
to the file. This needs at least a Vim 8.2.3022 to
2410+
read the encrypted file.
2411+
Encryption of swap files is not supported, therefore
2412+
no swap file will be used when xchacha20 encryption is
2413+
enabled.
2414+
Encryption of undo files is not yet supported,
2415+
therefore no undo file will currently be written.
2416+
CURRENTLY EXPERIMENTAL: Files written with this method
2417+
might have to be read back with the same version of
2418+
Vim if the binary format changes later.
24022419

24032420
You should use "blowfish2", also to re-encrypt older files.
24042421

runtime/doc/testing.txt

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*testing.txt* For Vim version 8.2. Last change: 2021 Apr 02
1+
*testing.txt* For Vim version 8.2. Last change: 2021 Jun 21
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -78,6 +78,30 @@ test_getvalue({name}) *test_getvalue()*
7878

7979
Can also be used as a |method|: >
8080
GetName()->test_getvalue()
81+
<
82+
*test_gui_mouse_event()*
83+
test_gui_mouse_event({button}, {row}, {col}, {multiclick}, {modifiers})
84+
Inject a mouse button click event. This function works only
85+
when GUI is running.
86+
The supported values for {button} are:
87+
0 right mouse button
88+
1 middle mouse button
89+
2 left mouse button
90+
3 mouse button release
91+
4 scroll wheel down
92+
5 scroll wheel up
93+
6 scroll wheel left
94+
7 scroll wheel right
95+
{row} and {col} specify the location of the mouse click.
96+
To inject a multiclick event, set {multiclick} to 1.
97+
The supported values for {modifiers} are:
98+
4 shift is pressed
99+
8 alt is pressed
100+
16 ctrl is pressed
101+
After injecting the mouse event you probably should call
102+
|feedkeys()| to have them processed, e.g.: >
103+
call feedkeys("y", 'Lx!')
104+
81105
82106
test_ignore_error({expr}) *test_ignore_error()*
83107
Ignore any error containing {expr}. A normal message is given

runtime/doc/usr_41.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,7 @@ Testing: *test-functions*
10211021
test_garbagecollect_now() free memory right now
10221022
test_garbagecollect_soon() set a flag to free memory soon
10231023
test_getvalue() get value of an internal variable
1024+
test_gui_mouse_event() add a GUI mouse event to the input buffer
10241025
test_ignore_error() ignore a specific error message
10251026
test_null_blob() return a null Blob
10261027
test_null_channel() return a null Channel

runtime/doc/various.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ m *+ruby/dyn* Ruby interface |ruby-dynamic| |/dyn|
446446
T *+scrollbind* |'scrollbind'|
447447
B *+signs* |:sign|
448448
N *+smartindent* |'smartindent'|
449+
B *+sodium* compiled with libsodium for better encryption support
449450
B *+sound* |sound_playevent()|, |sound_playfile()| functions, etc.
450451
N *+spell* spell checking support, see |spell|
451452
N *+startuptime* |--startuptime| argument

src/INSTALLpc.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,9 @@ MSYS2 has its own git package, and you can also install it via pacman:
322322

323323
$ pacman -S git
324324

325+
For enabling libsodium support, you also need to install the package
326+
327+
$ pacman -S mingw-w64-x86_64-libsodium
325328

326329
2.3. Keep the build environment up-to-date
327330

src/Make_cyg_ming.mak

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ DEBUG=no
4141
# set to yes to measure code coverage
4242
COVERAGE=no
4343

44+
# better encryption support using libsodium
45+
#SODIUM=yes
46+
4447
# set to SIZE for size, SPEED for speed, MAXSPEED for maximum optimization
4548
OPTIMIZE=MAXSPEED
4649

@@ -517,6 +520,10 @@ CXXFLAGS = -std=gnu++11
517520
WINDRES_FLAGS =
518521
EXTRA_LIBS =
519522

523+
ifdef SODIUM
524+
DEFINES += -DHAVE_SODIUM
525+
endif
526+
520527
ifdef GETTEXT
521528
DEFINES += -DHAVE_GETTEXT -DHAVE_LOCALE_H
522529
GETTEXTINCLUDE = $(GETTEXT)/include
@@ -660,6 +667,10 @@ DEFINES += -DFEAT_DIRECTX_COLOR_EMOJI
660667
endif
661668
endif
662669

670+
ifeq ($(SODIUM),yes)
671+
SODIUMLIB = -lsodium
672+
endif
673+
663674
# Only allow XPM for a GUI build.
664675
ifeq (yes, $(GUI))
665676

@@ -1064,7 +1075,7 @@ $(EXEOBJC): | $(OUTDIR)
10641075

10651076
ifeq ($(VIMDLL),yes)
10661077
$(TARGET): $(OBJ)
1067-
$(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid -lgdi32 $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)
1078+
$(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid -lgdi32 $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB) $(SODIUMLIB)
10681079

10691080
$(GVIMEXE): $(EXEOBJG) $(VIMDLLBASE).dll
10701081
$(CC) -L. $(EXELFLAGS) -mwindows -o $@ $(EXEOBJG) -l$(VIMDLLBASE)
@@ -1073,7 +1084,7 @@ $(VIMEXE): $(EXEOBJC) $(VIMDLLBASE).dll
10731084
$(CC) -L. $(EXELFLAGS) -o $@ $(EXEOBJC) -l$(VIMDLLBASE)
10741085
else
10751086
$(TARGET): $(OBJ)
1076-
$(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB)
1087+
$(LINK) $(CFLAGS) $(LFLAGS) -o $@ $(OBJ) $(LIB) -lole32 -luuid $(LUA_LIB) $(MZSCHEME_LIBDIR) $(MZSCHEME_LIB) $(PYTHONLIB) $(PYTHON3LIB) $(RUBYLIB) $(SODIUMLIB)
10771088
endif
10781089

10791090
upx: exes

src/Make_mvc.mak

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@
4141
#
4242
# Sound support: SOUND=yes (default is yes)
4343
#
44+
# Sodium support: SODIUM=[Path to Sodium directory]
45+
# Dynamic built with libsodium
46+
# You need to install the msvc package from
47+
# https://download.libsodium.org/libsodium/releases/
48+
# and package the libsodium.dll with Vim
49+
#
50+
#
4451
# DLL support (EXPERIMENTAL): VIMDLL=yes (default is no)
4552
# Creates vim{32,64}.dll, and stub gvim.exe and vim.exe.
4653
# The shared codes between the GUI and the console are built into
@@ -372,6 +379,26 @@ SOUND = no
372379
! endif
373380
!endif
374381

382+
!ifndef SODIUM
383+
SODIUM = no
384+
!endif
385+
386+
!if "$(SODIUM)" != "no"
387+
! if "$(CPU)" == "AMD64"
388+
SOD_LIB = $(SODIUM)\x64\Release\v140\dynamic
389+
! elseif "$(CPU)" == "i386"
390+
SOD_LIB = $(SODIUM)\Win32\Release\v140\dynamic
391+
! else
392+
SODIUM = no
393+
! endif
394+
!endif
395+
396+
!if "$(SODIUM)" != "no"
397+
SOD_INC = /I "$(SODIUM)\include"
398+
SOD_DEFS = -DFEAT_SODIUM
399+
SOD_LIB = $(SOD_LIB)\libsodium.lib
400+
!endif
401+
375402
!ifndef NETBEANS
376403
NETBEANS = $(GUI)
377404
!endif
@@ -491,7 +518,7 @@ CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
491518

492519
CFLAGS = -c /W3 /GF /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
493520
$(CSCOPE_DEFS) $(TERM_DEFS) $(SOUND_DEFS) $(NETBEANS_DEFS) $(CHANNEL_DEFS) \
494-
$(NBDEBUG_DEFS) $(XPM_DEFS) \
521+
$(NBDEBUG_DEFS) $(XPM_DEFS) $(SOD_DEFS) $(SOD_INC) \
495522
$(DEFINES) -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER)
496523

497524
#>>>>> end of choices
@@ -1282,7 +1309,7 @@ conflags = $(conflags) /map /mapinfo:lines
12821309
LINKARGS1 = $(linkdebug) $(conflags)
12831310
LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(NODEFAULTLIB) $(LIBC) $(OLE_LIB) user32.lib \
12841311
$(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(PYTHON3_LIB) $(RUBY_LIB) \
1285-
$(TCL_LIB) $(SOUND_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
1312+
$(TCL_LIB) $(SOUND_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(SOD_LIB) $(LINK_PDB)
12861313

12871314
# Report link time code generation progress if used.
12881315
!ifdef NODEBUG

src/auto/configure

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,7 @@ with_motif_lib
844844
with_tlib
845845
enable_largefile
846846
enable_canberra
847+
enable_libsodium
847848
enable_acl
848849
enable_gpm
849850
enable_sysmouse
@@ -1510,6 +1511,7 @@ Optional Features:
15101511
--disable-desktop-database-update update disabled
15111512
--disable-largefile omit support for large files
15121513
--disable-canberra Do not use libcanberra.
1514+
--disable-libsodium Do not use libsodium.
15131515
--disable-acl No check for ACL support.
15141516
--disable-gpm Don't use gpm (Linux mouse daemon).
15151517
--disable-sysmouse Don't use sysmouse (mouse in *BSD console).
@@ -13235,6 +13237,70 @@ rm -f core conftest.err conftest.$ac_objext \
1323513237
conftest$ac_exeext conftest.$ac_ext
1323613238
fi
1323713239

13240+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-libsodium argument" >&5
13241+
$as_echo_n "checking --enable-libsodium argument... " >&6; }
13242+
# Check whether --enable-libsodium was given.
13243+
if test "${enable_libsodium+set}" = set; then :
13244+
enableval=$enable_libsodium;
13245+
else
13246+
enable_libsodium="maybe"
13247+
fi
13248+
13249+
13250+
if test "$enable_libsodium" = "maybe"; then
13251+
if test "$features" = "big" -o "$features" = "huge"; then
13252+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Defaulting to yes" >&5
13253+
$as_echo "Defaulting to yes" >&6; }
13254+
enable_libsodium="yes"
13255+
else
13256+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Defaulting to no" >&5
13257+
$as_echo "Defaulting to no" >&6; }
13258+
enable_libsodium="no"
13259+
fi
13260+
else
13261+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_libsodium" >&5
13262+
$as_echo "$enable_libsodium" >&6; }
13263+
fi
13264+
if test "$enable_libsodium" = "yes"; then
13265+
if test "x$PKG_CONFIG" != "xno"; then
13266+
libsodium_lib=`$PKG_CONFIG --libs libsodium 2>/dev/null`
13267+
libsodium_cflags=`$PKG_CONFIG --cflags libsodium 2>/dev/null`
13268+
fi
13269+
if test "x$libsodium_lib" = "x"; then
13270+
libsodium_lib=-lsodium
13271+
libsodium_cflags=
13272+
fi
13273+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libcanberra" >&5
13274+
$as_echo_n "checking for libcanberra... " >&6; }
13275+
ac_save_CFLAGS="$CFLAGS"
13276+
ac_save_LIBS="$LIBS"
13277+
CFLAGS="$CFLAGS $libsodium_cflags"
13278+
LIBS="$LIBS $libsodium_lib"
13279+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13280+
/* end confdefs.h. */
13281+
13282+
# include <sodium.h>
13283+
13284+
int
13285+
main ()
13286+
{
13287+
13288+
printf("%d", sodium_init());
13289+
;
13290+
return 0;
13291+
}
13292+
_ACEOF
13293+
if ac_fn_c_try_link "$LINENO"; then :
13294+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
13295+
$as_echo "yes" >&6; }; $as_echo "#define HAVE_SODIUM 1" >>confdefs.h
13296+
13297+
else
13298+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no; try installing libsodium-dev" >&5
13299+
$as_echo "no; try installing libsodium-dev" >&6; }; CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS"
13300+
fi
13301+
rm -f core conftest.err conftest.$ac_objext \
13302+
conftest$ac_exeext conftest.$ac_ext
13303+
fi
1323813304

1323913305
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for st_blksize" >&5
1324013306
$as_echo_n "checking for st_blksize... " >&6; }

src/blowfish.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,8 @@ crypt_blowfish_encode(
596596
cryptstate_T *state,
597597
char_u *from,
598598
size_t len,
599-
char_u *to)
599+
char_u *to,
600+
int last UNUSED)
600601
{
601602
bf_state_T *bfs = state->method_state;
602603
size_t i;
@@ -619,7 +620,8 @@ crypt_blowfish_decode(
619620
cryptstate_T *state,
620621
char_u *from,
621622
size_t len,
622-
char_u *to)
623+
char_u *to,
624+
int last UNUSED)
623625
{
624626
bf_state_T *bfs = state->method_state;
625627
size_t i;
@@ -680,5 +682,4 @@ blowfish_self_test(void)
680682
}
681683
return OK;
682684
}
683-
684685
#endif // FEAT_CRYPT

0 commit comments

Comments
 (0)