Compare commits

...

4 Commits

Author SHA1 Message Date
3b675c276c patch 8.2.4964: MS-Windows GUI: mouse event test is flaky
Problem:    MS-Windows GUI: mouse event test is flaky.
Solution:   Add a short delay after generating a mouse event.
2022-05-16 13:34:44 +01:00
386c24cd26 patch 8.2.4963: expanding path with "/**" may overrun end of buffer
Problem:    Expanding path with "/**" may overrun end of buffer.
Solution:   Use vim_snprintf().
2022-05-16 12:37:36 +01:00
5a8fad32ea patch 8.2.4962: files show up in git status
Problem:    Files show up in git status.
Solution:   Adjust the list of ignored files.  Clean up more test files.
            (Shane xb Qian, closes #9929)
2022-05-16 11:14:09 +01:00
9f28eeb694 patch 8.2.4961: build error with a certain combination of features
Problem:    Build error with a certain combination of features.
Solution:   Adjust #if. (John Marriott)
2022-05-16 10:04:51 +01:00
6 changed files with 54 additions and 37 deletions

7
.gitignore vendored
View File

@ -8,7 +8,6 @@ src/auto/gui_gtk_gresources.h
src/auto/os_haiku.rdef
src/objects/.dirstamp
src/objects
src/tags
src/types.vim
# We do need src/auto/configure.
@ -62,6 +61,11 @@ src/xxd/xxd.dSYM
*.pyc
*.log
src/po/vim.pot
src/tags
/tags
/GPATH
/GTAGS
/GRTAGS
# Generated by "make test"
src/po/*.ck
@ -86,7 +90,6 @@ src/message_test
src/kword_test
# Generated by "make install"
runtime/doc/tags
runtime/doc/doctags
# Generated by "make shadow". The directory names could be anything but we

View File

@ -3589,6 +3589,7 @@ unix_expandpath(
int didstar) // expanded "**" once already
{
char_u *buf;
size_t buflen;
char_u *path_end;
char_u *p, *s, *e;
int start_len = gap->ga_len;
@ -3612,7 +3613,8 @@ unix_expandpath(
}
// make room for file name
buf = alloc(STRLEN(path) + BASENAMELEN + 5);
buflen = STRLEN(path) + BASENAMELEN + 5;
buf = alloc(buflen);
if (buf == NULL)
return 0;
@ -3737,14 +3739,14 @@ unix_expandpath(
{
// For "**" in the pattern first go deeper in the tree to
// find matches.
STRCPY(buf + len, "/**");
STRCPY(buf + len + 3, path_end);
vim_snprintf((char *)buf + len, buflen - len,
"/**%s", path_end);
++stardepth;
(void)unix_expandpath(gap, buf, len + 1, flags, TRUE);
--stardepth;
}
STRCPY(buf + len, path_end);
vim_snprintf((char *)buf + len, buflen - len, "%s", path_end);
if (mch_has_exp_wildcard(path_end)) // handle more wildcards
{
// need to expand another component of the path

View File

@ -3361,7 +3361,8 @@ ml_append_flags(
}
#if defined(FEAT_SPELL) || defined(FEAT_QUICKFIX) || defined(PROTO)
#if defined(FEAT_SPELL) || defined(FEAT_QUICKFIX) || defined(FEAT_PROP_POPUP) \
|| defined(PROTO)
/*
* Like ml_append() but for an arbitrary buffer. The buffer must already have
* a memline.

View File

@ -18,7 +18,7 @@ REDIR_TEST_TO_NULL = --cmd 'au SwapExists * let v:swapchoice = "e"' | LC_ALL=C L
# The output goes into a file "valgrind.testN"
# Vim should be compiled with EXITFREE to avoid false warnings.
# This will make testing about 10 times as slow.
# VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=25 --log-file=valgrind.$*
# VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=35 --log-file=valgrind.$*
default: nongui
@ -86,7 +86,7 @@ RUN_VIM = VIMRUNTIME=$(SCRIPTSOURCE) $(VALGRIND) $(VIMPROG) -f $(GUI_FLAG) -u un
clean:
-rm -rf *.out *.failed *.res *.rej *.orig XfakeHOME Xdir1 Xfind
-rm -f opt_test.vim test.log test_result.log messages
-rm -f $(RM_ON_RUN) $(RM_ON_START)
-rm -rf $(RM_ON_RUN) $(RM_ON_START)
-rm -f valgrind.*
-rm -f asan.*

View File

@ -1198,6 +1198,17 @@ func Test_gui_mouse_event()
set mousemodel&
endfunc
" Move the mouse to the top-left in preparation for mouse events
func PrepareForMouseEvent(args)
call extend(a:args, #{row: 1, col:1})
call test_gui_event('mouse', a:args)
call feedkeys('', 'Lx!')
" on MS-Windows the event may have a slight delay
if has('win32')
sleep 20m
endif
endfunc
func Test_gui_mouse_move_event()
let args = #{move: 1, button: 0, multiclick: 0, modifiers: 0}
@ -1205,67 +1216,59 @@ func Test_gui_mouse_move_event()
set mousemev&
call assert_false(&mousemev)
let n_event = 0
nnoremap <special> <MouseMove> :let n_event += 1<CR>
let g:n_event = 0
nnoremap <special> <MouseMove> :let g:n_event += 1<CR>
" start at mouse pos (1,1), clear counter
call extend(args, #{row: 1, col:1})
call test_gui_event('mouse', args)
call feedkeys('', 'Lx!')
let n_event = 0
call PrepareForMouseEvent(args)
let g:n_event = 0
call extend(args, #{row: 30, col:300})
call extend(args, #{row: 30, col: 300})
call test_gui_event('mouse', args)
call feedkeys('', 'Lx!')
call extend(args, #{row: 100, col:300})
call extend(args, #{row: 100, col: 300})
call test_gui_event('mouse', args)
call feedkeys('', 'Lx!')
" no events since mousemev off
call assert_equal(0, n_event)
call assert_equal(0, g:n_event)
" turn on mouse events and try the same thing
set mousemev
call extend(args, #{row: 1, col:1})
call test_gui_event('mouse', args)
call feedkeys('', 'Lx!')
let n_event = 0
call PrepareForMouseEvent(args)
let g:n_event = 0
call extend(args, #{row: 30, col:300})
call extend(args, #{row: 30, col: 300})
call test_gui_event('mouse', args)
call feedkeys('', 'Lx!')
call extend(args, #{row: 100, col:300})
call extend(args, #{row: 100, col: 300})
call test_gui_event('mouse', args)
call feedkeys('', 'Lx!')
call assert_equal(2, n_event)
call assert_equal(2, g:n_event)
" wiggle the mouse around, shouldn't get events
call extend(args, #{row: 1, col:1})
call test_gui_event('mouse', args)
call feedkeys('', 'Lx!')
let n_event = 0
call PrepareForMouseEvent(args)
let g:n_event = 0
call extend(args, #{row: 1, col:2})
call extend(args, #{row: 1, col: 2})
call test_gui_event('mouse', args)
call feedkeys('', 'Lx!')
call extend(args, #{row: 2, col:2})
call extend(args, #{row: 2, col: 2})
call test_gui_event('mouse', args)
call feedkeys('', 'Lx!')
call extend(args, #{row: 2, col:1})
call extend(args, #{row: 2, col: 1})
call test_gui_event('mouse', args)
call feedkeys('', 'Lx!')
call extend(args, #{row: 1, col:1})
call test_gui_event('mouse', args)
call feedkeys('', 'Lx!')
call assert_equal(0, n_event)
call PrepareForMouseEvent(args)
call assert_equal(0, g:n_event)
unlet g:n_event
unmap <MouseMove>
set mousemev&
endfunc

View File

@ -746,6 +746,14 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4964,
/**/
4963,
/**/
4962,
/**/
4961,
/**/
4960,
/**/