Compare commits

...

5 Commits

Author SHA1 Message Date
Hugo Osvaldo Barrera
040674129f patch 9.0.0005: hare files are not recognized
Problem:    Hare files are not recognized.
Solution:   Add a filetype pattern. (Hugo Osvaldo Barrera, closes #10630)
2022-06-29 13:48:49 +01:00
Matvey Tarasov
d14bb1aef9 patch 9.0.0004: plural messages not translated properly
Problem:    Plural messages not translated properly.
Solution:   Use ngettext() in a few more places. (Matvey Tarasov,
            closes #10606)
2022-06-29 13:18:27 +01:00
Yegappan Lakshmanan
ee47eaceaa patch 9.0.0003: functions are global while they could be local
Problem:    Functions are global while they could be local.
Solution:   Add "static".  Add a few tests. (Yegappan Lakshmanan,
            closes #10612)
2022-06-29 12:55:36 +01:00
zeertzjq
c207fd2535 patch 9.0.0002: map functionality outside of map.c
Problem:    Map functionality outside of map.c.
Solution:   Move f_hasmapto() to map.c.  Rename a function. (closes #10611)
2022-06-29 10:37:40 +01:00
Bram Moolenaar
75417d960b patch 9.0.0001: Travis CI is no longer used
Problem:    Travis CI is no longer used.
Solution:   Delete the Travis CI configuration. (Hugo Osvaldo Barrera,
            closes #10636)
2022-06-28 20:07:42 +01:00
24 changed files with 103 additions and 367 deletions

View File

@@ -1,288 +0,0 @@
language: c
env:
global:
- BUILD=yes TEST=test CONFOPT= LEAK_CFLAGS="-DEXITFREE" SHADOWOPT= SRCDIR=./src CHECK_AUTOCONF=no LOG_DIR="$TRAVIS_BUILD_DIR/logs"
_anchors:
envs:
- &tiny-nogui
FEATURES=tiny TEST=testtiny CONFOPT="--disable-gui"
- &tiny
FEATURES=tiny TEST=testtiny
- &small
FEATURES=small TEST=testtiny
- &normal
FEATURES=normal
- &linux-huge
FEATURES=huge TEST="scripttests test_libvterm"
CONFOPT="--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
- &osx-huge # macOS build
FEATURES=huge
CONFOPT="--enable-perlinterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp"
- &unittests
BUILD=no TEST=unittests FEATURES=huge CHECK_AUTOCONF=yes
- &coverage
CFLAGS="--coverage -DUSE_GCOV_FLUSH" LDFLAGS=--coverage
- &asan # ASAN build
SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize-recover=all -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer"
ASAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/asan" UBSAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/ubsan" LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/src/testdir/lsan-suppress.txt"
- &shadowopt
SHADOWOPT="-C src/shadow" SRCDIR=./src/shadow
linux: &linux
os: linux
dist: bionic
addons:
apt:
packages: &apt-packages
- autoconf
- clang
- lcov
- gettext
- libcanberra-dev
- libperl-dev
- python-dev
- python3-dev
- liblua5.3-dev
- lua5.3
- ruby-dev
- tcl-dev
- cscope
- libgtk2.0-dev
- desktop-file-utils
- libtool-bin
services:
- xvfb
before_install:
- rvm reset
# Use llvm-cov instead of gcov when compiler is clang.
- |
if [[ "${CC}" = "clang" ]]; then
ln -sf "$(command -v llvm-cov)" /home/travis/bin/gcov
fi
# Setup lua5.3 manually since its package doesn't provide alternative.
# https://bugs.launchpad.net/ubuntu/+source/lua5.3/+bug/1707212
- |
if [[ "${CONFOPT}" =~ luainterp ]]; then
sudo update-alternatives --install /usr/bin/lua lua /usr/bin/lua5.3 10
fi
before_script:
- sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=0
# It appears we can load "snd-dummy" on only amd64.
- |
if [[ "${TRAVIS_CPU_ARCH}" = amd64 ]]; then
sudo bash ci/load-snd-dummy.sh || true
fi
- sudo usermod -a -G audio $USER
- do_test() { sg audio "sg $(id -gn) '$*'"; }
osx: &osx
os: osx
before_script:
- do_test() { "$@"; }
homebrew: &osx-homebrew
addons:
homebrew:
packages:
- lua
update: true
cache:
directories:
- /usr/local/Homebrew/Library/Homebrew/vendor/
- /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/
before_install:
- rvm reset
# Lua is not installed on macOS
- export LUA_PREFIX=/usr/local
coverage: &eval-coverage
# needed for https support for coveralls building cffi only works with gcc,
# not with clang
- CC=gcc pip install --user cpp-coveralls pyopenssl ndg-httpsclient pyasn1
- ~/.local/bin/coveralls -b "${SRCDIR}" -x .xs -e "${SRCDIR}"/if_perl.c -e "${SRCDIR}"/xxd -e "${SRCDIR}"/libvterm --encodings utf-8
- (cd "${SRCDIR}" && bash <(curl -s https://codecov.io/bash))
asan_symbolize: &asan_symbolize
# Update pyenv to fix the error "/opt/pyenv/libexec/pyenv: line 43: cd: asan_symbolize-6.0: Not a directory".
# https://github.com/pyenv/pyenv/issues/580
- (cd "${PYENV_ROOT}" && git fetch -p origin && git checkout "$(git rev-list --tags -n1)") &>/dev/null || true
- for f in $(grep -l '#[[:digit:]]* *0x[[:digit:]a-fA-F]*' "$LOG_DIR"/*); do asan_symbolize-11 -l "$f"; done
branches:
except:
- /^v[0-9]/
script:
- mkdir -p "$LOG_DIR"
- NPROC=$(getconf _NPROCESSORS_ONLN)
- set -o errexit
- echo -e "\\033[33;1mConfiguring Vim\\033[0m" && echo -en "travis_fold:start:configure\\r\\033[0K"
- |
if [[ "${CHECK_AUTOCONF}" = "yes" ]] && [[ "${CC}" = "gcc" ]]; then
make -C src autoconf
fi
- |
if [[ -n "${SHADOWOPT}" ]]; then
make -C src shadow
fi
# "./configure" changes its working directory into "$SRCDIR".
- ./configure --with-features=${FEATURES} ${CONFOPT} --enable-fail-if-missing
- echo -en "travis_fold:end:configure\\r\\033[0K"
- echo -e "\\033[33;1mBuilding Vim\\033[0m" && echo -en "travis_fold:start:build\\r\\033[0K"
- |
if [[ "${BUILD}" = "yes" ]]; then
# Append various warning flags to CFLAGS.
# BSD sed needs backup extension specified.
sed -i.bak -f ci/config.mk.sed ${SRCDIR}/auto/config.mk
if [[ "${TRAVIS_OS_NAME}" = "osx" ]] || [[ "${CC}" = "clang-11" ]]; then
# On macOS, the entity of gcc is clang.
sed -i.bak -f ci/config.mk.clang.sed ${SRCDIR}/auto/config.mk
else
sed -i.bak -f ci/config.mk.${CC}.sed ${SRCDIR}/auto/config.mk
fi
make ${SHADOWOPT} -j${NPROC}
fi
- echo -en "travis_fold:end:build\\r\\033[0K"
- set +o errexit
# Show Vim version and also if_xx versions.
- |
if [[ "${BUILD}" = "yes" ]]; then
"${SRCDIR}"/vim --version
"${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-1.vim -c quit
"${SRCDIR}"/vim -u NONE -i NONE --not-a-term -esNX -V1 -S ci/if_ver-2.vim -c quit
fi
- echo -e "\\033[33;1mTesting Vim\\033[0m" && echo -en "travis_fold:start:test\\r\\033[0K"
- do_test make ${SHADOWOPT} ${TEST} && FOLD_MARKER=travis_fold
- echo -en "${FOLD_MARKER}:end:test\\r\\033[0K"
- |
# Not all sanitizers will cause the tests to fail. This helps since we can
# see all the failures instead of just the first one, but we still want the
# test phase to fail if any sanitizer issues are detected.
if [[ -n "${ASAN_OPTIONS}" ]]; then
if grep -q '#[[:digit:]]* *0x[[:digit:]a-fA-F]*' "$LOG_DIR"/*; then
false
fi
fi
# Instead of using all environments with both compilers on both systems,
# exclude some builds on mac os x and linux.
# On mac os x "tiny" is always without GUI, use 2 compilers in 2 environments.
# Linux: 2 compilers on some of the environments + gcc on os390
jobs:
include:
#- <<: *osx
# name: tiny-nogui/clang
# compiler: clang
# env: *tiny-nogui
#- <<: *osx
# name: tiny-nogui/gcc
# compiler: gcc
# env: *tiny-nogui
#- <<: *osx
# <<: *osx-homebrew
# name: huge/clang
# compiler: clang
# env: *osx-huge
#- <<: *osx
# <<: *osx-homebrew
# name: huge/gcc
# compiler: gcc
# env: *osx-huge
#- <<: *linux
# name: tiny-nogui/clang
# compiler: clang
# env: *tiny-nogui
#- <<: *linux
# name: tiny-nogui/gcc
# compiler: gcc
# env: *tiny-nogui
#- <<: *linux
# name: tiny/clang
# compiler: clang
# env: *tiny
#- <<: *linux
# name: tiny/gcc
# compiler: gcc
# env: *tiny
#- <<: *linux
# name: small/gcc
# compiler: gcc
# env: *small
#- <<: *linux
# name: normal+shadow/clang
# compiler: clang
# env:
# - *normal
# - *shadowopt
#- <<: *linux
# name: normal+shadow/gcc
# compiler: gcc
# env:
# - *normal
# - *shadowopt
- <<: *linux
arch: s390x
name: huge/gcc-s390x
compiler: gcc
env: *linux-huge
services: []
- <<: *linux
arch: arm64
name: huge/gcc-arm64
compiler: gcc
env: *linux-huge
services: []
#- <<: *linux
# name: huge+coverage/clang
# compiler: clang
# env:
# - *linux-huge
# - *coverage
# after_success: *eval-coverage
#- <<: *linux
# name: huge+coverage/gcc
# compiler: gcc
# env:
# - *linux-huge
# - *coverage
# after_success: *eval-coverage
#- <<: *linux # ASAN
# name: huge+asan/clang
# compiler: clang-11
# addons:
# apt:
# sources:
# - sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-11 main'
# key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
# packages:
# - *apt-packages
# - clang-11
# env:
# - *linux-huge
# - *asan
# after_failure: *asan_symbolize
#- <<: *linux
# name: huge-testgui+coverage/gcc
# compiler: gcc
# env:
# - *linux-huge
# - *coverage
# - TEST="-C src testgui"
# after_success: *eval-coverage
#- <<: *linux
# name: unittests+coverage/gcc
# compiler: gcc
# env:
# - *unittests
# - *coverage
# after_success: *eval-coverage
#- <<: *linux
# name: vimtags/gcc
# compiler: gcc
# env:
# - *normal
# - TEST="-C runtime/doc vimtags VIMEXE=../../${SRCDIR}/vim"
# vim:set sts=2 sw=2 tw=0 et:

View File

@@ -789,6 +789,9 @@ au BufNewFile,BufRead *.hsm setf hamster
" Handlebars
au BufNewFile,BufRead *.hbs setf handlebars
" Hare
au BufNewFile,BufRead *.ha setf hare
" Haskell
au BufNewFile,BufRead *.hs,*.hsc,*.hs-boot,*.hsig setf haskell
au BufNewFile,BufRead *.lhs setf lhaskell

View File

@@ -1004,8 +1004,8 @@ free_buffer_stuff(
#ifdef FEAT_NETBEANS_INTG
netbeans_file_killed(buf);
#endif
map_clear_int(buf, MAP_ALL_MODES, TRUE, FALSE); // clear local mappings
map_clear_int(buf, MAP_ALL_MODES, TRUE, TRUE); // clear local abbrevs
map_clear_mode(buf, MAP_ALL_MODES, TRUE, FALSE); // clear local mappings
map_clear_mode(buf, MAP_ALL_MODES, TRUE, TRUE); // clear local abbrevs
VIM_CLEAR(buf->b_start_fenc);
}

View File

@@ -73,6 +73,10 @@ typedef struct {
char_u *p2, int last);
} cryptmethod_T;
static int crypt_sodium_init(cryptstate_T *state, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len);
static long crypt_sodium_buffer_decode(cryptstate_T *state, char_u *from, size_t len, char_u **buf_out, int last);
static long crypt_sodium_buffer_encode(cryptstate_T *state, char_u *from, size_t len, char_u **buf_out, int last);
// index is method_nr of cryptstate_T, CRYPT_M_*
static cryptmethod_T cryptmethods[CRYPT_M_COUNT] = {
// PK_Zip; very weak
@@ -850,7 +854,7 @@ crypt_append_msg(
}
}
int
static int
crypt_sodium_init(
cryptstate_T *state UNUSED,
char_u *key UNUSED,
@@ -1030,7 +1034,7 @@ fail:
* Encrypt "from[len]" into "to[len]".
* "from" and "to" can be equal to encrypt in place.
*/
long
static long
crypt_sodium_buffer_encode(
cryptstate_T *state UNUSED,
char_u *from UNUSED,
@@ -1080,7 +1084,7 @@ crypt_sodium_buffer_encode(
* Decrypt "from[len]" into "to[len]".
* "from" and "to" can be equal to encrypt in place.
*/
long
static long
crypt_sodium_buffer_decode(
cryptstate_T *state UNUSED,
char_u *from UNUSED,

View File

@@ -75,7 +75,6 @@ static void f_getregtype(typval_T *argvars, typval_T *rettv);
static void f_gettagstack(typval_T *argvars, typval_T *rettv);
static void f_gettext(typval_T *argvars, typval_T *rettv);
static void f_haslocaldir(typval_T *argvars, typval_T *rettv);
static void f_hasmapto(typval_T *argvars, typval_T *rettv);
static void f_hlID(typval_T *argvars, typval_T *rettv);
static void f_hlexists(typval_T *argvars, typval_T *rettv);
static void f_hostname(typval_T *argvars, typval_T *rettv);
@@ -6653,40 +6652,6 @@ f_haslocaldir(typval_T *argvars, typval_T *rettv)
rettv->vval.v_number = 0;
}
/*
* "hasmapto()" function
*/
static void
f_hasmapto(typval_T *argvars, typval_T *rettv)
{
char_u *name;
char_u *mode;
char_u buf[NUMBUFLEN];
int abbr = FALSE;
if (in_vim9script()
&& (check_for_string_arg(argvars, 0) == FAIL
|| check_for_opt_string_arg(argvars, 1) == FAIL
|| (argvars[1].v_type != VAR_UNKNOWN
&& check_for_opt_bool_arg(argvars, 2) == FAIL)))
return;
name = tv_get_string(&argvars[0]);
if (argvars[1].v_type == VAR_UNKNOWN)
mode = (char_u *)"nvo";
else
{
mode = tv_get_string_buf(&argvars[1], buf);
if (argvars[2].v_type != VAR_UNKNOWN)
abbr = (int)tv_get_bool(&argvars[2]);
}
if (map_to_exists(name, mode, abbr))
rettv->vval.v_number = TRUE;
else
rettv->vval.v_number = FALSE;
}
/*
* "highlightID(name)" function
*/

View File

@@ -648,7 +648,7 @@ eval_one_expr_in_str(char_u *p, garray_T *gap, int evaluate)
* Used for a heredoc assignment.
* Returns NULL for an error.
*/
char_u *
static char_u *
eval_all_expr_in_str(char_u *str)
{
garray_T ga;

View File

@@ -32,6 +32,7 @@ static void gui_do_scrollbar(win_T *wp, int which, int enable);
static void gui_update_horiz_scrollbar(int);
static void gui_set_fg_color(char_u *name);
static void gui_set_bg_color(char_u *name);
static void init_gui_options(void);
static win_T *xy2win(int x, int y, mouse_find_T popup);
#ifdef GUI_MAY_FORK
@@ -1395,7 +1396,7 @@ gui_update_cursor(
}
#if defined(FEAT_MENU) || defined(PROTO)
void
static void
gui_position_menu(void)
{
# if !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_MOTIF)
@@ -4815,7 +4816,7 @@ gui_bg_default(void)
/*
* Option initializations that can only be done after opening the GUI window.
*/
void
static void
init_gui_options(void)
{
// Set the 'background' option according to the lightness of the

View File

@@ -566,7 +566,7 @@ static int color_numbers_8[28] = {0, 4, 2, 6,
* "boldp" will be set to TRUE or FALSE for a foreground color when using 8
* colors, otherwise it will be unchanged.
*/
int
static int
lookup_color(int idx, int foreground, int *boldp)
{
int color = color_numbers_16[idx];

View File

@@ -908,13 +908,13 @@ get_map_mode(char_u **cmdp, int forceit)
}
/*
* Clear all mappings or abbreviations.
* 'abbr' should be FALSE for mappings, TRUE for abbreviations.
* Clear all mappings (":mapclear") or abbreviations (":abclear").
* "abbr" should be FALSE for mappings, TRUE for abbreviations.
*/
static void
map_clear(
char_u *cmdp,
char_u *arg UNUSED,
char_u *arg,
int forceit,
int abbr)
{
@@ -929,14 +929,14 @@ map_clear(
}
mode = get_map_mode(&cmdp, forceit);
map_clear_int(curbuf, mode, local, abbr);
map_clear_mode(curbuf, mode, local, abbr);
}
/*
* Clear all mappings in "mode".
*/
void
map_clear_int(
map_clear_mode(
buf_T *buf, // buffer for local mappings
int mode, // mode in which to delete
int local, // TRUE for buffer-local mappings
@@ -2272,6 +2272,40 @@ check_map(
return NULL;
}
/*
* "hasmapto()" function
*/
void
f_hasmapto(typval_T *argvars, typval_T *rettv)
{
char_u *name;
char_u *mode;
char_u buf[NUMBUFLEN];
int abbr = FALSE;
if (in_vim9script()
&& (check_for_string_arg(argvars, 0) == FAIL
|| check_for_opt_string_arg(argvars, 1) == FAIL
|| (argvars[1].v_type != VAR_UNKNOWN
&& check_for_opt_bool_arg(argvars, 2) == FAIL)))
return;
name = tv_get_string(&argvars[0]);
if (argvars[1].v_type == VAR_UNKNOWN)
mode = (char_u *)"nvo";
else
{
mode = tv_get_string_buf(&argvars[1], buf);
if (argvars[2].v_type != VAR_UNKNOWN)
abbr = (int)tv_get_bool(&argvars[2]);
}
if (map_to_exists(name, mode, abbr))
rettv->vval.v_number = TRUE;
else
rettv->vval.v_number = FALSE;
}
/*
* Fill in the empty dictionary with items as defined by maparg builtin.
*/

View File

@@ -24,9 +24,6 @@ void crypt_check_method(int method);
void crypt_check_current_method(void);
char_u *crypt_get_key(int store, int twice);
void crypt_append_msg(buf_T *buf);
int crypt_sodium_init(cryptstate_T *state, char_u *key, char_u *salt, int salt_len, char_u *seed, int seed_len);
long crypt_sodium_buffer_encode(cryptstate_T *state, char_u *from, size_t len, char_u **buf_out, int last);
long crypt_sodium_buffer_decode(cryptstate_T *state, char_u *from, size_t len, char_u **buf_out, int last);
int crypt_sodium_munlock(void *const addr, const size_t len);
void crypt_sodium_randombytes_buf(void *const buf, const size_t size);
/* vim: set ft=c : */

View File

@@ -14,7 +14,6 @@ int get_spellword(list_T *list, char_u **pp);
void prepare_vimvar(int idx, typval_T *save_tv);
void restore_vimvar(int idx, typval_T *save_tv);
char_u *eval_one_expr_in_str(char_u *p, garray_T *gap, int evaluate);
char_u *eval_all_expr_in_str(char_u *str);
list_T *heredoc_get(exarg_T *eap, char_u *cmd, int script_get, int vim9compile);
void ex_var(exarg_T *eap);
void ex_let(exarg_T *eap);

View File

@@ -9,7 +9,6 @@ int gui_init_font(char_u *font_list, int fontset);
int gui_get_wide_font(void);
void gui_set_ligatures(void);
void gui_update_cursor(int force, int clear_selection);
void gui_position_menu(void);
int gui_get_base_width(void);
int gui_get_base_height(void);
void gui_resize_shell(int pixel_width, int pixel_height);
@@ -51,7 +50,6 @@ void gui_check_colors(void);
guicolor_T gui_get_color(char_u *name);
int gui_get_lightness(guicolor_T pixel);
char_u *gui_bg_default(void);
void init_gui_options(void);
void gui_new_scrollbar_colors(void);
void gui_focus_change(int in_focus);
void gui_mouse_moved(int x, int y);

View File

@@ -4,7 +4,6 @@ char_u *highlight_group_name(int id);
int highlight_link_id(int id);
void init_highlight(int both, int reset);
int load_colors(char_u *name);
int lookup_color(int idx, int foreground, int *boldp);
void do_highlight(char_u *line, int forceit, int init);
void free_highlight(void);
void restore_cterm_colors(void);

View File

@@ -3,7 +3,7 @@ mapblock_T *get_maphash_list(int state, int c);
mapblock_T *get_buf_maphash_list(int state, int c);
int is_maphash_valid(void);
int do_map(int maptype, char_u *arg, int mode, int abbrev);
void map_clear_int(buf_T *buf, int mode, int local, int abbr);
void map_clear_mode(buf_T *buf, int mode, int local, int abbr);
int mode_str2flags(char_u *modechars);
int map_to_exists(char_u *str, char_u *modechars, int abbr);
int map_to_exists_mode(char_u *rhs, int mode, int abbr);
@@ -17,6 +17,7 @@ int makemap(FILE *fd, buf_T *buf);
int put_escstr(FILE *fd, char_u *strstart, int what);
void check_map_keycodes(void);
char_u *check_map(char_u *keys, int mode, int exact, int ign_mod, int abbr, mapblock_T **mp_ptr, int *local_ptr);
void f_hasmapto(typval_T *argvars, typval_T *rettv);
void f_maplist(typval_T *argvars, typval_T *rettv);
void f_maparg(typval_T *argvars, typval_T *rettv);
void f_mapcheck(typval_T *argvars, typval_T *rettv);

View File

@@ -40,7 +40,6 @@ void ex_scriptversion(exarg_T *eap);
void ex_finish(exarg_T *eap);
void do_finish(exarg_T *eap, int reanimate);
int source_finished(char_u *(*fgetline)(int, void *, int, getline_opt_T), void *cookie);
char_u *script_name_after_autoload(scriptitem_T *si);
char_u *get_autoload_prefix(scriptitem_T *si);
char_u *may_prefix_autoload(char_u *name);
char_u *autoload_name(char_u *name);

View File

@@ -38,7 +38,6 @@ void user_func_error(int error, char_u *name, funcexe_T *funcexe);
int call_func(char_u *funcname, int len, typval_T *rettv, int argcount_in, typval_T *argvars_in, funcexe_T *funcexe);
char_u *printable_func_name(ufunc_T *fp);
char_u *trans_function_name(char_u **pp, int *is_global, int skip, int flags, funcdict_T *fdp, partial_T **partial, type_T **type);
char_u *untrans_function_name(char_u *name);
char_u *get_scriptlocal_funcname(char_u *funcname);
char_u *alloc_printable_func_name(char_u *fname);
char_u *save_function_name(char_u **name, int *is_global, int skip, int flags, funcdict_T *fudi);

View File

@@ -2346,7 +2346,7 @@ source_finished(
* Find the path of a script below the "autoload" directory.
* Returns NULL if there is no "/autoload/" in the script name.
*/
char_u *
static char_u *
script_name_after_autoload(scriptitem_T *si)
{
char_u *p = si->sn_name;

View File

@@ -234,6 +234,7 @@ let s:filename_checks = {
\ 'haml': ['file.haml'],
\ 'hamster': ['file.hsm'],
\ 'handlebars': ['file.hbs'],
\ 'hare': ['file.ha'],
\ 'haskell': ['file.hs', 'file.hsc', 'file.hs-boot', 'file.hsig'],
\ 'haste': ['file.ht'],
\ 'hastepreproc': ['file.htpp'],

View File

@@ -1476,6 +1476,8 @@ func Test_fold_split()
call assert_equal([0, 1, 1, 2, 2], range(1, 5)->map('foldlevel(v:val)'))
call append(2, 'line 2.5')
call assert_equal([0, 1, 0, 1, 2, 2], range(1, 6)->map('foldlevel(v:val)'))
3d
call assert_equal([0, 1, 1, 2, 2], range(1, 5)->map('foldlevel(v:val)'))
bw!
endfunc

View File

@@ -3363,8 +3363,11 @@ func Test_bufoverflow()
cgetexpr ['Compiler: ' . repeat('a', 1015), 'File1:10:Hello World']
set efm=%DEntering\ directory\ %f,%f:%l:%m
cgetexpr ['Entering directory ' . repeat('a', 1006),
\ 'File1:10:Hello World']
let lines =<< trim eval END
Entering directory $"{repeat('a', 1006)}"
File1:10:Hello World
END
cgetexpr lines
set efm&vim
endfunc

View File

@@ -3364,6 +3364,22 @@ def Test_searchdecl()
v9.CheckDefAndScriptFailure(['searchdecl(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1'])
v9.CheckDefAndScriptFailure(['searchdecl("a", 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2'])
v9.CheckDefAndScriptFailure(['searchdecl("a", true, 2)'], ['E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3'])
# search for an empty string declaration
var lines: list<string> =<< trim END
int var1;
{
int var2;
var1 = 10;
}
END
new
setline(1, lines)
cursor(5, 4)
searchdecl('')
assert_equal([3, 1], [line('.'), col('.')])
bw!
enddef
def Test_searchpair()

View File

@@ -32,6 +32,7 @@ static funccall_T *previous_funccal = NULL;
static void funccal_unref(funccall_T *fc, ufunc_T *fp, int force);
static void func_clear(ufunc_T *fp, int force);
static int func_free(ufunc_T *fp, int force);
static char_u *untrans_function_name(char_u *name);
void
func_init()
@@ -4073,7 +4074,7 @@ theend:
* This can be used to first search for a script-local function and fall back
* to the global function if not found.
*/
char_u *
static char_u *
untrans_function_name(char_u *name)
{
char_u *p;

View File

@@ -735,6 +735,16 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
5,
/**/
4,
/**/
3,
/**/
2,
/**/
1,
/**/
0
};

View File

@@ -478,20 +478,16 @@ call_dfunc(
arg_to_add = ufunc->uf_args.ga_len - argcount;
if (arg_to_add < 0)
{
if (arg_to_add == -1)
emsg(_(e_one_argument_too_many));
else
semsg(_(e_nr_arguments_too_many), -arg_to_add);
semsg(NGETTEXT(e_one_argument_too_many, e_nr_arguments_too_many,
-arg_to_add), -arg_to_add);
return FAIL;
}
else if (arg_to_add > ufunc->uf_def_args.ga_len)
{
int missing = arg_to_add - ufunc->uf_def_args.ga_len;
if (missing == 1)
emsg(_(e_one_argument_too_few));
else
semsg(_(e_nr_arguments_too_few), missing);
semsg(NGETTEXT(e_one_argument_too_few, e_nr_arguments_too_few,
missing), missing);
return FAIL;
}
@@ -5170,19 +5166,15 @@ call_def_function(
idx = argc - ufunc->uf_args.ga_len;
if (idx > 0 && ufunc->uf_va_name == NULL)
{
if (idx == 1)
emsg(_(e_one_argument_too_many));
else
semsg(_(e_nr_arguments_too_many), idx);
semsg(NGETTEXT(e_one_argument_too_many, e_nr_arguments_too_many,
idx), idx);
goto failed_early;
}
idx = argc - ufunc->uf_args.ga_len + ufunc->uf_def_args.ga_len;
if (idx < 0)
{
if (idx == -1)
emsg(_(e_one_argument_too_few));
else
semsg(_(e_nr_arguments_too_few), -idx);
semsg(NGETTEXT(e_one_argument_too_few, e_nr_arguments_too_few,
-idx), -idx);
goto failed_early;
}