Patch 8.1.1963

2019-09-01 Fir de Conversatie Bram Moolenaar


Patch 8.1.1963
Problem:Popup window filter may be called recursively when using a Normal
mode command. (Nick Jensen)
Solution:   Prevent recursiveness. (closes #4887)  Also restore KeyTyped.
Files:  src/popupwin.c, src/testdir/test_popupwin.vim


*** ../vim-8.1.1962/src/popupwin.c  2019-09-01 17:38:05.332455200 +0200
--- src/popupwin.c  2019-09-01 23:22:46.447977386 +0200
***
*** 2764,2771 
--- 2764,2777 
  int
  popup_do_filter(int c)
  {
+ static intrecursive = FALSE;
  int   res = FALSE;
  win_T *wp;
+ int   save_KeyTyped = KeyTyped;
+ 
+ if (recursive)
+   return FALSE;
+ recursive = TRUE;
  
  popup_reset_handled();
  
***
*** 2776,2788 
  
wp = mouse_find_win(, , FIND_POPUP);
if (wp != NULL && popup_close_if_on_X(wp, row, col))
!   return TRUE;
  }
  
  while (!res && (wp = find_next_popup(FALSE)) != NULL)
if (wp->w_filter_cb.cb_name != NULL)
res = invoke_popup_filter(wp, c);
  
  return res;
  }
  
--- 2782,2796 
  
wp = mouse_find_win(, , FIND_POPUP);
if (wp != NULL && popup_close_if_on_X(wp, row, col))
!   res = TRUE;
  }
  
  while (!res && (wp = find_next_popup(FALSE)) != NULL)
if (wp->w_filter_cb.cb_name != NULL)
res = invoke_popup_filter(wp, c);
  
+ recursive = FALSE;
+ KeyTyped = save_KeyTyped;
  return res;
  }
  
*** ../vim-8.1.1962/src/testdir/test_popupwin.vim   2019-09-01 
17:38:05.332455200 +0200
--- src/testdir/test_popupwin.vim   2019-09-01 23:07:20.396364772 +0200
***
*** 1919,1924 
--- 1919,1949 
call delete('XsomeFile')
  endfunc
  
+ func Test_popupwin_with_buffer_and_filter()
+   new Xwithfilter
+   call setline(1, range(100))
+   let bufnr = bufnr()
+   hide
+ 
+   func BufferFilter(win, key)
+ if a:key == 'G'
+   " recursive use of "G" does not cause problems.
+   call win_execute(a:win, 'normal! G')
+   return 1
+ endif
+ return 0
+   endfunc
+ 
+   let winid = popup_create(bufnr, #{maxheight: 5, filter: 'BufferFilter'})
+   call assert_equal(1, popup_getpos(winid).firstline)
+   redraw
+   call feedkeys("G", 'xt')
+   call assert_equal(99, popup_getpos(winid).firstline)
+ 
+   call popup_close(winid)
+   exe 'bwipe! ' .. bufnr
+ endfunc
+ 
  func Test_popupwin_width()
let winid = popup_create(repeat(['short', 'long long long line', 'medium 
width'], 50), #{
\ maxwidth: 40,
*** ../vim-8.1.1962/src/version.c   2019-09-01 20:21:53.070152262 +0200
--- src/version.c   2019-09-01 23:26:31.570908613 +0200
***
*** 763,764 
--- 763,766 
  {   /* Add new patch number below this line */
+ /**/
+ 1963,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
167. You have more than 200 websites bookmarked.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201909012127.x81LRo0U029789%40masaka.moolenaar.net.


Patch 8.1.1962

2019-09-01 Fir de Conversatie Bram Moolenaar


Patch 8.1.1962
Problem:Leaking memory when using tagfunc().
Solution:   Free the user_data. (Dominique Pelle, closes #4886)
Files:  src/window.c


*** ../vim-8.1.1961/src/window.c2019-08-30 15:46:27.192906157 +0200
--- src/window.c2019-09-01 20:20:59.538384080 +0200
***
*** 4892,4899 
  win_free_lsize(wp);
  
  for (i = 0; i < wp->w_tagstacklen; ++i)
vim_free(wp->w_tagstack[i].tagname);
! 
  vim_free(wp->w_localdir);
  
  /* Remove the window from the b_wininfo lists, it may happen that the
--- 4892,4901 
  win_free_lsize(wp);
  
  for (i = 0; i < wp->w_tagstacklen; ++i)
+ {
vim_free(wp->w_tagstack[i].tagname);
!   vim_free(wp->w_tagstack[i].user_data);
! }
  vim_free(wp->w_localdir);
  
  /* Remove the window from the b_wininfo lists, it may happen that the
*** ../vim-8.1.1961/src/version.c   2019-09-01 20:16:48.007438487 +0200
--- src/version.c   2019-09-01 20:20:20.018553826 +0200
***
*** 763,764 
--- 763,766 
  {   /* Add new patch number below this line */
+ /**/
+ 1962,
  /**/

-- 
You're as much use as a condom machine at the Vatican.
  -- Rimmer to Holly in Red Dwarf 'Queeg'

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201909011822.x81IMHx2023773%40masaka.moolenaar.net.


Patch 8.1.1961

2019-09-01 Fir de Conversatie Bram Moolenaar


Patch 8.1.1961
Problem:More functions can be used as a method.
Solution:   Allow more functions to be used as a method.  Add a test for
mapcheck().
Files:  runtime/doc/eval.txt, src/evalfunc.c, src/testdir/test70.in,
src/testdir/test_functions.vim, src/testdir/test_getcwd.vim,
src/testdir/test_maparg.vim, src/testdir/test_match.vim


*** ../vim-8.1.1960/runtime/doc/eval.txt2019-08-31 22:16:30.770127033 
+0200
--- runtime/doc/eval.txt2019-09-01 19:13:56.334609314 +0200
***
*** 6691,6696 
--- 6699,6706 
mapped, and have it do the original mapping too.  Sketch: >
exe 'nnoremap  ==' . maparg('', 'n')
  
+ < Can also be used as a |method|: >
+   GetKey()->maparg('n')
  
  mapcheck({name} [, {mode} [, {abbr}]])*mapcheck()*
Check if there is a mapping that matches with {name} in mode
***
*** 6725,6730 
--- 6735,6743 
  < This avoids adding the "_vv" mapping when there already is a
mapping for "_v" or for "_vvv".
  
+   Can also be used as a |method|: >
+   GetKey()->mapcheck('n')
+ 
  match({expr}, {pat} [, {start} [, {count}]])  *match()*
When {expr} is a |List| then this returns the index of the
first item where {pat} matches.  Each item is used as a
***
*** 6783,6788 
--- 6796,6804 
the pattern.  'smartcase' is NOT used.  The matching is always
done like 'magic' is set and 'cpoptions' is empty.
  
+   Can also be used as a |method|: >
+   GetList()->match('word')
+ <
*matchadd()* *E798* *E799* *E801* *E957*
  matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]])
Defines a pattern to be highlighted in the current window (a
***
*** 6838,6843 
--- 6854,6862 
available from |getmatches()|.  All matches can be deleted in
one operation by |clearmatches()|.
  
+   Can also be used as a |method|: >
+   GetGroup()->matchadd('TODO')
+ <
*matchaddpos()*
  matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]])
Same as |matchadd()|, but requires a list of positions {pos}
***
*** 6872,6877 
--- 6891,6899 
|getmatches()| with an entry "pos1", "pos2", etc., with the
value a list like the {pos} item.
  
+   Can also be used as a |method|: >
+   GetGroup()->matchaddpos([23, 11])
+ 
  matcharg({nr})
*matcharg()*
Selects the {nr} match item, as set with a |:match|,
|:2match| or |:3match| command.
***
*** 6884,6889 
--- 6906,6914 
Highlighting matches using the |:match| commands are limited
to three matches. |matchadd()| does not have this limitation.
  
+   Can also be used as a |method|: >
+   GetMatch()->matcharg()
+ 
  matchdelete({id} [, {win})   *matchdelete()* *E802* *E803*
Deletes a match with ID {id} previously defined by |matchadd()|
or one of the |:match| commands.  Returns 0 if successful,
***
*** 6892,6897 
--- 6917,6925 
If {win} is specified, use the window with this number or
window ID instead of the current window.
  
+   Can also be used as a |method|: >
+   GetMatch()->matchdelete()
+ 
  matchend({expr}, {pat} [, {start} [, {count}]])   
*matchend()*
Same as |match()|, but return the index of first character
after the match.  Example: >
***
*** 6911,6916 
--- 6939,6947 
  < result is "-1".
When {expr} is a |List| the result is equal to |match()|.
  
+   Can also be used as a |method|: >
+   GetText()->matchend('word')
+ 
  matchlist({expr}, {pat} [, {start} [, {count}]])  *matchlist()*
Same as |match()|, but return a |List|.  The first item in the
list is the matched string, same as what matchstr() would
***
*** 6921,6926 
--- 6952,6960 
  < Results in: ['acd', 'a', '', 'c', 'd', '', '', '', '', '']
When there is no match an empty list is returned.
  
+   Can also be used as a |method|: >
+   GetList()->matchlist('word')
+ 
  matchstr({expr}, {pat} [, {start} [, {count}]])   
*matchstr()*
Same as |match()|, but return the 

Patch 8.1.1960

2019-09-01 Fir de Conversatie Bram Moolenaar


Patch 8.1.1960
Problem:Fold code is spread out.
Solution:   Move fold functions to fold.c.
Files:  src/evalfunc.c, src/fold.c, src/proto/fold.pro


*** ../vim-8.1.1959/src/evalfunc.c  2019-08-31 22:16:30.774127008 +0200
--- src/evalfunc.c  2019-09-01 17:48:04.260573254 +0200
***
*** 117,127 
  #endif
  static void f_fnameescape(typval_T *argvars, typval_T *rettv);
  static void f_fnamemodify(typval_T *argvars, typval_T *rettv);
- static void f_foldclosed(typval_T *argvars, typval_T *rettv);
- static void f_foldclosedend(typval_T *argvars, typval_T *rettv);
- static void f_foldlevel(typval_T *argvars, typval_T *rettv);
- static void f_foldtext(typval_T *argvars, typval_T *rettv);
- static void f_foldtextresult(typval_T *argvars, typval_T *rettv);
  static void f_foreground(typval_T *argvars, typval_T *rettv);
  static void f_funcref(typval_T *argvars, typval_T *rettv);
  static void f_function(typval_T *argvars, typval_T *rettv);
--- 117,122 
***
*** 3642,3814 
  }
  
  /*
-  * "foldclosed()" function
-  */
- static void
- foldclosed_both(
- typval_T  *argvars UNUSED,
- typval_T  *rettv,
- int   end UNUSED)
- {
- #ifdef FEAT_FOLDING
- linenr_T  lnum;
- linenr_T  first, last;
- 
- lnum = tv_get_lnum(argvars);
- if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count)
- {
-   if (hasFoldingWin(curwin, lnum, , , FALSE, NULL))
-   {
-   if (end)
-   rettv->vval.v_number = (varnumber_T)last;
-   else
-   rettv->vval.v_number = (varnumber_T)first;
-   return;
-   }
- }
- #endif
- rettv->vval.v_number = -1;
- }
- 
- /*
-  * "foldclosed()" function
-  */
- static void
- f_foldclosed(typval_T *argvars, typval_T *rettv)
- {
- foldclosed_both(argvars, rettv, FALSE);
- }
- 
- /*
-  * "foldclosedend()" function
-  */
- static void
- f_foldclosedend(typval_T *argvars, typval_T *rettv)
- {
- foldclosed_both(argvars, rettv, TRUE);
- }
- 
- /*
-  * "foldlevel()" function
-  */
- static void
- f_foldlevel(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
- {
- #ifdef FEAT_FOLDING
- linenr_T  lnum;
- 
- lnum = tv_get_lnum(argvars);
- if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count)
-   rettv->vval.v_number = foldLevel(lnum);
- #endif
- }
- 
- /*
-  * "foldtext()" function
-  */
- static void
- f_foldtext(typval_T *argvars UNUSED, typval_T *rettv)
- {
- #ifdef FEAT_FOLDING
- linenr_T  foldstart;
- linenr_T  foldend;
- char_u*dashes;
- linenr_T  lnum;
- char_u*s;
- char_u*r;
- int   len;
- char  *txt;
- long  count;
- #endif
- 
- rettv->v_type = VAR_STRING;
- rettv->vval.v_string = NULL;
- #ifdef FEAT_FOLDING
- foldstart = (linenr_T)get_vim_var_nr(VV_FOLDSTART);
- foldend = (linenr_T)get_vim_var_nr(VV_FOLDEND);
- dashes = get_vim_var_str(VV_FOLDDASHES);
- if (foldstart > 0 && foldend <= curbuf->b_ml.ml_line_count
-   && dashes != NULL)
- {
-   /* Find first non-empty line in the fold. */
-   for (lnum = foldstart; lnum < foldend; ++lnum)
-   if (!linewhite(lnum))
-   break;
- 
-   /* Find interesting text in this line. */
-   s = skipwhite(ml_get(lnum));
-   /* skip C comment-start */
-   if (s[0] == '/' && (s[1] == '*' || s[1] == '/'))
-   {
-   s = skipwhite(s + 2);
-   if (*skipwhite(s) == NUL
-   && lnum + 1 < (linenr_T)get_vim_var_nr(VV_FOLDEND))
-   {
-   s = skipwhite(ml_get(lnum + 1));
-   if (*s == '*')
-   s = skipwhite(s + 1);
-   }
-   }
-   count = (long)(foldend - foldstart + 1);
-   txt = NGETTEXT("+-%s%3ld line: ", "+-%s%3ld lines: ", count);
-   r = alloc(STRLEN(txt)
-   + STRLEN(dashes)// for %s
-   + 20// for %3ld
-   + STRLEN(s));   // concatenated
-   if (r != NULL)
-   {
-   sprintf((char *)r, txt, dashes, count);
-   len = (int)STRLEN(r);
-   STRCAT(r, s);
-   /* remove 'foldmarker' and 'commentstring' */
-   foldtext_cleanup(r + len);
-   rettv->vval.v_string = r;
-   }
- }
- #endif
- }
- 
- /*
-  * "foldtextresult(lnum)" function
-  */
- static void
- f_foldtextresult(typval_T *argvars UNUSED, typval_T *rettv)
- {
- #ifdef FEAT_FOLDING
- linenr_T  lnum;
- char_u*text;
- char_ubuf[FOLD_TEXT_LEN];
- foldinfo_T  foldinfo;
- int   fold_count;
- static intentered = FALSE;
- #endif
- 
- rettv->v_type = VAR_STRING;
- rettv->vval.v_string = NULL;
- #ifdef FEAT_FOLDING
- if (entered)
-   return; /* reject recursive use */
- entered = TRUE;
- 
- lnum = tv_get_lnum(argvars);
- /* treat illegal types and illegal string 

Patch 8.1.1959

2019-09-01 Fir de Conversatie Bram Moolenaar


Patch 8.1.1959
Problem:When using "firstline" in popup window text may jump when
redrawing it. (Nick Jensen)
Solution:   Set 'scrolloff' to zero in a popup window. (closes #4882)
Files:  src/popupwin.c, src/testdir/test_popupwin.vim,
src/testdir/dumps/Test_popupwin_scroll_5.dump,
src/testdir/dumps/Test_popupwin_scroll_6.dump


*** ../vim-8.1.1958/src/popupwin.c  2019-08-30 22:07:55.950547106 +0200
--- src/popupwin.c  2019-09-01 17:32:41.034371729 +0200
***
*** 1687,1697 
buf->b_p_swf = FALSE;   // no swap file
buf->b_p_bl = FALSE;// unlisted buffer
buf->b_locked = TRUE;
-   wp->w_p_wrap = TRUE;// 'wrap' is default on
  
// Avoid that 'buftype' is reset when this buffer is entered.
buf->b_p_initialized = TRUE;
  }
  
  if (tp != NULL)
  {
--- 1687,1698 
buf->b_p_swf = FALSE;   // no swap file
buf->b_p_bl = FALSE;// unlisted buffer
buf->b_locked = TRUE;
  
// Avoid that 'buftype' is reset when this buffer is entered.
buf->b_p_initialized = TRUE;
  }
+ wp->w_p_wrap = TRUE;  // 'wrap' is default on
+ wp->w_p_so = 0;   // 'scrolloff' zero
  
  if (tp != NULL)
  {
*** ../vim-8.1.1958/src/testdir/test_popupwin.vim   2019-09-01 
15:26:20.043537901 +0200
--- src/testdir/test_popupwin.vim   2019-09-01 17:36:59.884844381 +0200
***
*** 371,376 
--- 371,394 
call popup_close(winid)
  endfunc
  
+ func Test_popup_noscrolloff()
+   set scrolloff=5
+   let winid = popup_create(['xxx']->repeat(50), #{
+   \ maxheight: 5,
+   \ firstline: 11,
+   \ })
+   redraw
+   call assert_equal(11, popup_getoptions(winid).firstline)
+   call assert_equal(11, popup_getpos(winid).firstline)
+ 
+   call popup_setoptions(winid, #{firstline: 0})
+   call win_execute(winid, "normal! \")
+   call assert_equal(0, popup_getoptions(winid).firstline)
+   call assert_equal(10, popup_getpos(winid).firstline)
+ 
+   call popup_close(winid)
+ endfunc
+ 
  func Test_popup_drag()
CheckScreendump
  
***
*** 1019,1032 
" global/buffer-local
setlocal path=/there
" global/window-local
!   setlocal scrolloff=9
  
let winid = popup_create('hello', {})
call assert_equal(0, getwinvar(winid, ''))
call assert_equal(1, getwinvar(winid, ''))
call assert_equal('', getwinvar(winid, ''))
call assert_equal(:path, getwinvar(winid, ''))
!   call assert_equal(:scrolloff, getwinvar(winid, ''))
  
call popup_close(winid)
bwipe
--- 1037,1054 
" global/buffer-local
setlocal path=/there
" global/window-local
!   setlocal statusline=2
  
let winid = popup_create('hello', {})
call assert_equal(0, getwinvar(winid, ''))
call assert_equal(1, getwinvar(winid, ''))
call assert_equal('', getwinvar(winid, ''))
call assert_equal(:path, getwinvar(winid, ''))
!   call assert_equal(:statusline, getwinvar(winid, ''))
! 
!   " 'scrolloff' is reset to zero
!   call assert_equal(5, )
!   call assert_equal(0, getwinvar(winid, ''))
  
call popup_close(winid)
bwipe
***
*** 1713,1718 
--- 1735,1741 
call VerifyScreenDump(buf, 'Test_popupwin_scroll_4', {})
  
call term_sendkeys(buf, ":call popup_setoptions(winid, 
#{scrollbarhighlight: 'ScrollBar', thumbhighlight: 'ScrollThumb', firstline: 
5})\")
+   " this scrolls two lines (half the window height)
call term_sendkeys(buf, ":call ScrollUp()\")
call VerifyScreenDump(buf, 'Test_popupwin_scroll_5', {})
  
*** ../vim-8.1.1958/src/testdir/dumps/Test_popupwin_scroll_5.dump   
2019-08-30 17:34:04.380050974 +0200
--- src/testdir/dumps/Test_popupwin_scroll_5.dump   2019-09-01 
17:32:54.014295647 +0200
***
*** 1,10 
  

Patch 8.1.1958

2019-09-01 Fir de Conversatie Bram Moolenaar


Patch 8.1.1958
Problem:Old style comments taking up space.
Solution:   Change to new style comments.
Files:  src/vim.h


*** ../vim-8.1.1957/src/vim.h   2019-08-27 22:48:12.741480663 +0200
--- src/vim.h   2019-09-01 16:14:58.013294489 +0200
***
*** 21,29 
  # include "vimio.h"
  #endif
  
! /*  the header file puzzle (ca. 50-100 pieces) = */
  
! #ifdef HAVE_CONFIG_H  /* GNU autoconf (or something else) was here */
  # include "auto/config.h"
  # define HAVE_PATHDEF
  
--- 21,29 
  # include "vimio.h"
  #endif
  
! //  the header file puzzle: order matters =
  
! #ifdef HAVE_CONFIG_H  // GNU autoconf (or something else) was here
  # include "auto/config.h"
  # define HAVE_PATHDEF
  
***
*** 47,68 
  #  undef HAVE_FCHDIR
  # endif
  
! /* We may need to define the uint32_t on non-Unix system, but using the same
!  * identifier causes conflicts.  Therefore use UINT32_T. */
  # define UINT32_TYPEDEF uint32_t
  #endif
  
  #if !defined(UINT32_TYPEDEF)
! # if defined(uint32_t)  /* this doesn't catch typedefs, unfortunately */
  #  define UINT32_TYPEDEF uint32_t
  # else
!   /* Fall back to assuming unsigned int is 32 bit.  If this is wrong then the
!* test in blowfish.c will fail. */
  #  define UINT32_TYPEDEF unsigned int
  # endif
  #endif
  
! /* user ID of root is usually zero, but not for everybody */
  #ifdef __TANDEM
  # ifndef _TANDEM_SOURCE
  #  define _TANDEM_SOURCE
--- 47,68 
  #  undef HAVE_FCHDIR
  # endif
  
! // We may need to define the uint32_t on non-Unix system, but using the same
! // identifier causes conflicts.  Therefore use UINT32_T.
  # define UINT32_TYPEDEF uint32_t
  #endif
  
  #if !defined(UINT32_TYPEDEF)
! # if defined(uint32_t)  // this doesn't catch typedefs, unfortunately
  #  define UINT32_TYPEDEF uint32_t
  # else
!   // Fall back to assuming unsigned int is 32 bit.  If this is wrong then the
!   // test in blowfish.c will fail.
  #  define UINT32_TYPEDEF unsigned int
  # endif
  #endif
  
! // user ID of root is usually zero, but not for everybody
  #ifdef __TANDEM
  # ifndef _TANDEM_SOURCE
  #  define _TANDEM_SOURCE
***
*** 84,90 
  #if defined(MACOS_X_DARWIN) && !defined(MACOS_X)
  # define MACOS_X
  #endif
! /* Unless made through the Makefile enforce GUI on Mac */
  #if defined(MACOS_X) && !defined(HAVE_CONFIG_H)
  # define UNIX
  # define FEAT_GUI_MAC
--- 84,90 
  #if defined(MACOS_X_DARWIN) && !defined(MACOS_X)
  # define MACOS_X
  #endif
! // Unless made through the Makefile enforce GUI on Mac
  #if defined(MACOS_X) && !defined(HAVE_CONFIG_H)
  # define UNIX
  # define FEAT_GUI_MAC
***
*** 96,115 
  || defined(FEAT_GUI_MAC) \
  || defined(FEAT_GUI_MSWIN) \
  || defined(FEAT_GUI_PHOTON)
! # define FEAT_GUI_ENABLED  /* also defined with NO_X11_INCLUDES */
  # if !defined(FEAT_GUI) && !defined(NO_X11_INCLUDES)
  #  define FEAT_GUI
  # endif
  #endif
  
! /* Check support for rendering options */
  #ifdef FEAT_GUI
  # if defined(FEAT_DIRECTX)
  #  define FEAT_RENDER_OPTIONS
  # endif
  #endif
  
! /* Visual Studio 2005 has 'deprecated' many of the standard CRT functions */
  #if _MSC_VER >= 1400
  # define _CRT_SECURE_NO_DEPRECATE
  # define _CRT_NONSTDC_NO_DEPRECATE
--- 96,115 
  || defined(FEAT_GUI_MAC) \
  || defined(FEAT_GUI_MSWIN) \
  || defined(FEAT_GUI_PHOTON)
! # define FEAT_GUI_ENABLED  // also defined with NO_X11_INCLUDES
  # if !defined(FEAT_GUI) && !defined(NO_X11_INCLUDES)
  #  define FEAT_GUI
  # endif
  #endif
  
! // Check support for rendering options
  #ifdef FEAT_GUI
  # if defined(FEAT_DIRECTX)
  #  define FEAT_RENDER_OPTIONS
  # endif
  #endif
  
! // Visual Studio 2005 has 'deprecated' many of the standard CRT functions
  #if _MSC_VER >= 1400
  # define _CRT_SECURE_NO_DEPRECATE
  # define _CRT_NONSTDC_NO_DEPRECATE
***
*** 124,131 
  #endif
  
  #ifdef AMIGA
!   /* Be conservative about sizeof(int). It could be 4 too. */
! # ifndef FEAT_GUI_GTK /* avoid problems when generating prototypes */
  #  ifdef __GNUC__
  #   define VIM_SIZEOF_INT 4
  #  else
--- 124,131 
  #endif
  
  #ifdef AMIGA
!   // Be conservative about sizeof(int). It could be 4 too.
! # ifndef FEAT_GUI_GTK // avoid problems when generating prototypes
  #  ifdef __GNUC__
  #   define VIM_SIZEOF_INT 4
  #  else
***
*** 156,169 
  # endif
  #endif
  
! /* +x11 is only enabled when it's both available and wanted. */
  #if defined(HAVE_X11) && defined(WANT_X11)
  # define FEAT_X11
  #endif
  
  #ifdef NO_X11_INCLUDES
! /* In os_mac_conv.c and os_macosx.m NO_X11_INCLUDES is defined to avoid
!  * X11 headers.  Disable all X11 related things to avoid conflicts. */
  # ifdef FEAT_X11
  #  undef FEAT_X11
  # endif
--- 156,169 
  # endif
  #endif
  
! // +x11 is only enabled when it's both available and wanted.
  #if defined(HAVE_X11) && defined(WANT_X11)
  # define FEAT_X11
  #endif
  

Patch 8.1.1957

2019-09-01 Fir de Conversatie Bram Moolenaar


Patch 8.1.1957
Problem:More code can be moved to evalvars.c.
Solution:   Move code to where it fits better. (Yegappan Lakshmanan,
closes #4883)
Files:  src/eval.c, src/evalvars.c, src/ex_getln.c, src/globals.h,
src/if_py_both.h, src/proto/eval.pro, src/proto/evalvars.pro,
src/proto/ex_getln.pro, src/proto/scriptfile.pro,
src/scriptfile.c, src/session.c, src/viminfo.c


*** ../vim-8.1.1956/src/eval.c  2019-08-30 15:46:27.188906163 +0200
--- src/eval.c  2019-09-01 15:46:52.568427240 +0200
***
*** 38,46 
  
  static int echo_attr = 0;   /* attributes used for ":echo" */
  
- /* The names of packages that once were loaded are remembered. */
- static garray_T   ga_loaded = {0, 0, sizeof(char_u *), 4, NULL};
- 
  /*
   * Info used by a ":for" loop.
   */
--- 38,43 
***
*** 156,163 
  free_scriptnames();
  free_locales();
  
! /* autoloaded script names */
! ga_clear_strings(_loaded);
  
  // unreferenced lists and dicts
  (void)garbage_collect(FALSE);
--- 153,160 
  free_scriptnames();
  free_locales();
  
! // autoloaded script names
! free_autoload_scriptnames();
  
  // unreferenced lists and dicts
  (void)garbage_collect(FALSE);
***
*** 167,406 
  }
  #endif
  
- static lval_T *redir_lval = NULL;
- #define EVALCMD_BUSY (redir_lval == (lval_T *)_lval)
- static garray_T redir_ga; /* only valid when redir_lval is not NULL */
- static char_u *redir_endp = NULL;
- static char_u *redir_varname = NULL;
- 
- /*
-  * Start recording command output to a variable
-  * When "append" is TRUE append to an existing variable.
-  * Returns OK if successfully completed the setup.  FAIL otherwise.
-  */
- int
- var_redir_start(char_u *name, int append)
- {
- int   save_emsg;
- int   err;
- typval_T  tv;
- 
- /* Catch a bad name early. */
- if (!eval_isnamec1(*name))
- {
-   emsg(_(e_invarg));
-   return FAIL;
- }
- 
- /* Make a copy of the name, it is used in redir_lval until redir ends. */
- redir_varname = vim_strsave(name);
- if (redir_varname == NULL)
-   return FAIL;
- 
- redir_lval = ALLOC_CLEAR_ONE(lval_T);
- if (redir_lval == NULL)
- {
-   var_redir_stop();
-   return FAIL;
- }
- 
- /* The output is stored in growarray "redir_ga" until redirection ends. */
- ga_init2(_ga, (int)sizeof(char), 500);
- 
- /* Parse the variable name (can be a dict or list entry). */
- redir_endp = get_lval(redir_varname, NULL, redir_lval, FALSE, FALSE, 0,
-FNE_CHECK_START);
- if (redir_endp == NULL || redir_lval->ll_name == NULL || *redir_endp != 
NUL)
- {
-   clear_lval(redir_lval);
-   if (redir_endp != NULL && *redir_endp != NUL)
-   /* Trailing characters are present after the variable name */
-   emsg(_(e_trailing));
-   else
-   emsg(_(e_invarg));
-   redir_endp = NULL;  /* don't store a value, only cleanup */
-   var_redir_stop();
-   return FAIL;
- }
- 
- /* check if we can write to the variable: set it to or append an empty
-  * string */
- save_emsg = did_emsg;
- did_emsg = FALSE;
- tv.v_type = VAR_STRING;
- tv.vval.v_string = (char_u *)"";
- if (append)
-   set_var_lval(redir_lval, redir_endp, , TRUE, FALSE, (char_u *)".");
- else
-   set_var_lval(redir_lval, redir_endp, , TRUE, FALSE, (char_u *)"=");
- clear_lval(redir_lval);
- err = did_emsg;
- did_emsg |= save_emsg;
- if (err)
- {
-   redir_endp = NULL;  /* don't store a value, only cleanup */
-   var_redir_stop();
-   return FAIL;
- }
- 
- return OK;
- }
- 
- /*
-  * Append "value[value_len]" to the variable set by var_redir_start().
-  * The actual appending is postponed until redirection ends, because the value
-  * appended may in fact be the string we write to, changing it may cause freed
-  * memory to be used:
-  *   :redir => foo
-  *   :let foo
-  *   :redir END
-  */
- void
- var_redir_str(char_u *value, int value_len)
- {
- int   len;
- 
- if (redir_lval == NULL)
-   return;
- 
- if (value_len == -1)
-   len = (int)STRLEN(value);   /* Append the entire string */
- else
-   len = value_len;/* Append only "value_len" characters */
- 
- if (ga_grow(_ga, len) == OK)
- {
-   mch_memmove((char *)redir_ga.ga_data + redir_ga.ga_len, value, len);
-   redir_ga.ga_len += len;
- }
- else
-   var_redir_stop();
- }
- 
- /*
-  * Stop redirecting command output to a variable.
-  * Frees the allocated memory.
-  */
- void
- var_redir_stop(void)
- {
- typval_T  tv;
- 
- if (EVALCMD_BUSY)
- {
-   redir_lval = NULL;
-   return;
- }
- 
- if (redir_lval != NULL)
- {
-  

Patch 8.1.1956

2019-09-01 Fir de Conversatie Bram Moolenaar


Patch 8.1.1956
Problem:Screenshot tests may use a different encoding. (Dominique Pelle)
Solution:   Always set 'encoding' to "utf-8" when running Vim in a terminal.
(closes #4884)
Files:  src/testdir/shared.vim, src/testdir/test_popupwin.vim,
src/testdir/dumps/Test_popupwin_behind.dump


*** ../vim-8.1.1955/src/testdir/shared.vim  2019-08-31 17:48:16.725154231 
+0200
--- src/testdir/shared.vim  2019-09-01 15:22:26.852527774 +0200
***
*** 278,283 
--- 278,286 
let cmd = substitute(cmd, '-u NONE', '--clean', '')
let cmd = substitute(cmd, '--not-a-term', '', '')
  
+   " Force using utf-8, Vim may pick up something else from the environment.
+   let cmd ..= ' --cmd "set enc=utf8" '
+ 
" Optionally run Vim under valgrind
" let cmd = 'valgrind --tool=memcheck --leak-check=yes --num-callers=25 
--log-file=valgrind ' . cmd
  
*** ../vim-8.1.1955/src/testdir/test_popupwin.vim   2019-09-01 
14:45:23.757964939 +0200
--- src/testdir/test_popupwin.vim   2019-09-01 15:12:05.963163582 +0200
***
*** 1378,1384 
" | |
" +-+
let lines =<< trim END
- only 
  split
  vsplit
  let info_window1 = getwininfo()[0]
--- 1378,1383 
***
*** 1649,1659 
CheckFeature timers
CheckScreendump
  
!   call writefile([
!   \ "call setline(1, range(1, 20))",
!   \ "hi Notification ctermbg=lightblue",
!   \ "call popup_notification('first notification', {})",
!   \], 'XtestNotifications')
let buf = RunVimInTerminal('-S XtestNotifications', #{rows: 10})
call VerifyScreenDump(buf, 'Test_popupwin_notify_01', {})
  
--- 1648,1659 
CheckFeature timers
CheckScreendump
  
!   let lines =<< trim END
!   call setline(1, range(1, 20))
!   hi Notification ctermbg=lightblue
!   call popup_notification('first notification', {})
!   END
!   call writefile(lines, 'XtestNotifications')
let buf = RunVimInTerminal('-S XtestNotifications', #{rows: 10})
call VerifyScreenDump(buf, 'Test_popupwin_notify_01', {})
  
*** ../vim-8.1.1955/src/testdir/dumps/Test_popupwin_behind.dump 2019-06-02 
14:11:51.865021060 +0200
--- src/testdir/dumps/Test_popupwin_behind.dump 2019-09-01 15:08:53.003982712 
+0200
***
*** 7,10 
  |~+0#4040ff13&| @34|l+0#001#ffd7ff255|i|n|e|4| +0#4040ff13#ff0@33
  |~| @73
  |[+1#000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1
! |A+0&&|l|r|e|a|d|y| |o|n|l|y| |o|n|e| |w|i|n|d|o|w| @51
--- 7,10 
  |~+0#4040ff13&| @34|l+0#001#ffd7ff255|i|n|e|4| +0#4040ff13#ff0@33
  |~| @73
  |[+1#000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1
! | +0&&@74
*** ../vim-8.1.1955/src/version.c   2019-09-01 14:45:23.757964939 +0200
--- src/version.c   2019-09-01 15:08:45.080016336 +0200
***
*** 763,764 
--- 763,766 
  {   /* Add new patch number below this line */
+ /**/
+ 1956,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
159. You get excited whenever discussing your hard drive.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201909011326.x81DQuJQ024482%40masaka.moolenaar.net.


Patch 8.1.1955

2019-09-01 Fir de Conversatie Bram Moolenaar


Patch 8.1.1955
Problem:Tests contain typos.
Solution:   Correct the typos. (Dominique Pelle)
Files:  src/testdir/popupbounce.vim, src/testdir/runtest.vim,
src/testdir/screendump.vim, src/testdir/test49.vim,
src/testdir/test_autocmd.vim, src/testdir/test_cindent.vim,
src/testdir/test_const.vim, src/testdir/test_popupwin.vim,
src/testdir/test_quickfix.vim, src/testdir/test_search.vim,
src/testdir/test_tabpage.vim, src/testdir/test_tcl.vim


*** ../vim-8.1.1954/src/testdir/popupbounce.vim 2019-06-10 21:23:52.363724122 
+0200
--- src/testdir/popupbounce.vim 2019-09-01 14:36:29.848231705 +0200
***
*** 6,12 
  "./vim --clean -S testdir/popupbounce.vim main.c
  "gprof vim gmon.out | vim -
  
! " using line contination
  set nocp
  
  " don't switch screens when quitting, so we can read the frames/sec
--- 6,12 
  "./vim --clean -S testdir/popupbounce.vim main.c
  "gprof vim gmon.out | vim -
  
! " using line continuation
  set nocp
  
  " don't switch screens when quitting, so we can read the frames/sec
*** ../vim-8.1.1954/src/testdir/runtest.vim 2019-08-31 17:48:16.725154231 
+0200
--- src/testdir/runtest.vim 2019-09-01 14:36:29.848231705 +0200
***
*** 349,355 
\ 'Test_terminal_scrollback()',
\ 'Test_terminal_split_quit()',
\ 'Test_terminal_termwinkey()',
!   \ 'Test_terminal_termwinsize_mininmum()',
\ 'Test_terminal_termwinsize_option_fixed()',
\ 'Test_terminal_termwinsize_option_zero()',
\ 'Test_terminal_tmap()',
--- 349,355 
\ 'Test_terminal_scrollback()',
\ 'Test_terminal_split_quit()',
\ 'Test_terminal_termwinkey()',
!   \ 'Test_terminal_termwinsize_minimum()',
\ 'Test_terminal_termwinsize_option_fixed()',
\ 'Test_terminal_termwinsize_option_zero()',
\ 'Test_terminal_tmap()',
***
*** 395,401 
  
" Repeat a flaky test.  Give up when:
" - it fails again with the same message
!   " - it fails five times (with a different mesage)
if len(v:errors) > 0
  \ && (index(s:flaky_tests, s:test) >= 0
  \  || v:errors[0] =~ s:flaky_errors_re)
--- 395,401 
  
" Repeat a flaky test.  Give up when:
" - it fails again with the same message
!   " - it fails five times (with a different message)
if len(v:errors) > 0
  \ && (index(s:flaky_tests, s:test) >= 0
  \  || v:errors[0] =~ s:flaky_errors_re)
*** ../vim-8.1.1954/src/testdir/screendump.vim  2019-06-23 00:49:50.985715087 
+0200
--- src/testdir/screendump.vim  2019-09-01 14:36:29.848231705 +0200
***
*** 24,30 
let reference = 'dumps/' . a:filename . '.dump'
let testfile = 'failed/' . a:filename . '.dump'
  
!   " Redraw to execut the code that updates the screen.  Otherwise we get the
" text and attributes only from the internal buffer.
redraw
  
--- 24,30 
let reference = 'dumps/' . a:filename . '.dump'
let testfile = 'failed/' . a:filename . '.dump'
  
!   " Redraw to execute the code that updates the screen.  Otherwise we get the
" text and attributes only from the internal buffer.
redraw
  
*** ../vim-8.1.1954/src/testdir/test49.vim  2019-05-24 17:32:57.351719237 
+0200
--- src/testdir/test49.vim  2019-09-01 14:36:29.848231705 +0200
***
*** 521,527 
  "
  " Create a script that consists of the body of the function a:funcname.
  " Replace any ":return" by a ":finish", any argument variable by a global
! " variable, and and every ":call" by a ":source" for the next following 
argument
  " in the variable argument list.  This function is useful if similar tests are
  " to be made for a ":return" from a function call or a ":finish" in a script
  " file.
--- 521,527 
  "
  " Create a script that consists of the body of the function a:funcname.
  " Replace any ":return" by a ":finish", any argument variable by a global
! " variable, and every ":call" by a ":source" for the next following argument
  " in the variable argument list.  This function is useful if similar tests are
  " to be made for a ":return" from a function call or a ":finish" in a script
  " file.
*** ../vim-8.1.1954/src/testdir/test_autocmd.vim2019-08-14 
21:12:00.977833219 +0200
--- src/testdir/test_autocmd.vim2019-09-01 14:36:29.848231705 +0200
***
*** 1091,1097 
call assert_equal(g:opt[0], g:opt[1])
  
  
!   " 33: Test autocomands when an option value is converted internally.
noa set backspace=1 " Reset global and local value (without triggering 
autocmd)
let g:options=[['backspace', 'indent,eol', 'indent,eol', 'indent,eol', '2', 
'global', 'set']]
set backspace=2
--- 1091,1097 
call assert_equal(g:opt[0], g:opt[1])
  
  
!   " 33: Test autocommands when an option value is converted internally.
noa set backspace=1 " Reset global and local value 

Re: [patch] fixed typos in tests

2019-09-01 Fir de Conversatie Bram Moolenaar


Dominique wrote:

> Attached patch fixes typos in tests.

Thanks!

> One of them in a typo in the list of flaky test names
> So 'Test_terminal_termwinsize_minimum'
> was not marked as flaky.  If it did not fail recently,
> perhaps it can be removed from the list of flaky tests?

Well, it's there because it failed some time ago.  It doesn't hurt
anyway.  I had been considering assuming all tests can be flaky.  The
main reason not to do that is that running tests when they fail makes it
slow to try out fixing them.

-- 
hundred-and-one symptoms of being an internet addict:
156. You forget your friend's name but not her e-mail address.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201909011246.x81CkI0A006924%40masaka.moolenaar.net.


Re: Patch 8.1.1952

2019-09-01 Fir de Conversatie 'Andy Wokula' via vim_dev

Am 31.08.2019 um 21:07 schrieb Bram Moolenaar:


Andy Wokula wrote:


Am 31.08.2019 um 19:14 schrieb Bram Moolenaar:

! <  *globpath()*
globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]])
Perform glob() on all directories in {path} and concatenate
the results.  Example: >
***
*** 5696,5701 
--- 5722,5731 

+   GetExpr()->globpath()


You think, to be consistent with glob(), the base must be passed as
the *second* argument?  I wonder what your reason is here, it's quite
unexpected.


In a chain what gets passed is the object that is being processed.
In this case I would say the expression is processed, while the path is
a parameter indicating how to process the expression.

eval GetPattern()->glob()->ListResults()
eval GetPattern()->globpath()->ListResults()

Did you expect that with -> the base is always passed as the first
argument?  That doesn't work well for some existing functions.


It works well with globpath(), that's why it's unexpected.
Is there some other rule which prevents users from looking up :help for every 
function?
Or are there just a few exceptions?

Rules for example
- base is passed as first argument
- doesn't work well for: printf(), setline(), strftime(), append(), ... other 
easy to guess functions
- "exceptions", base anyway passed as second argument: globpath(), ...

--
Andy

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups "vim_dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/5D6B7E28.6010907%40yahoo.de.


[patch] fixed typos in tests

2019-09-01 Fir de Conversatie Dominique Pellé
Attached patch fixes typos in tests.

One of them in a typo in the list of flaky test names
So 'Test_terminal_termwinsize_minimum'
was not marked as flaky.  If it did not fail recently,
perhaps it can be removed from the list of flaky tests?

Regards
Dominique

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAON-T_hDvTyXYwXuN22ZaYnSw4t%3DDh4gN0N1vrZYbX8bJV4j4A%40mail.gmail.com.
diff --git a/src/testdir/popupbounce.vim b/src/testdir/popupbounce.vim
index 2d1345bfd..b9f7bd179 100644
--- a/src/testdir/popupbounce.vim
+++ b/src/testdir/popupbounce.vim
@@ -6,7 +6,7 @@
 "./vim --clean -S testdir/popupbounce.vim main.c
 "gprof vim gmon.out | vim -
 
-" using line contination
+" using line continuation
 set nocp
 
 " don't switch screens when quitting, so we can read the frames/sec
diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim
index db6dcd709..5623dc819 100644
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -349,7 +349,7 @@ let s:flaky_tests = [
   \ 'Test_terminal_scrollback()',
   \ 'Test_terminal_split_quit()',
   \ 'Test_terminal_termwinkey()',
-  \ 'Test_terminal_termwinsize_mininmum()',
+  \ 'Test_terminal_termwinsize_minimum()',
   \ 'Test_terminal_termwinsize_option_fixed()',
   \ 'Test_terminal_termwinsize_option_zero()',
   \ 'Test_terminal_tmap()',
@@ -395,7 +395,7 @@ for s:test in sort(s:tests)
 
   " Repeat a flaky test.  Give up when:
   " - it fails again with the same message
-  " - it fails five times (with a different mesage)
+  " - it fails five times (with a different message)
   if len(v:errors) > 0
 \ && (index(s:flaky_tests, s:test) >= 0
 \  || v:errors[0] =~ s:flaky_errors_re)
diff --git a/src/testdir/screendump.vim b/src/testdir/screendump.vim
index cc1c239da..d04d96d98 100644
--- a/src/testdir/screendump.vim
+++ b/src/testdir/screendump.vim
@@ -24,7 +24,7 @@ func VerifyScreenDump(buf, filename, options, ...)
   let reference = 'dumps/' . a:filename . '.dump'
   let testfile = 'failed/' . a:filename . '.dump'
 
-  " Redraw to execut the code that updates the screen.  Otherwise we get the
+  " Redraw to execute the code that updates the screen.  Otherwise we get the
   " text and attributes only from the internal buffer.
   redraw
 
diff --git a/src/testdir/test49.vim b/src/testdir/test49.vim
index 7393ec415..bd6051461 100644
--- a/src/testdir/test49.vim
+++ b/src/testdir/test49.vim
@@ -521,7 +521,7 @@ endfunction
 "
 " Create a script that consists of the body of the function a:funcname.
 " Replace any ":return" by a ":finish", any argument variable by a global
-" variable, and and every ":call" by a ":source" for the next following argument
+" variable, and every ":call" by a ":source" for the next following argument
 " in the variable argument list.  This function is useful if similar tests are
 " to be made for a ":return" from a function call or a ":finish" in a script
 " file.
diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim
index 9dc578e45..0979bb4a1 100644
--- a/src/testdir/test_autocmd.vim
+++ b/src/testdir/test_autocmd.vim
@@ -1091,7 +1091,7 @@ func Test_OptionSet()
   call assert_equal(g:opt[0], g:opt[1])
 
 
-  " 33: Test autocomands when an option value is converted internally.
+  " 33: Test autocommands when an option value is converted internally.
   noa set backspace=1 " Reset global and local value (without triggering autocmd)
   let g:options=[['backspace', 'indent,eol', 'indent,eol', 'indent,eol', '2', 'global', 'set']]
   set backspace=2
diff --git a/src/testdir/test_cindent.vim b/src/testdir/test_cindent.vim
index e12e45787..2cb3f24b7 100644
--- a/src/testdir/test_cindent.vim
+++ b/src/testdir/test_cindent.vim
@@ -815,7 +815,7 @@ func Test_cindent_1()
 }
  }
 
-  public: // <-- this was incoreectly indented before!!
+  public: // <-- this was incorectly indented before!!
  void testfall();
   protected:
  void testfall();
@@ -1780,7 +1780,7 @@ func Test_cindent_1()
   		}
   	}
 
-  	public: // <-- this was incoreectly indented before!!
+  	public: // <-- this was incorectly indented before!!
   	void testfall();
   	protected:
   	void testfall();
diff --git a/src/testdir/test_const.vim b/src/testdir/test_const.vim
index d93de72bd..55e4492bd 100644
--- a/src/testdir/test_const.vim
+++ b/src/testdir/test_const.vim
@@ -125,7 +125,7 @@ func Test_define_script_var_with_lock()
 unlet s:x
 endfunc
 
-func Test_descructuring_with_lock()
+func Test_destructuring_with_lock()
 const [a, b, c] =