Compare commits

...

23 Commits

Author SHA1 Message Date
Bram Moolenaar
fff10d9a76 patch 8.2.3502: cannot enter password in shell command
Problem:    Cannot enter password in shell command.
Solution:   Revert patch 8.2.2919.
2021-10-13 10:05:30 +01:00
Eric Pruitt
e519eb41c1 patch 8.2.3501: tmux filetype dection is incomplete
Problem:    tmux filetype dection is incomplete
Solution:   Also use tmux for files having text after .conf. (Eric Pruitt,
            closes #8971)
2021-10-12 13:58:23 +01:00
Christian Brabandt
3a724290c5 patch 8.2.3500: Github CI fails to install clang
Problem:    Github CI fails to install clang.
Solution:   Install llvm-11 explicitly. (Christian Brabandt, closes #8993)
2021-10-12 12:02:49 +01:00
Bram Moolenaar
3d031a0ae7 patch 8.2.3499: GUI geometry startup test fails
Problem:    GUI geometry startup test fails.
Solution:   Check string values instead of numbers
2021-10-11 22:57:34 +01:00
James McCoy
37f341d723 patch 8.2.3498: recover test may fail on some systems
Problem:    Recover test may fail on some systems.
Solution:   Adjust the little endian and 64 bit detection. (James McCoy,
            closes #8941)
2021-10-11 21:04:37 +01:00
Dominique Pelle
a9173d06f7 patch 8.2.3497: put test fails when run by itself
Problem:    Put test fails when run by itself.
Solution:   Source check.vim. (Dominique Pellé, closes #8990)
2021-10-11 20:26:55 +01:00
James McCoy
a5d4f3b09d patch 8.2.3496: crypt test fails if xxd was not installed yet
Problem:    Crypt test fails on MS-Windows if xxd was not installed yet.
Solution:   Use the just built xxd executable if it exists. (James McCoy,
            closes #8929)
2021-10-11 16:27:03 +01:00
Bram Moolenaar
b376aa2da4 patch 8.2.3495: GUI geometry startup test fails on some systems
Problem:    GUI geometry startup test fails on some systems. (Drew Vogel)
Solution:   Add tolerance to the size check. (closes #8815)
2021-10-11 16:08:32 +01:00
Bram Moolenaar
b07626d4af patch 8.2.3494: illegal memory access in utf_head_off
Problem:    Illegal memory access in utf_head_off.
Solution:   Check cursor position when reselecting the Visual area.
            (closes #8963)
2021-10-11 15:40:43 +01:00
Bram Moolenaar
cddd5ac911 patch 8.2.3493: large count test fails on MS-Windows
Problem:    Large count test fails on MS-Windows.
Solution:   Skip the test on MS-Windows.
2021-10-10 13:54:01 +01:00
Bram Moolenaar
eeed1c7ae0 patch 8.2.3492: crash when pasting too many times
Problem:    Crash when pasting too many times.
Solution:   Limit the size to what fits in an int. (closes #8962)
2021-10-10 12:35:17 +01:00
Bram Moolenaar
6e77b88df6 patch 8.2.3491: xpm2 filetype dection is not so good
Problem:    xpm2 filetype dection is not so good.
Solution:   Adjust the check for xpm2. (closes #8914)
2021-10-09 16:29:43 +01:00
=?UTF-8?q?Dundar=20G=C3=B6c?=
3826c0513b patch 8.2.3490: superfluous return statements
Problem:    Superfluous return statements.
Solution:   Remove superfluous return statements from void functions.
            (closes #8977)
2021-10-09 15:39:25 +01:00
Bram Moolenaar
35a319b77f patch 8.2.3489: ml_get error after search with range
Problem:    ml_get error after search with range.
Solution:   Limit the line number to the buffer line count.
2021-10-09 13:58:55 +01:00
snxx
26190b2701 patch 8.2.3488: issue template is not easy to use
Problem:    Issue template is not easy to use.
Solution:   Use a yaml template. (closes #8928)
2021-10-09 12:50:20 +01:00
Bram Moolenaar
826bfe4bbd patch 8.2.3487: illegal memory access if buffer name is very long
Problem:    Illegal memory access if buffer name is very long.
Solution:   Make sure not to go over the end of the buffer.
2021-10-08 18:39:28 +01:00
Bram Moolenaar
cce81e9673 patch 8.2.3486: illegal memory access with invalid sequence of commands
Problem:    Illegal memory access with invalid sequence of commands.
Solution:   Do not call leave_block() when not in a try block. (closes #8966)
            Reset did_emsg so that exception is shown as an error.
2021-10-06 22:08:11 +01:00
Zdenek Dohnal
edd7a476fb patch 8.2.3485: Python 3 test fails with Python 3.10
Problem:    Python 3 test fails with Python 3.10.
Solution:   Adjust expected error message. (zdohnal Dohnal, closes #8969)
2021-10-06 19:39:16 +01:00
Bram Moolenaar
e275ba4fc9 patch 8.2.3484: crash when going through spell suggestions
Problem:    Crash when going through spell suggestions.
Solution:   Limit the text length for finding suggestions to the original
            length.  Do not update buffers when exiting. (closes #8965)
2021-10-06 13:41:07 +01:00
Bram Moolenaar
e2982d6911 patch 8.2.3483: #ifdef for using sysinfo() is incomplete
Problem:    #ifdef for using sysinfo() is incomplete.
Solution:   Also check for HAVE_SYSINFO. Make autoconf check use TRY_LINK.
            (closes #8952)
2021-10-06 11:27:21 +01:00
Bram Moolenaar
78e0fa4cf4 patch 8.2.3482: reading beyond end of line ending in quote and backslash
Problem:    Reading beyond end of line ending in quote and backslash.
Solution:   Check for non-NUL after backslash. (closes #8964)
2021-10-05 21:58:53 +01:00
James McCoy
2e258bd79f patch 8.2.3481: failures when char is unsigned
Problem:    Failures when char is unsigned.
Solution:   Use int8_T.  Make a CI run with unsigned char. (James McCoy,
            closes #8936)
2021-10-05 19:44:04 +01:00
Dominique Pelle
949de97da3 patch 8.2.3480: test does not fail without the fix for a crash
Problem:    Test does not fail without the fix for a crash.
Solution:   Write the bad code in a file and source it. (Dominique Pellé,
            closes #8961)
2021-10-05 19:28:01 +01:00
35 changed files with 311 additions and 81 deletions

View File

@@ -1,34 +0,0 @@
---
name: Bug report
about: Create a report to help us improve Vim
title: ''
labels: ''
---
_Instructions: Replace the template text and remove irrelevant text (including this line)_
**Describe the bug**
A clear and concise description of what the bug is.
(Issues related to the runtime files should be reported to their maintainer, check the file header.)
**To Reproduce**
Detailed steps to reproduce the behavior:
1. Run `vim --clean` (or `gvim --clean`, etc.)
2. Edit `filename`
3. Type '....'
4. Describe the error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, copy/paste the text or add screenshots to help explain your problem.
**Environment (please complete the following information):**
- Vim version [e.g. 8.1.1234] (Or paste the result of `vim --version`.)
- OS: [e.g. Ubuntu 18.04, Windows 10 1809, macOS 10.14]
- Terminal: [e.g. GNOME Terminal, mintty, iTerm2, tmux, GNU screen] (Use GUI if you use the GUI.)
**Additional context**
Add any other context about the problem here.

47
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@@ -0,0 +1,47 @@
---
name: Bug report
description: Create a report to help us improve Vim.
labels: [bug]
body:
- type: markdown
attributes:
value: |
Thanks for reporting issues of Vim!
To make it easier for us to help you please enter detailed information below.
- type: textarea
attributes:
label: Steps to reproduce
placeholder: |
1.
2.
3.
4.
validations:
required: true
- type: textarea
attributes:
label: Expected behaviour
placeholder: A clear and concise description of what you expected to happen.
validations:
required: true
- type: input
attributes:
label: Operating system
description: >
Your operating system name, version and desktop environment.
validations:
required: true
- type: input
attributes:
label: Version of Vim
description: >
The name of your development environment, version. [e.g. GNOME Terminal (v0.0.0000)]
validations:
required: true
- type: textarea
attributes:
label: Logs and stack traces
placeholder: Insert log or other text here (if necessary)
render: shell

View File

@@ -40,6 +40,7 @@ jobs:
compiler: gcc
coverage: true
extra: testgui
uchar: true
- features: huge
compiler: clang
extra: asan
@@ -80,7 +81,7 @@ jobs:
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
. /etc/lsb-release
sudo add-apt-repository -y "deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-11 main"
sudo apt-get install -y clang-11
sudo apt-get install -y clang-11 llvm-11
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-11 100
sudo update-alternatives --set clang /usr/bin/clang-11
sudo update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-11 100
@@ -111,10 +112,14 @@ jobs:
;;
esac
CFLAGS=""
if ${{ matrix.coverage == true }}; then
echo "CFLAGS=--coverage -DUSE_GCOV_FLUSH"
CFLAGS="$CFLAGS --coverage -DUSE_GCOV_FLUSH"
echo "LDFLAGS=--coverage"
fi
if ${{ matrix.uchar == true }}; then
CFLAGS="$CFLAGS -funsigned-char"
fi
if ${{ contains(matrix.extra, 'testgui') }}; then
echo "TEST=-C src testgui"
fi
@@ -130,6 +135,7 @@ jobs:
if ${{ contains(matrix.extra, 'vimtags') }}; then
echo "TEST=-C runtime/doc vimtags VIMEXE=../../${SRCDIR}/vim"
fi
echo "CFLAGS=$CFLAGS"
) >> $GITHUB_ENV
- name: Set up system

View File

@@ -2305,6 +2305,9 @@ au BufNewFile,BufRead .tcshrc* call dist#ft#SetFileTypeShell("tcsh")
" csh scripts ending in a star
au BufNewFile,BufRead .login*,.cshrc* call dist#ft#CSH()
" tmux configuration with arbitrary extension
au BufNewFile,BufRead {.,}tmux*.conf* setf tmux
" VHDL
au BufNewFile,BufRead *.vhdl_[0-9]* call s:StarSetf('vhdl')

5
src/auto/configure vendored
View File

@@ -13954,7 +13954,7 @@ main ()
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
if ac_fn_c_try_link "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }; $as_echo "#define HAVE_SYSINFO 1" >>confdefs.h
@@ -13962,7 +13962,8 @@ else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not usable" >&5
$as_echo "not usable" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysinfo.mem_unit" >&5
$as_echo_n "checking for sysinfo.mem_unit... " >&6; }

View File

@@ -3029,8 +3029,6 @@ buflist_setfpos(
wip->wi_prev = NULL;
if (wip->wi_next)
wip->wi_next->wi_prev = wip;
return;
}
#ifdef FEAT_DIFF

View File

@@ -82,10 +82,10 @@ skip_string(char_u *p)
{
if (p[0] == '\'') // 'c' or '\n' or '\000'
{
if (!p[1]) // ' at end of line
if (p[1] == NUL) // ' at end of line
break;
i = 2;
if (p[1] == '\\') // '\n' or '\000'
if (p[1] == '\\' && p[2] != NUL) // '\n' or '\000'
{
++i;
while (vim_isdigit(p[i - 1])) // '\000'

View File

@@ -199,7 +199,8 @@ clip_lose_selection(Clipboard_T *cbd)
|| get_real_state() == SELECTMODE)
&& (cbd == &clip_star ?
clip_isautosel_star() : clip_isautosel_plus())
&& HL_ATTR(HLF_V) != HL_ATTR(HLF_VNC))
&& HL_ATTR(HLF_V) != HL_ATTR(HLF_VNC)
&& !exiting)
{
update_curbuf(INVERTED_ALL);
setcursor();

View File

@@ -4113,9 +4113,10 @@ AC_TRY_COMPILE(
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCTL),
AC_MSG_RESULT(not usable))
dnl sysinfo() may exist but not be Linux compatible
dnl sysinfo() may exist but not be Linux compatible.
dnl On some FreeBSD systems it may depend on libsysinfo, use TRY_LINK
AC_MSG_CHECKING(for sysinfo)
AC_TRY_COMPILE(
AC_TRY_LINK(
[#include <sys/types.h>
#include <sys/sysinfo.h>],
[ struct sysinfo sinfo;

View File

@@ -464,13 +464,13 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED)
*(p + len++) = ' ';
if (bt_help(wp->w_buffer))
{
STRCPY(p + len, _("[Help]"));
vim_snprintf((char *)p + len, MAXPATHL - len, "%s", _("[Help]"));
len += (int)STRLEN(p + len);
}
#ifdef FEAT_QUICKFIX
if (wp->w_p_pvw)
{
STRCPY(p + len, _("[Preview]"));
vim_snprintf((char *)p + len, MAXPATHL - len, "%s", _("[Preview]"));
len += (int)STRLEN(p + len);
}
#endif
@@ -480,12 +480,12 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED)
#endif
)
{
STRCPY(p + len, "[+]");
len += 3;
vim_snprintf((char *)p + len, MAXPATHL - len, "%s", "[+]");
len += (int)STRLEN(p + len);
}
if (wp->w_buffer->b_p_ro)
{
STRCPY(p + len, _("[RO]"));
vim_snprintf((char *)p + len, MAXPATHL - len, "%s", _("[RO]"));
len += (int)STRLEN(p + len);
}

View File

@@ -664,3 +664,5 @@ EXTERN char e_blob_required_for_argument_nr[]
INIT(= N_("E1238: Blob required for argument %d"));
EXTERN char e_invalid_value_for_blob_nr[]
INIT(= N_("E1239: Invalid value for blob: %d"));
EXTERN char e_resulting_text_too_long[]
INIT(= N_("E1240: Resulting text too long"));

View File

@@ -4229,8 +4229,10 @@ get_address(
// When '/' or '?' follows another address, start from
// there.
if (lnum != MAXLNUM)
curwin->w_cursor.lnum = lnum;
if (lnum > 0 && lnum != MAXLNUM)
curwin->w_cursor.lnum =
lnum > curbuf->b_ml.ml_line_count
? curbuf->b_ml.ml_line_count : lnum;
// Start a forward search at the end of the line (unless
// before the first line).

View File

@@ -1385,7 +1385,7 @@ ex_endwhile(exarg_T *eap)
eap->errmsg = _(err);
else
{
fl = cstack->cs_flags[cstack->cs_idx];
fl = cstack->cs_flags[cstack->cs_idx];
if (!(fl & csf))
{
// If we are in a ":while" or ":for" but used the wrong endloop
@@ -2007,6 +2007,7 @@ ex_endtry(exarg_T *eap)
if (!(cstack->cs_flags[cstack->cs_idx] & CSF_TRY))
{
eap->errmsg = get_end_emsg(cstack);
// Find the matching ":try" and report what's missing.
idx = cstack->cs_idx;
do
@@ -2025,6 +2026,9 @@ ex_endtry(exarg_T *eap)
*/
if (did_throw)
discard_current_exception();
// report eap->errmsg, also when there already was an error
did_emsg = FALSE;
}
else
{
@@ -2105,7 +2109,9 @@ ex_endtry(exarg_T *eap)
*/
(void)cleanup_conditionals(cstack, CSF_TRY | CSF_SILENT, TRUE);
leave_block(cstack);
if (cstack->cs_idx >= 0
&& (cstack->cs_flags[cstack->cs_idx] & CSF_TRY))
leave_block(cstack);
--cstack->cs_trylevel;
if (!skip)

View File

@@ -243,7 +243,6 @@ add_buff(
buf->bh_curr->b_next = p;
buf->bh_curr = p;
}
return;
}
/*

View File

@@ -1109,7 +1109,7 @@ add_b0_fenc(
static int
swapfile_process_running(ZERO_BL *b0p, char_u *swap_fname UNUSED)
{
# ifdef HAVE_SYSINFO_UPTIME
#if defined(HAVE_SYSINFO) && defined(HAVE_SYSINFO_UPTIME)
stat_T st;
struct sysinfo sinfo;
@@ -1786,7 +1786,6 @@ theend:
apply_autocmds(EVENT_BUFREADPOST, NULL, curbuf->b_fname, FALSE, curbuf);
apply_autocmds(EVENT_BUFWINENTER, NULL, curbuf->b_fname, FALSE, curbuf);
}
return;
}
/*
@@ -3930,7 +3929,6 @@ ml_clearmarked(void)
}
lowest_marked = 0;
return;
}
/*

View File

@@ -2682,7 +2682,6 @@ get_scroll_overlap(lineoff_T *lp, int dir)
*lp = loff1; // 1 line overlap
else
*lp = loff2; // 2 lines overlap
return;
}
/*

View File

@@ -5671,8 +5671,7 @@ nv_visual(cmdarg_T *cap)
{
curwin->w_cursor.lnum +=
resel_VIsual_line_count * cap->count0 - 1;
if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count)
curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
check_cursor();
}
VIsual_mode = resel_VIsual_mode;
if (VIsual_mode == 'v')

View File

@@ -6391,8 +6391,6 @@ set_context_in_set_cmd(
}
#endif
}
return;
}
int

View File

@@ -4806,6 +4806,11 @@ mch_call_shell_fork(
// push stream discipline modules
if (options & SHELL_COOKED)
setup_slavepty(pty_slave_fd);
# ifdef TIOCSCTTY
// Try to become controlling tty (probably doesn't work,
// unless run by root)
ioctl(pty_slave_fd, TIOCSCTTY, (char *)NULL);
# endif
}
# endif
set_default_child_environment(FALSE);

View File

@@ -2011,8 +2011,15 @@ do_put(
}
do {
totlen = count * yanklen;
if (totlen > 0)
long multlen = count * yanklen;
totlen = multlen;
if (totlen != multlen)
{
emsg(_(e_resulting_text_too_long));
break;
}
else if (totlen > 0)
{
oldp = ml_get(lnum);
if (lnum > start_lnum)

View File

@@ -1178,6 +1178,11 @@ suggest_try_change(suginfo_T *su)
p = su->su_badptr + su->su_badlen;
(void)spell_casefold(curwin, p, (int)STRLEN(p), fword + n, MAXWLEN - n);
// Make sure the resulting text is not longer than the original text.
n = (int)STRLEN(su->su_badptr);
if (n < MAXWLEN)
fword[n] = NUL;
for (lpi = 0; lpi < curwin->w_s->b_langp.ga_len; ++lpi)
{
lp = LANGP_ENTRY(curwin->w_s->b_langp, lpi);

View File

@@ -1406,8 +1406,8 @@ typedef struct type_S type_T;
struct type_S {
vartype_T tt_type;
int8_T tt_argcount; // for func, incl. vararg, -1 for unknown
char tt_min_argcount; // number of non-optional arguments
char tt_flags; // TTFLAG_ values
int8_T tt_min_argcount; // number of non-optional arguments
char_u tt_flags; // TTFLAG_ values
type_T *tt_member; // for list, dict, func return type
type_T **tt_args; // func argument types, allocated
};

View File

@@ -5307,4 +5307,11 @@ func Test_cindent_pragma()
enew! | close
endfunc
func Test_backslash_at_end_of_line()
new
exe "norm v>O'\\\<C-m>-"
exe "norm \<C-q>="
bwipe!
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -3,6 +3,13 @@
source check.vim
CheckFeature cryptv
let s:xxd_cmd = ''
if empty($XXDPROG) && executable('..\xxd\xxd.exe')
let s:xxd_cmd = '..\xxd\xxd.exe'
elseif !empty($XXDPROG) && executable($XXDPROG)
let s:xxd_cmd = $XXDPROG
endif
func Common_head_only(text)
" This was crashing Vim
split Xtest.txt
@@ -81,8 +88,11 @@ func Uncrypt_stable(method, crypted_text, key, uncrypted_text)
endfunc
func Uncrypt_stable_xxd(method, hex, key, uncrypted_text)
if empty(s:xxd_cmd)
throw 'Skipped: xxd program missing'
endif
" use xxd to write the binary content
call system('xxd -r >Xtest.txt', a:hex)
call system(s:xxd_cmd .. ' -r >Xtest.txt', a:hex)
call feedkeys(":split Xtest.txt\<CR>" . a:key . "\<CR>", 'xt')
call assert_equal(a:uncrypted_text, getline(1, len(a:uncrypted_text)))
bwipe!

View File

@@ -504,7 +504,7 @@ let s:filename_checks = {
\ 'tidy': ['.tidyrc', 'tidyrc', 'tidy.conf'],
\ 'tilde': ['file.t.html'],
\ 'tli': ['file.tli'],
\ 'tmux': ['tmuxfile.conf', '.tmuxfile.conf', '.tmux-file.conf', '.tmux.conf', 'tmux-file.conf', 'tmux.conf'],
\ 'tmux': ['tmuxfile.conf', '.tmuxfile.conf', '.tmux-file.conf', '.tmux.conf', 'tmux-file.conf', 'tmux.conf', 'tmux.conf.local'],
\ 'toml': ['file.toml'],
\ 'tpp': ['file.tpp'],
\ 'treetop': ['file.treetop'],
@@ -555,6 +555,7 @@ let s:filename_checks = {
\ 'xml': ['/etc/blkid.tab', '/etc/blkid.tab.old', 'file.xmi', 'file.csproj', 'file.csproj.user', 'file.ui', 'file.tpm', '/etc/xdg/menus/file.menu', 'fglrxrc', 'file.xlf', 'file.xliff', 'file.xul', 'file.wsdl', 'file.wpl', 'any/etc/blkid.tab', 'any/etc/blkid.tab.old', 'any/etc/xdg/menus/file.menu', 'file.atom', 'file.rss', 'file.cdxml', 'file.psc1', 'file.mpd'],
\ 'xmodmap': ['anyXmodmap', 'Xmodmap', 'some-Xmodmap', 'some-xmodmap', 'some-xmodmap-file', 'xmodmap', 'xmodmap-file'],
\ 'xf86conf': ['xorg.conf', 'xorg.conf-4'],
\ 'xpm': ['file.xpm'],
\ 'xpm2': ['file.xpm2'],
\ 'xquery': ['file.xq', 'file.xql', 'file.xqm', 'file.xquery', 'file.xqy'],
\ 'xs': ['file.xs'],
@@ -569,7 +570,6 @@ let s:filename_checks = {
\ 'zsh': ['.zprofile', '/etc/zprofile', '.zfbfmarks', 'file.zsh', '.zcompdump', '.zlogin', '.zlogout', '.zshenv', '.zshrc', '.zcompdump-file', '.zlog', '.zlog-file', '.zsh', '.zsh-file', 'any/etc/zprofile', 'zlog', 'zlog-file', 'zsh', 'zsh-file'],
\
\ 'help': [$VIMRUNTIME . '/doc/help.txt'],
\ 'xpm': ['file.xpm'],
\ }
let s:filename_case_checks = {
@@ -943,4 +943,17 @@ func Test_m_file()
call delete('Xfile.m')
filetype off
endfunc
func Test_xpm_file()
filetype on
call writefile(['this is XPM2'], 'file.xpm')
split file.xpm
call assert_equal('xpm2', &filetype)
bwipe!
call delete('file.xpm')
filetype off
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -1,5 +1,7 @@
" Tests for put commands, e.g. ":put", "p", "gp", "P", "gP", etc.
source check.vim
func Test_put_block()
new
call feedkeys("i\<C-V>u2500\<CR>x\<ESC>", 'x')
@@ -134,4 +136,15 @@ func Test_gp_with_count_leaves_cursor_at_end()
bwipe!
endfunc
func Test_very_large_count()
" FIXME: should actually check if sizeof(int) == sizeof(long)
CheckNotMSWindows
new
let @" = 'x'
call assert_fails('norm 44444444444444p', 'E1240:')
bwipe!
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -12,7 +12,7 @@ func Create_vim_dict()
return {'a': 1}
endfunction
let s:system_error_pat = 'Vim(py3):SystemError: \(<built-in function eval> returned NULL without setting an error\|error return without exception set\)'
let s:system_error_pat = 'Vim(py3):SystemError: \(<built-in function eval> returned NULL without setting an \(error\|exception\)\|error return without exception set\)'
" This function should be called first. This sets up python functions used by
" the other tests.

View File

@@ -208,9 +208,11 @@ func Test_recover_corrupted_swap_file()
" Not all fields are written in a system-independent manner. Detect whether
" the test is running on a little or big-endian system, so the correct
" corruption values can be set.
let little_endian = b[1008:1011] == 0z33323130
" The swap file header fields can be either 32-bit or 64-bit.
let system_64bit = b[1012:1015] == 0z00000000
" The B0_MAGIC_LONG field may be 32-bit or 64-bit, depending on the system,
" even though the value stored is only 32-bits. Therefore, need to check
" both the high and low 32-bits to compute these values.
let little_endian = (b[1008:1011] == 0z33323130) || (b[1012:1015] == 0z33323130)
let system_64bit = little_endian ? (b[1012:1015] == 0z00000000) : (b[1008:1011] == 0z00000000)
" clear the B0_MAGIC_LONG field
if system_64bit

View File

@@ -1989,5 +1989,19 @@ func Test_no_last_search_pattern()
call feedkeys("??\<C-T>", 'xt')
endfunc
func Test_search_with_invalid_range()
new
let lines =<< trim END
/\%.v
5/
c
END
call writefile(lines, 'Xrangesearch')
source Xrangesearch
bwipe!
call delete('Xrangesearch')
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -765,4 +765,20 @@ func Test_spellfile_value()
set spellfile=Xdir/Xtest.utf-8.add,Xtest_other.add
endfunc
func Test_no_crash_with_weird_text()
new
let lines =<< trim END
r<sfile>
€
€
END
call setline(1, lines)
exe "%norm \<C-v>ez=>\<C-v>wzG"
bwipe!
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -533,7 +533,14 @@ func Test_geometry()
[CODE]
if RunVim([], after, '-f -g -geometry 31x13+41+43')
let lines = readfile('Xtest_geometry')
call assert_equal(['31', '13', '41', '43', '[41, 43]'], lines)
" Depending on the GUI library and the windowing system the final size
" might be a bit different, allow for some tolerance. Tuned based on
" actual failures.
call assert_inrange(31, 35, str2nr(lines[0]))
call assert_equal('13', lines[1])
call assert_equal('41', lines[2])
call assert_equal('43', lines[3])
call assert_equal('[41, 43]', lines[4])
endif
endif

View File

@@ -522,4 +522,14 @@ func Test_statusline_mbyte_fillchar()
%bw!
endfunc
" Used to write beyond allocated memory. This assumes MAXPATHL is 4096 bytes.
func Test_statusline_verylong_filename()
let fname = repeat('x', 4090)
exe "new " .. fname
set buftype=help
set previewwindow
redraw
bwipe!
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -2274,17 +2274,46 @@ func Test_user_command_function_call_with_endtry()
endfunc
func ThisWillFail()
try
if x | endif
catch
for l in []
finally
endfunc
" This was crashing prior to the fix in 8.2.3478.
func Test_error_in_catch_and_finally()
call assert_fails('call ThisWillFail()', ['E121:', 'E600:'])
let lines =<< trim END
try
echo x
catch
for l in []
finally
END
call writefile(lines, 'XtestCatchAndFinally')
try
source XtestCatchAndFinally
catch /E600:/
endtry
call delete('XtestCatchAndFinally')
endfunc
" This was causing an illegal memory access
func Test_leave_block_in_endtry_not_called()
let lines =<< trim END
vim9script
try #
for x in []
if
endwhile
if
endtry
END
call writefile(lines, 'XtestEndtry')
try
source XtestEndtry
catch /E171:/
endtry
call delete('XtestEndtry')
endfunc
" Modeline {{{1
" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker

View File

@@ -1265,5 +1265,25 @@ func Test_visual_block_with_virtualedit()
call delete('XTest_block')
endfunc
func Test_visual_reselect_with_count()
" this was causing an illegal memory access
let lines =<< trim END
:
r<sfile>
exe "%norm e3\<c-v>kr\t"
:
:
END
call writefile(lines, 'XvisualReselect')
source XvisualReselect
bwipe!
call delete('XvisualReselect')
endfunc
" vim: shiftwidth=2 sts=2 expandtab

View File

@@ -757,6 +757,52 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
3502,
/**/
3501,
/**/
3500,
/**/
3499,
/**/
3498,
/**/
3497,
/**/
3496,
/**/
3495,
/**/
3494,
/**/
3493,
/**/
3492,
/**/
3491,
/**/
3490,
/**/
3489,
/**/
3488,
/**/
3487,
/**/
3486,
/**/
3485,
/**/
3484,
/**/
3483,
/**/
3482,
/**/
3481,
/**/
3480,
/**/
3479,
/**/