[patch] doc fixes for Vim-8.2.3070

2021-06-27 Fir de Conversatie Dominique Pellé
Hi

Attached patch fixes a few typos in Vim-8.2.3070 doc.

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_h4%3Dzo91AvShuRmWnffzr7dBdfwNoCtCzFjJu9pXgHxLg%40mail.gmail.com.
diff --git a/runtime/doc/version6.txt b/runtime/doc/version6.txt
index abf154422..22a57aaa8 100644
--- a/runtime/doc/version6.txt
+++ b/runtime/doc/version6.txt
@@ -2696,7 +2696,7 @@ Multi-byte:
   double-wide character.
 - Overstrike mode for the cmdline replaced only the first byte of a multibyte
   character.
-- The cursor in Replace mode (also in the cmdline) was to small on a
+- The cursor in Replace mode (also in the cmdline) was too small on a
   double-wide character.
 - When a multibyte character contained a 0x80 byte, it didn't work (was using
   a CSI byte instead). (Muraoka Taro)
@@ -3546,7 +3546,7 @@ Added Simplified Chinese translation of the tutor. (Mendel L Chan)
 Added Russian keymap for yawerty keyboard.
 
 Added an explanation of using the vimrc file in the tutor.
-Changed tutor.vim to get the right encoding for the Taiwainese tutor.
+Changed tutor.vim to get the right encoding for the Taiwanese tutor.
 
 Added Russian tutor. (Andrey Kiselev)
 Added Polish tutor. (Mikolaj Machowski)
diff --git a/runtime/doc/version8.txt b/runtime/doc/version8.txt
index 313c38827..9ed74cc5b 100644
--- a/runtime/doc/version8.txt
+++ b/runtime/doc/version8.txt
@@ -35504,7 +35504,7 @@ Files:	Filelist, src/testdir/Make_all.mak, src/testdir/check.vim,
 src/testdir/test_xxd.vim
 
 Patch 8.1.1545
-Problem:When the screen is to small there is no message about that.
+Problem:When the screen is too small there is no message about that.
 (Daniel Hahler)
 Solution:   Do not use :cquit. (closes #4534)
 Files:	src/testdir/runtest.vim
@@ -41104,7 +41104,7 @@ Files:	src/buffer.c, src/testdir/test_popupwin.vim
 Patch 8.1.2419
 Problem:With a long file name the hit-enter prompt appears. (J. Lewis
 Muir)
-Solution:   When checking for text to wrap don't do this when outputing a CR.
+Solution:   When checking for text to wrap don't do this when outputting a CR.
 Files:	src/message.c, src/testdir/test_display.vim,
 src/testdir/dumps/Test_long_file_name_1.dump
 
diff --git a/runtime/doc/vim9.txt b/runtime/doc/vim9.txt
index e8d97a9c3..19c248521 100644
--- a/runtime/doc/vim9.txt
+++ b/runtime/doc/vim9.txt
@@ -1202,7 +1202,7 @@ In Vim9 script this has been made stricter.  In most places it works just as
 before, if the value used matches the expected type.  There will sometimes be
 an error, thus breaking backwards compatibility.  For example:
 - Using a number other than 0 or 1 where a boolean is expected.  *E1023*
-- Using a string value when setting a number options.
+- Using a string value when setting a number option.
 - Using a number where a string is expected.   *E1024*
 
 One consequence is that the item type of a list or dict given to map() must


Patch 8.2.3070

2021-06-27 Fir de Conversatie Bram Moolenaar


Patch 8.2.3070
Problem:Not enough testing for shell use.
Solution:   Add a bit more testing. (Yegappan Lakshmanan, closes #8469)
Files:  src/testdir/test_shell.vim, src/testdir/test_startup.vim


*** ../vim-8.2.3069/src/testdir/test_shell.vim  2021-06-27 12:07:12.71041 
+0200
--- src/testdir/test_shell.vim  2021-06-27 22:07:14.425296013 +0200
***
*** 5,13 
  source shared.vim
  
  func Test_shell_options()
!   " For each shell, the following options are checked:
!   " 'shellcmdflag', 'shellpipe', 'shellquote', 'shellredir', 'shellxescape',
!   " 'shellxquote'
let shells = []
if has('unix')
  let shells += [['sh', '-c', '2>&1| tee', '', '>%s 2>&1', '', ''],
--- 5,12 
  source shared.vim
  
  func Test_shell_options()
!   " The expected value of 'shellcmdflag', 'shellpipe', 'shellquote',
!   " 'shellredir', 'shellxescape', 'shellxquote' for the supported shells.
let shells = []
if has('unix')
  let shells += [['sh', '-c', '2>&1| tee', '', '>%s 2>&1', '', ''],
***
*** 39,44 
--- 38,45 
\ ['tcsh.exe', '-c', '>&', '', '>&', '"&|<>()@^', '"']]
endif
  
+   " start a new Vim instance with 'shell' set to each of the supported shells
+   " and check the default shell option settings
let after =<< trim END
  let l = [, , , ]
  let l += [, , ]
***
*** 51,56 
--- 52,58 
  endif
endfor
  
+   " Test shellescape() for each of the shells.
for e in shells
  exe 'set shell=' .. e[0]
  if e[0] =~# '.*csh$' || e[0] =~# '.*csh.exe$'
***
*** 62,69 
  endif
  call assert_equal(str1, shellescape("cmd \"arg1\" 'arg2' !%#"), e[0])
  call assert_equal(str2, shellescape("cmd \"arg1\" 'arg2' !%#", 1), e[0])
endfor
!   set shell&
call delete('Xtestout')
  endfunc
  
--- 64,83 
  endif
  call assert_equal(str1, shellescape("cmd \"arg1\" 'arg2' !%#"), e[0])
  call assert_equal(str2, shellescape("cmd \"arg1\" 'arg2' !%#", 1), e[0])
+ 
+ " Try running an external command with the shell.
+ if executable(e[0])
+   " set the shell options for the current 'shell'
+   let [, , , ,
+ \ , ] = e[1:6]
+   new
+   r !echo hello
+   call assert_equal('hello', substitute(getline(2), '\W', '', 'g'), e[0])
+   bwipe!
+ endif
endfor
!   set shell& shellcmdflag& shellpipe& shellquote&
!   set shellredir& shellxescape& shellxquote&
call delete('Xtestout')
  endfunc
  
***
*** 95,100 
--- 109,115 
call assert_match(': "#echo Hello#"', v)
  endfunc
  
+ " Test for the 'shellescape' option
  func Test_shellescape()
let save_shell = 
set shell=bash
***
*** 156,159 
--- 171,196 
call delete('Xlog')
  endfunc
  
+ " Test for using the shell set in the $SHELL environment variable
+ func Test_set_shell()
+   let after =<< trim [CODE]
+ call writefile([], "Xtestout")
+ quit!
+   [CODE]
+ 
+   if has('win32')
+ let $SHELL = 'C:\with space\cmd.exe'
+ let expected = '"C:\with space\cmd.exe"'
+   else
+ let $SHELL = '/bin/with space/sh'
+ let expected = '/bin/with\ space/sh'
+   endif
+ 
+   if RunVimPiped([], after, '', '')
+ let lines = readfile('Xtestout')
+ call assert_equal(expected, lines[0])
+   endif
+   call delete('Xtestout')
+ endfunc
+ 
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.3069/src/testdir/test_startup.vim2021-06-16 
10:59:32.622998987 +0200
--- src/testdir/test_startup.vim2021-06-27 22:07:14.425296013 +0200
***
*** 733,759 
call delete('Xtestout')
  endfunc
  
- func Test_set_shell()
-   let after =<< trim [CODE]
- call writefile([], "Xtestout")
- quit!
-   [CODE]
- 
-   if has('win32')
- let $SHELL = 'C:\with space\cmd.exe'
- let expected = '"C:\with space\cmd.exe"'
-   else
- let $SHELL = '/bin/with space/sh'
- let expected = '/bin/with\ space/sh'
-   endif
- 
-   if RunVimPiped([], after, '', '')
- let lines = readfile('Xtestout')
- call assert_equal(expected, lines[0])
-   endif
-   call delete('Xtestout')
- endfunc
- 
  func Test_progpath()
" Tests normally run with "./vim" or "../vim", these must have been expanded
" to a full path.
--- 733,738 
*** ../vim-8.2.3069/src/version.c   2021-06-27 22:03:28.649707714 +0200
--- src/version.c   2021-06-27 22:08:32.941152177 +0200
***
*** 757,758 
--- 757,760 
  {   /* Add new patch number below this line */
+ /**/
+ 3070,
  /**/

-- 
I started out with nothing, and I still have most of it.
-- Michael Davis -- "Tonight Show"

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\help me help AIDS victims -- 

Patch 8.2.3069

2021-06-27 Fir de Conversatie Bram Moolenaar


Patch 8.2.3069
Problem:Error messages are spread out.
Solution:   Move some error messages to errors.h.  Use clearer names.
Files:  src/errors.h, src/globals.h, src/arglist.c, src/buffer.c,
src/channel.c, src/eval.c, src/evalfunc.c, src/evalvars.c,
src/evalwindow.c, src/ex_cmds.c, src/ex_docmd.c, src/ex_getln.c,
src/filepath.c, src/fold.c, src/getchar.c, src/indent.c,
src/list.c, src/map.c, src/mark.c, src/normal.c, src/ops.c,
src/optionstr.c, src/popupwin.c, src/quickfix.c, src/spellfile.c,
src/textprop.c, src/typval.c, src/undo.c, src/userfunc.c,
src/vim9compile.c, src/window.c


*** ../vim-8.2.3068/src/errors.h2021-06-26 15:00:55.881276189 +0200
--- src/errors.h2021-06-27 21:59:49.030104138 +0200
***
*** 10,15 
--- 10,53 
   * Definition of error messages, sorted on error number.
   */
  
+ EXTERN char e_backslash_should_be_followed_by[]
+   INIT(= N_("E10: \\ should be followed by /, ? or &"));
+ #ifdef FEAT_CMDWIN
+ EXTERN char e_invalid_in_cmdline_window[]
+   INIT(= N_("E11: Invalid in command-line window;  executes, CTRL-C 
quits"));
+ #endif
+ EXTERN char e_command_not_allowed_from_vimrc_in_current_dir_or_tag_search[]
+   INIT(= N_("E12: Command not allowed from exrc/vimrc in current dir or 
tag search"));
+ EXTERN char e_file_exists[]
+   INIT(= N_("E13: File exists (add ! to override)"));
+ #ifdef FEAT_EVAL
+ EXTERN char e_invalid_expression_str[]
+   INIT(= N_("E15: Invalid expression: \"%s\""));
+ #endif
+ EXTERN char e_invalid_range[]
+   INIT(= N_("E16: Invalid range"));
+ #if defined(UNIX) || defined(FEAT_SYN_HL) || defined(FEAT_SPELL)
+ EXTERN char e_src_is_directory[]
+   INIT(= N_("E17: \"%s\" is a directory"));
+ #endif
+ #ifdef FEAT_EVAL
+ EXTERN char e_unexpected_characters_in_let[]
+   INIT(= N_("E18: Unexpected characters in :let"));
+ EXTERN char e_unexpected_characters_in_assignment[]
+   INIT(= N_("E18: Unexpected characters in assignment"));
+ #endif
+ EXTERN char e_mark_has_invalid_line_number[]
+   INIT(= N_("E19: Mark has invalid line number"));
+ EXTERN char e_mark_not_set[]
+   INIT(= N_("E20: Mark not set"));
+ EXTERN char e_cannot_make_changes_modifiable_is_off[]
+   INIT(= N_("E21: Cannot make changes, 'modifiable' is off"));
+ EXTERN char e_scripts_nested_too_deep[]
+   INIT(= N_("E22: Scripts nested too deep"));
+ EXTERN char e_no_alternate_file[]
+   INIT(= N_("E23: No alternate file"));
+ EXTERN char e_no_such_abbreviation[]
+   INIT(= N_("E24: No such abbreviation"));
  #ifdef FEAT_EVAL
  EXTERN char e_undefined_variable_str[]
INIT(= N_("E121: Undefined variable: %s"));
*** ../vim-8.2.3068/src/globals.h   2021-06-17 21:03:04.038634999 +0200
--- src/globals.h   2021-06-27 21:53:10.778805355 +0200
***
*** 1581,1591 
   */
  EXTERN char e_abort[] INIT(= N_("E470: Command aborted"));
  EXTERN char e_argreq[]INIT(= N_("E471: Argument required"));
- EXTERN char e_backslash[] INIT(= N_("E10: \\ should be followed by /, ? 
or &"));
- #ifdef FEAT_CMDWIN
- EXTERN char e_cmdwin[]INIT(= N_("E11: Invalid in command-line window; 
 executes, CTRL-C quits"));
- #endif
- EXTERN char e_curdir[]INIT(= N_("E12: Command not allowed from 
exrc/vimrc in current dir or tag search"));
  #ifdef FEAT_EVAL
  EXTERN char e_endif[] INIT(= N_("E171: Missing :endif"));
  EXTERN char e_catch[] INIT(= N_("E603: :catch without :try"));
--- 1581,1586 
***
*** 1598,1604 
  EXTERN char e_while[] INIT(= N_("E588: :endwhile without :while"));
  EXTERN char e_for[]   INIT(= N_("E588: :endfor without :for"));
  #endif
- EXTERN char e_exists[]INIT(= N_("E13: File exists (add ! to 
override)"));
  EXTERN char e_failed[]INIT(= N_("E472: Command failed"));
  #if defined(FEAT_GUI) && defined(FEAT_XFONTSET)
  EXTERN char e_fontset[]   INIT(= N_("E234: Unknown fontset: %s"));
--- 1593,1598 
***
*** 1618,1630 
  EXTERN char e_duparg2[]   INIT(= N_("E983: Duplicate argument: 
%s"));
  EXTERN char e_invargval[] INIT(= N_("E475: Invalid value for argument 
%s"));
  EXTERN char e_invargNval[]INIT(= N_("E475: Invalid value for argument %s: 
%s"));
- #ifdef FEAT_EVAL
- EXTERN char e_invexpr2[]  INIT(= N_("E15: Invalid expression: \"%s\""));
- #endif
- EXTERN char e_invrange[]  INIT(= N_("E16: Invalid range"));
- #if defined(UNIX) || defined(FEAT_SYN_HL) || defined(FEAT_SPELL)
- EXTERN char e_isadir2[]   INIT(= N_("E17: \"%s\" is a 
directory"));
- #endif
  #ifdef FEAT_SPELL
  EXTERN char e_no_spell[]  INIT(= N_("E756: Spell checking is not 
possible"));
  #endif
--- 1612,1617 
***
*** 1646,1657 
  EXTERN char e_loadlib[]   INIT(= N_("E370: Could not load library %s"));
  EXTERN char e_loadfunc[]  

Patch 8.2.3068

2021-06-27 Fir de Conversatie Bram Moolenaar


Patch 8.2.3068
Problem:Unicode tables are slightly outdated.
Solution:   Update the tables for Unicode release 13. (Christian Brabandt
closes #8430)
Files:  runtime/tools/unicode.vim, src/mbyte.c


*** ../vim-8.2.3067/runtime/tools/unicode.vim   2018-07-14 19:27:57.0 
+0200
--- runtime/tools/unicode.vim   2021-06-27 21:26:27.129681656 +0200
***
*** 7,13 
  " Usage: Vim -S 
  "
  " Author: Bram Moolenaar
! " Last Update: 2010 Jan 12
  
  " Parse lines of UnicodeData.txt.  Creates a list of lists in s:dataprops.
  func! ParseDataToProps()
--- 7,13 
  " Usage: Vim -S 
  "
  " Author: Bram Moolenaar
! " Last Update: 2020 Aug 24
  
  " Parse lines of UnicodeData.txt.  Creates a list of lists in s:dataprops.
  func! ParseDataToProps()
***
*** 195,200 
--- 195,207 
let end = -1
let ranges = []
let dataidx = 0
+   " Account for indentation differences between ambiguous and doublewidth
+   " table in mbyte.c
+   if a:pattern == 'A'
+ let spc = ''
+   else
+ let spc = "\t"
+   endif
for p in s:widthprops
  if p[1][0] =~ a:pattern
if p[0] =~ '\.\.'
***
*** 229,235 
  else
if start >= 0
  " produce previous range
! call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end))
if a:pattern == 'A'
  call add(s:ambitable, [start, end])
else
--- 236,242 
  else
if start >= 0
  " produce previous range
! call add(ranges, printf("%s{0x%04x, 0x%04x},", spc, start, end))
if a:pattern == 'A'
  call add(s:ambitable, [start, end])
else
***
*** 243,249 
  endif
endfor
if start >= 0
! call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end))
  if a:pattern == 'A'
call add(s:ambitable, [start, end])
  else
--- 250,256 
  endif
endfor
if start >= 0
! call add(ranges, printf("%s{0x%04x, 0x%04x},", spc, start, end))
  if a:pattern == 'A'
call add(s:ambitable, [start, end])
  else
***
*** 254,346 
" New buffer to put the result in.
new
exe "file " . a:tableName
!   call setline(1, "static struct interval " . a:tableName . "[] =")
!   call setline(2, "{")
call append('$', ranges)
call setline('$', getline('$')[:-2])  " remove last comma
!   call setline(line('$') + 1, "};")
wincmd p
  endfunc
  
! " Build the amoji width table in a new buffer.
! func! BuildEmojiTable(pattern, tableName)
!   let alltokens = []
!   let widthtokens = []
!   let lines = map(filter(filter(getline(1, '$'), 'v:val=~"^[1-9]"'), 
'v:val=~a:pattern'), 'matchstr(v:val,"^\\S\\+")')
!   for n in range(len(lines))
! let line = lines[n]
! let token = split(line, '\.\.')
! let first = ('0x' . token[0]) + 0
! if len(token) == 1
let last = first
  else
!   let last = ('0x' . token[1]) + 0
  endif
  
! let token = [first, last]
! if len(alltokens) > 0 && (token[0] - 1 == alltokens[-1][1])
!   let alltokens[-1][1] = token[1]
  else
!   call add(alltokens, token)
  endif
  
! " Characters below 1F000 may be considered single width traditionally,
! " making them double width causes problems.
! if first < 0x1f000
!   continue
! endif
  
- " exclude characters that are in the "ambiguous" or "doublewidth" table
- for ambi in s:ambitable
-   if first >= ambi[0] && first <= ambi[1]
-   let first = ambi[1] + 1
-   endif
-   if last >= ambi[0] && last <= ambi[1]
-   let last = ambi[0] - 1
-   endif
- endfor
- for double in s:doubletable
-   if first >= double[0] && first <= double[1]
-   let first = double[1] + 1
-   endif
-   if last >= double[0] && last <= double[1]
-   let last = double[0] - 1
-   endif
- endfor
  
! if first <= last
!   let token = [first, last]
!   if len(widthtokens) > 0 && (token[0] - 1 == widthtokens[-1][1])
!   let widthtokens[-1][1] = token[1]
!   else
!   call add(widthtokens, token)
!   endif
! endif
!   endfor
!   let allranges = map(alltokens, 'printf("\t{0x%04x, 0x%04x},", v:val[0], 
v:val[1])')
!   let widthranges = map(widthtokens, 'printf("\t{0x%04x, 0x%04x},", v:val[0], 
v:val[1])')
  
" New buffer to put the result in.
new
!   exe "file " . a:tableName . '_all'
!   call setline(1, "static struct interval " . a:tableName . "_all[] =")
!   call setline(2, "{")
call append('$', allranges)
call setline('$', getline('$')[:-2])  " remove last comma
!   call setline(line('$') + 1, "};")
wincmd p
  
" New buffer to put the result in.
new
!   exe "file " . a:tableName . '_width'
!   call setline(1, "static struct interval " . a:tableName . "_width[] =")
call setline(2, "{")
!   call append('$', widthranges)
 

Re: Patch 8.2.3067

2021-06-27 Fir de Conversatie Elimar Riesebieter
* Bram Moolenaar  [2021-06-27 19:05 +0200]:

> 
> Patch 8.2.3067
> Problem:Building fails with Athena. (Elimar Riesebieter)
> Solution:   Adjust #ifdefs and add the 'drop_file' feature.
> Files:  src/evalfunc.c, src/testing.c, src/testdir/test_gui.vim

Builds fine now :-)

Thanks for the quick response!

Elimar
-- 
  Do you smell something burning or is it me?

-- 
-- 
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/20210627174514.rwdxsy47pd6dtrxj%40toy.home.lxtec.de.


Re: Failure building 8.2.3066

2021-06-27 Fir de Conversatie Bram Moolenaar


Elimar Riesebieter wrote:

> Environment: Debian Sid
> Term: tmux
> Compiler: clang-12
> 
> 
> /usr/bin/ld: objects/testing.o: in function `f_test_gui_drop_files':
> ./src/vim-athena/testing.c:1311: undefined reference to `gui_handle_drop'
> clang: error: linker command failed with exit code 1 (use -v to see 
> invocation)
> link.sh: Linking failed

We need to use another #ifdef.  But then we also needs to know when
test_gui_drop_files() is working, thus we need a feature to check for.
Let's call it "drop_file".

-- 
A fine is a tax for doing wrong.  A tax is a fine for doing well.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\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/202106271705.15RH5f8B671990%40masaka.moolenaar.net.


Patch 8.2.3067

2021-06-27 Fir de Conversatie Bram Moolenaar


Patch 8.2.3067
Problem:Building fails with Athena. (Elimar Riesebieter)
Solution:   Adjust #ifdefs and add the 'drop_file' feature.
Files:  src/evalfunc.c, src/testing.c, src/testdir/test_gui.vim


*** ../vim-8.2.3066/src/evalfunc.c  2021-06-24 19:55:23.906419441 +0200
--- src/evalfunc.c  2021-06-27 18:57:51.566510005 +0200
***
*** 4578,4583 
--- 4578,4590 
0
  #endif
},
+   {"drop_file",
+ #ifdef HAVE_DROP_FILE
+   1
+ #else
+   0
+ #endif
+   },
{"emacs_tags",
  #ifdef FEAT_EMACS_TAGS
1
*** ../vim-8.2.3066/src/testing.c   2021-06-23 20:46:46.914256853 +0200
--- src/testing.c   2021-06-27 18:50:43.159321851 +0200
***
*** 1260,1266 
  void
  f_test_gui_drop_files(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
  {
! # ifdef FEAT_GUI
  int   row;
  int   col;
  int_u mods;
--- 1260,1266 
  void
  f_test_gui_drop_files(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
  {
! #if defined(HAVE_DROP_FILE)
  int   row;
  int   col;
  int_u mods;
*** ../vim-8.2.3066/src/testdir/test_gui.vim2021-06-23 20:46:46.914256853 
+0200
--- src/testdir/test_gui.vim2021-06-27 19:01:49.966051240 +0200
***
*** 1160,1171 
--- 1160,1175 
  
  " Test for dropping files into a window in GUI
  func DropFilesInCmdLine()
+   CheckFeature drop_file
+ 
call feedkeys(":\"", 'L')
call test_gui_drop_files(['a.c', 'b.c'], , 1, 0)
call feedkeys("\", 'L')
  endfunc
  
  func Test_gui_drop_files()
+   CheckFeature drop_file
+ 
call assert_fails('call test_gui_drop_files(1, 1, 1, 0)', 'E474:')
call assert_fails('call test_gui_drop_files(["x"], "", 1, 0)', 'E474:')
call assert_fails('call test_gui_drop_files(["x"], 1, "", 0)', 'E474:')
*** ../vim-8.2.3066/src/version.c   2021-06-27 16:29:50.119042807 +0200
--- src/version.c   2021-06-27 19:02:29.517970702 +0200
***
*** 757,758 
--- 757,760 
  {   /* Add new patch number below this line */
+ /**/
+ 3067,
  /**/

-- 
It was recently discovered that research causes cancer in rats.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\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/202106271705.15RH5g1V671996%40masaka.moolenaar.net.


Failure building 8.2.3066

2021-06-27 Fir de Conversatie Elimar Riesebieter
Environment: Debian Sid
Term: tmux
Compiler: clang-12


/usr/bin/ld: objects/testing.o: in function `f_test_gui_drop_files':
./src/vim-athena/testing.c:1311: undefined reference to `gui_handle_drop'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
link.sh: Linking failed


Thanks
Elimar
-- 
  Never make anything simple and efficient when a way
  can be found to make it complex and wonderful ;-)

-- 
-- 
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/20210627161104.z2fum3kpu7etfwxy%40toy.home.lxtec.de.


Patch 8.2.3066

2021-06-27 Fir de Conversatie Bram Moolenaar


Patch 8.2.3066
Problem:Vim9: debugging lambda does not work.
Solution:   Use the compile type of the function when compiling a lambda.
(closes #8412)
Files:  src/vim9compile.c, src/testdir/test_debugger.vim


*** ../vim-8.2.3065/src/vim9compile.c   2021-06-27 15:35:36.955403117 +0200
--- src/vim9compile.c   2021-06-27 16:28:26.819232754 +0200
***
*** 3622,3628 
  // compile_return().
  if (ufunc->uf_ret_type->tt_type == VAR_VOID)
ufunc->uf_ret_type = _unknown;
! compile_def_function(ufunc, FALSE, COMPILE_TYPE(ufunc), cctx);
  
  // evalarg.eval_tofree_cmdline may have a copy of the last line and "*arg"
  // points into it.  Point to the original line to avoid a dangling 
pointer.
--- 3622,3628 
  // compile_return().
  if (ufunc->uf_ret_type->tt_type == VAR_VOID)
ufunc->uf_ret_type = _unknown;
! compile_def_function(ufunc, FALSE, cctx->ctx_compile_type, cctx);
  
  // evalarg.eval_tofree_cmdline may have a copy of the last line and "*arg"
  // points into it.  Point to the original line to avoid a dangling 
pointer.
*** ../vim-8.2.3065/src/testdir/test_debugger.vim   2021-06-23 
20:20:49.654780609 +0200
--- src/testdir/test_debugger.vim   2021-06-27 16:27:24.347373778 +0200
***
*** 932,938 
call delete('Xtest2.vim')
  endfunc
  
! func Test_debug_DefFunction()
CheckCWD
let file =<< trim END
  vim9script
--- 932,938 
call delete('Xtest2.vim')
  endfunc
  
! func Test_debug_def_and_legacy_function()
CheckCWD
let file =<< trim END
  vim9script
***
*** 1068,1073 
--- 1068,1100 
call delete('Xtest.vim')
  endfunc
  
+ func Test_debug_def_function_with_lambda()
+   CheckCWD
+   let lines =<< trim END
+  vim9script
+  def g:Func()
+var s = 'a'
+['b']->map((_, v) => s)
+echo "done"
+  enddef
+  breakadd func 2 g:Func
+   END
+   call writefile(lines, 'XtestLambda.vim')
+ 
+   let buf = RunVimInTerminal('-S XtestLambda.vim', {})
+ 
+   call RunDbgCmd(buf,
+ \ ':call g:Func()',
+ \ ['function Func', 'line 2: [''b'']->map((_, v) => s)'])
+   call RunDbgCmd(buf,
+ \ 'next',
+ \ ['function Func', 'line 3: echo "done"'])
+ 
+   call RunDbgCmd(buf, 'cont')
+   call StopVimInTerminal(buf)
+   call delete('XtestLambda.vim')
+ endfunc
+ 
  func Test_debug_backtrace_level()
CheckCWD
let lines =<< trim END
*** ../vim-8.2.3065/src/version.c   2021-06-27 15:35:36.955403117 +0200
--- src/version.c   2021-06-27 16:11:49.953135946 +0200
***
*** 757,758 
--- 757,760 
  {   /* Add new patch number below this line */
+ /**/
+ 3066,
  /**/

-- 
Latest survey shows that 3 out of 4 people make up 75% of the
world's population.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\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/202106271430.15REUHt4640735%40masaka.moolenaar.net.


Patch 8.2.3065

2021-06-27 Fir de Conversatie Bram Moolenaar


Patch 8.2.3065
Problem:Vim9: error when sourcing script twice and reusing a function
name.
Solution:   Check if the function is dead. (closes #8463)
Files:  src/vim9compile.c, src/testdir/test_vim9_script.vim


*** ../vim-8.2.3064/src/vim9compile.c   2021-06-26 13:59:26.351498193 +0200
--- src/vim9compile.c   2021-06-27 15:34:28.047568245 +0200
***
*** 498,505 
|| (ufunc = find_func_even_dead(p, FALSE, cctx)) != NULL)
  {
// A local or script-local function can shadow a global function.
!   if (ufunc == NULL || !func_is_global(ufunc)
!   || (p[0] == 'g' && p[1] == ':'))
{
if (is_arg)
semsg(_(e_argument_name_shadows_existing_variable_str), p);
--- 498,506 
|| (ufunc = find_func_even_dead(p, FALSE, cctx)) != NULL)
  {
// A local or script-local function can shadow a global function.
!   if (ufunc == NULL || ((ufunc->uf_flags & FC_DEAD) == 0
!   && (!func_is_global(ufunc)
!|| (p[0] == 'g' && p[1] == ':'
{
if (is_arg)
semsg(_(e_argument_name_shadows_existing_variable_str), p);
*** ../vim-8.2.3064/src/testdir/test_vim9_script.vim2021-06-26 
12:40:53.612934775 +0200
--- src/testdir/test_vim9_script.vim2021-06-27 15:33:31.479704124 +0200
***
*** 1519,1524 
--- 1519,1545 
delete('XExportReload')
delfunc g:Values
unlet g:loadCount
+ 
+   lines =<< trim END
+   vim9script
+   def Inner()
+   enddef
+   END
+   lines->writefile('XreloadScript.vim')
+   source XreloadScript.vim
+ 
+   lines =<< trim END
+   vim9script
+   def Outer()
+ def Inner()
+ enddef
+   enddef
+   defcompile
+   END
+   lines->writefile('XreloadScript.vim')
+   source XreloadScript.vim
+ 
+   delete('XreloadScript.vim')
  enddef
  
  def Test_vim9script_reload_import()
*** ../vim-8.2.3064/src/version.c   2021-06-27 15:04:00.784722722 +0200
--- src/version.c   2021-06-27 15:31:04.456058688 +0200
***
*** 757,758 
--- 757,760 
  {   /* Add new patch number below this line */
+ /**/
+ 3065,
  /**/

-- 
The 50-50-90 rule: Anytime you have a 50-50 chance of getting
something right, there's a 90% probability you'll get it wrong.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\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/202106271336.15RDaCEk628399%40masaka.moolenaar.net.


Patch 8.2.3064

2021-06-27 Fir de Conversatie Bram Moolenaar


Patch 8.2.3064
Problem:Vim9: in script cannot set item in uninitialized list.
Solution:   When a list is NULL allocate an empty one. (closes #8461)
Files:  src/eval.c, src/testdir/test_vim9_assign.vim


*** ../vim-8.2.3063/src/eval.c  2021-06-26 15:00:55.881276189 +0200
--- src/eval.c  2021-06-27 15:02:10.281185185 +0200
***
*** 932,946 
semsg(_(e_dot_can_only_be_used_on_dictionary_str), name);
return NULL;
}
!   if (!(lp->ll_tv->v_type == VAR_LIST && lp->ll_tv->vval.v_list != NULL)
!   && !(lp->ll_tv->v_type == VAR_DICT)
!   && !(lp->ll_tv->v_type == VAR_BLOB
!  && lp->ll_tv->vval.v_blob != NULL))
{
if (!quiet)
emsg(_("E689: Can only index a List, Dictionary or Blob"));
return NULL;
}
if (lp->ll_range)
{
if (!quiet)
--- 932,953 
semsg(_(e_dot_can_only_be_used_on_dictionary_str), name);
return NULL;
}
!   if (lp->ll_tv->v_type != VAR_LIST
!   && lp->ll_tv->v_type != VAR_DICT
!   && lp->ll_tv->v_type != VAR_BLOB)
{
if (!quiet)
emsg(_("E689: Can only index a List, Dictionary or Blob"));
return NULL;
}
+ 
+   // a NULL list/blob works like an empty list/blob, allocate one now.
+   if (lp->ll_tv->v_type == VAR_LIST && lp->ll_tv->vval.v_list == NULL)
+   rettv_list_alloc(lp->ll_tv);
+   else if (lp->ll_tv->v_type == VAR_BLOB
+&& lp->ll_tv->vval.v_blob == NULL)
+   rettv_blob_alloc(lp->ll_tv);
+ 
if (lp->ll_range)
{
if (!quiet)
***
*** 1201,1210 
lp->ll_li = list_find_index(lp->ll_list, >ll_n1);
if (lp->ll_li == NULL)
{
!   clear_tv();
!   if (!quiet)
!   semsg(_(e_listidx), lp->ll_n1);
!   return NULL;
}
  
if (lp->ll_valtype != NULL)
--- 1208,1227 
lp->ll_li = list_find_index(lp->ll_list, >ll_n1);
if (lp->ll_li == NULL)
{
!   // Vim9: Allow for adding an item at the end.
!   if (in_vim9script() && lp->ll_n1 == lp->ll_list->lv_len
! && lp->ll_list->lv_lock == 0)
!   {
!   list_append_number(lp->ll_list, 0);
!   lp->ll_li = list_find_index(lp->ll_list, >ll_n1);
!   }
!   if (lp->ll_li == NULL)
!   {
!   clear_tv();
!   if (!quiet)
!   semsg(_(e_listidx), lp->ll_n1);
!   return NULL;
!   }
}
  
if (lp->ll_valtype != NULL)
*** ../vim-8.2.3063/src/testdir/test_vim9_assign.vim2021-06-26 
15:00:55.881276189 +0200
--- src/testdir/test_vim9_assign.vim2021-06-27 14:59:35.473507986 +0200
***
*** 1102,1122 
  enddef
  
  def Test_assign_list()
!   var l: list = []
!   l[0] = 'value'
!   assert_equal('value', l[0])
  
!   l[1] = 'asdf'
!   assert_equal('value', l[0])
!   assert_equal('asdf', l[1])
!   assert_equal('asdf', l[-1])
!   assert_equal('value', l[-2])
  
!   var nrl: list = []
!   for i in range(5)
! nrl[i] = i
!   endfor
!   assert_equal([0, 1, 2, 3, 4], nrl)
  
CheckDefFailure(["var l: list = ['', true]"], 'E1012: Type 
mismatch; expected list but got list', 1)
CheckDefFailure(["var l: list> = [['', true]]"], 'E1012: Type 
mismatch; expected list> but got list>', 1)
--- 1102,1131 
  enddef
  
  def Test_assign_list()
!   var lines =<< trim END
!   var l: list = []
!   l[0] = 'value'
!   assert_equal('value', l[0])
  
!   l[1] = 'asdf'
!   assert_equal('value', l[0])
!   assert_equal('asdf', l[1])
!   assert_equal('asdf', l[-1])
!   assert_equal('value', l[-2])
  
!   var nrl: list = []
!   for i in range(5)
! nrl[i] = i
!   endfor
!   assert_equal([0, 1, 2, 3, 4], nrl)
! 
!   var ul: list
!   ul[0] = 1
!   ul[1] = 2
!   ul[2] = 3
!   assert_equal([1, 2, 3], ul)
!   END
!   CheckDefAndScriptSuccess(lines)
  
CheckDefFailure(["var l: list = ['', true]"], 'E1012: Type 
mismatch; expected list but got list', 1)
CheckDefFailure(["var l: list> = [['', true]]"], 'E1012: Type 
mismatch; expected list> but got list>', 1)
*** ../vim-8.2.3063/src/version.c   2021-06-27 14:08:17.568112117 +0200
--- src/version.c   2021-06-27 15:02:43.309049970 +0200
***
*** 757,758 
--- 757,760 
  {   /* Add new patch number below this line */
+ /**/
+ 3064,
  /**/

-- 
Just remember...if the world didn't suck, we'd all fall off.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
/// 

Patch 8.2.3063

2021-06-27 Fir de Conversatie Bram Moolenaar


Patch 8.2.3063
Problem:Crash when switching 'cryptmethod' to xchaha20 with an existing
undo file. (Martin Tournoij)
Solution:   Disable reading undo file when decoding can't be done inplace.
(issue #8467)
Files:  src/fileio.c, src/bufwrite.c


*** ../vim-8.2.3062/src/fileio.c2021-06-21 21:08:04.928547486 +0200
--- src/fileio.c2021-06-27 14:06:41.056331092 +0200
***
*** 1298,1306 
--- 1298,1314 
 * At start of file: Check for magic number of encryption.
 */
if (filesize == 0 && size > 0)
+   {
cryptkey = check_for_cryptkey(cryptkey, ptr, ,
  , newfile, sfname,
  _ask_for_key);
+ # ifdef CRYPT_NOT_INPLACE
+   if (curbuf->b_cryptstate != NULL
+&& !crypt_works_inplace(curbuf->b_cryptstate))
+   // reading undo file requires crypt_decode_inplace()
+   read_undo_file = FALSE;
+ # endif
+   }
/*
 * Decrypt the read bytes.  This is done before checking for
 * EOF because the crypt layer may be buffering.
*** ../vim-8.2.3062/src/bufwrite.c  2021-06-20 14:01:25.980924619 +0200
--- src/bufwrite.c  2021-06-27 14:06:08.216406574 +0200
***
*** 494,507 
if (crypt_works_inplace(ip->bw_buffer->b_cryptstate))
{
  # endif
!   crypt_encode_inplace(ip->bw_buffer->b_cryptstate, buf, len, 
ip->bw_finish);
  # ifdef CRYPT_NOT_INPLACE
}
else
{
char_u *outbuf;
  
!   len = crypt_encode_alloc(curbuf->b_cryptstate, buf, len, , 
ip->bw_finish);
if (len == 0)
return OK;  // Crypt layer is buffering, will flush later.
wlen = write_eintr(ip->bw_fd, outbuf, len);
--- 494,509 
if (crypt_works_inplace(ip->bw_buffer->b_cryptstate))
{
  # endif
!   crypt_encode_inplace(ip->bw_buffer->b_cryptstate, buf, len,
!   ip->bw_finish);
  # ifdef CRYPT_NOT_INPLACE
}
else
{
char_u *outbuf;
  
!   len = crypt_encode_alloc(curbuf->b_cryptstate, buf, len, ,
!   ip->bw_finish);
if (len == 0)
return OK;  // Crypt layer is buffering, will flush later.
wlen = write_eintr(ip->bw_fd, outbuf, len);
***
*** 1980,1989 
--- 1982,1999 
write_info.bw_start_lnum = start;
  
  #ifdef FEAT_PERSISTENT_UNDO
+   // TODO: if the selected crypt method prevents the undo file from being
+   // written, and existing undo file should be deleted.
write_undo_file = (buf->b_p_udf
&& overwriting
&& !append
&& !filtering
+ # ifdef CRYPT_NOT_INPLACE
+   // writing undo file requires
+   // crypt_encode_inplace()
+   && (curbuf->b_cryptstate == NULL
+   || crypt_works_inplace(curbuf->b_cryptstate))
+ # endif
&& reset_changed
&& !checking_conversion);
if (write_undo_file)
*** ../vim-8.2.3062/src/version.c   2021-06-27 13:03:55.990467766 +0200
--- src/version.c   2021-06-27 13:50:58.650647001 +0200
***
*** 757,758 
--- 757,760 
  {   /* Add new patch number below this line */
+ /**/
+ 3063,
  /**/

-- 
It is hard to understand how a cemetery raised its burial
cost and blamed it on the cost of living.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\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/202106271208.15RC8soY607703%40masaka.moolenaar.net.


Patch 8.2.3062

2021-06-27 Fir de Conversatie Bram Moolenaar


Patch 8.2.3062
Problem:Internal error when adding several text properties.
Solution:   Do not handle text properties when deleting a line for splitting a
data block. (closes #8466)
Files:  src/structs.h, src/memline.c, src/testdir/test_textprop.vim


*** ../vim-8.2.3061/src/structs.h   2021-06-20 19:28:10.273021391 +0200
--- src/structs.h   2021-06-27 12:59:25.891174884 +0200
***
*** 769,774 
--- 769,775 
  // Values for the flags argument of ml_delete_flags().
  #define ML_DEL_MESSAGE1   // may give a "No lines in buffer" 
message
  #define ML_DEL_UNDO   2   // called from undo, do not update textprops
+ #define ML_DEL_NOPROP 4   // splitting data block, do not update textprops
  
  // Values for the flags argument of ml_append_int().
  #define ML_APPEND_NEW 1   // starting to edit a new file
*** ../vim-8.2.3061/src/memline.c   2021-06-21 21:08:04.928547486 +0200
--- src/memline.c   2021-06-27 13:00:39.630981733 +0200
***
*** 3662,3668 
  #ifdef FEAT_PROP_POPUP
  // If there are text properties, make a copy, so that we can update
  // properties in preceding and following lines.
! if (buf->b_has_textprop && !(flags & ML_DEL_UNDO))
  {
size_t  textlen = STRLEN((char_u *)dp + line_start) + 1;
  
--- 3662,3668 
  #ifdef FEAT_PROP_POPUP
  // If there are text properties, make a copy, so that we can update
  // properties in preceding and following lines.
! if (buf->b_has_textprop && !(flags & (ML_DEL_UNDO | ML_DEL_NOPROP)))
  {
size_t  textlen = STRLEN((char_u *)dp + line_start) + 1;
  
***
*** 3765,3773 
  {
// Adjust text properties in the line above and below.
if (lnum > 1)
!   adjust_text_props_for_delete(buf, lnum - 1, textprop_save, 
textprop_save_len, TRUE);
if (lnum <= buf->b_ml.ml_line_count)
!   adjust_text_props_for_delete(buf, lnum, textprop_save, 
textprop_save_len, FALSE);
  }
  vim_free(textprop_save);
  #endif
--- 3765,3775 
  {
// Adjust text properties in the line above and below.
if (lnum > 1)
!   adjust_text_props_for_delete(buf, lnum - 1, textprop_save,
! textprop_save_len, TRUE);
if (lnum <= buf->b_ml.ml_line_count)
!   adjust_text_props_for_delete(buf, lnum, textprop_save,
!textprop_save_len, FALSE);
  }
  vim_free(textprop_save);
  #endif
***
*** 4021,4027 
 | ML_APPEND_NOPROP
  #endif
 );
!   (void)ml_delete_int(buf, lnum, 0);
}
}
vim_free(new_line);
--- 4023,4029 
 | ML_APPEND_NOPROP
  #endif
 );
!   (void)ml_delete_int(buf, lnum, ML_DEL_NOPROP);
}
}
vim_free(new_line);
*** ../vim-8.2.3061/src/testdir/test_textprop.vim   2021-05-26 
22:32:06.254066656 +0200
--- src/testdir/test_textprop.vim   2021-06-27 13:02:41.610662401 +0200
***
*** 1488,1492 
--- 1488,1514 
prop_type_delete('someprop')
  enddef
  
+ " This was calling ml_delete_int() and try to change text properties.
+ def Test_prop_add_delete_line()
+   new
+   var a = 10
+   var b = 20
+   repeat([''], a)->append('$')
+   prop_type_add('Test', {highlight: 'ErrorMsg'})
+   for lnum in range(1, a)
+ for col in range(1, b)
+   prop_add(1, 1, {end_lnum: lnum, end_col: col, type: 'Test'})
+ endfor
+   endfor
+ 
+   # check deleting lines is OK
+   :5del
+   :1del
+   :$del
+ 
+   prop_type_delete('Test')
+   bwipe!
+ enddef
+ 
  
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.3061/src/version.c   2021-06-27 12:07:12.71041 +0200
--- src/version.c   2021-06-27 13:03:40.186509115 +0200
***
*** 757,758 
--- 757,760 
  {   /* Add new patch number below this line */
+ /**/
+ 3062,
  /**/

-- 
Despite the cost of living, have you noticed how it remains so popular?

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///  \\\
\\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\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 

Patch 8.2.3061

2021-06-27 Fir de Conversatie Bram Moolenaar


Patch 8.2.3061
Problem:Testing the shell option is incomplete and spread out.
Solution:   Move shell tests to one file and increase coverage. (Yegappan
Lakshmanan, closes #8464)
Files:  src/testdir/Make_all.mak, src/testdir/test_functions.vim,
src/testdir/test_options.vim, src/testdir/test_shell.vim,
src/testdir/test_system.vim


*** ../vim-8.2.3060/src/testdir/Make_all.mak2021-03-10 21:55:42.729459602 
+0100
--- src/testdir/Make_all.mak2021-06-27 12:03:53.880934653 +0200
***
*** 242,247 
--- 242,248 
test_selectmode \
test_set \
test_sha256 \
+   test_shell \
test_shift \
test_shortpathname \
test_signals \
***
*** 471,476 
--- 472,478 
test_search.res \
test_search_stat.res \
test_selectmode.res \
+   test_shell.res \
test_shortpathname.res \
test_signals.res \
test_signs.res \
*** ../vim-8.2.3060/src/testdir/test_functions.vim  2021-06-15 
22:54:25.179839176 +0200
--- src/testdir/test_functions.vim  2021-06-27 12:03:53.880934653 +0200
***
*** 1579,1609 
delfunc Apply
  endfunc
  
- func Test_shellescape()
-   let save_shell = 
-   set shell=bash
-   call assert_equal("'text'", shellescape('text'))
-   call assert_equal("'te\"xt'", 'te"xt'->shellescape())
-   call assert_equal("'te'\\''xt'", shellescape("te'xt"))
- 
-   call assert_equal("'te%xt'", shellescape("te%xt"))
-   call assert_equal("'te\\%xt'", shellescape("te%xt", 1))
-   call assert_equal("'te#xt'", shellescape("te#xt"))
-   call assert_equal("'te\\#xt'", shellescape("te#xt", 1))
-   call assert_equal("'te!xt'", shellescape("te!xt"))
-   call assert_equal("'te\\!xt'", shellescape("te!xt", 1))
- 
-   call assert_equal("'te\nxt'", shellescape("te\nxt"))
-   call assert_equal("'te\\\nxt'", shellescape("te\nxt", 1))
-   set shell=tcsh
-   call assert_equal("'te\\!xt'", shellescape("te!xt"))
-   call assert_equal("'te!xt'", shellescape("te!xt", 1))
-   call assert_equal("'te\\\nxt'", shellescape("te\nxt"))
-   call assert_equal("'te\nxt'", shellescape("te\nxt", 1))
- 
-   let  = save_shell
- endfunc
- 
  func Test_trim()
call assert_equal("Testing", trim("  \t\r\r\x0BTesting  
\t\n\r\n\t\x0B\x0B"))
call assert_equal("Testing", "  \t  \r\r\n\n\x0BTesting  
\t\n\r\n\t\x0B\x0B"->trim())
--- 1579,1584 
*** ../vim-8.2.3060/src/testdir/test_options.vim2021-06-13 
21:52:42.521260063 +0200
--- src/testdir/test_options.vim2021-06-27 12:03:53.880934653 +0200
***
*** 832,865 
bwipe!
  endfunc
  
- " Test for the 'shell' option
- func Test_shell()
-   CheckUnix
-   let save_shell = 
-   set shell=
-   let caught_e91 = 0
-   try
- shell
-   catch /E91:/
- let caught_e91 = 1
-   endtry
-   call assert_equal(1, caught_e91)
-   let  = save_shell
- endfunc
- 
- " Test for the 'shellquote' option
- func Test_shellquote()
-   CheckUnix
-   set shellquote=#
-   set verbose=20
-   redir => v
-   silent! !echo Hello
-   redir END
-   set verbose&
-   set shellquote&
-   call assert_match(': "#echo Hello#"', v)
- endfunc
- 
  " Test for the 'rightleftcmd' option
  func Test_rightleftcmd()
CheckFeature rightleft
--- 832,837 
*** ../vim-8.2.3060/src/testdir/test_shell.vim  2021-06-27 12:07:01.040497633 
+0200
--- src/testdir/test_shell.vim  2021-06-27 12:03:53.880934653 +0200
***
*** 0 
--- 1,159 
+ " Test for the shell related options ('shell', 'shellcmdflag', 'shellpipe',
+ " 'shellquote', 'shellredir', 'shellxescape', and 'shellxquote')
+ 
+ source check.vim
+ source shared.vim
+ 
+ func Test_shell_options()
+   " For each shell, the following options are checked:
+   " 'shellcmdflag', 'shellpipe', 'shellquote', 'shellredir', 'shellxescape',
+   " 'shellxquote'
+   let shells = []
+   if has('unix')
+ let shells += [['sh', '-c', '2>&1| tee', '', '>%s 2>&1', '', ''],
+   \ ['ksh', '-c', '2>&1| tee', '', '>%s 2>&1', '', ''],
+   \ ['mksh', '-c', '2>&1| tee', '', '>%s 2>&1', '', ''],
+   \ ['zsh', '-c', '2>&1| tee', '', '>%s 2>&1', '', ''],
+   \ ['zsh-beta', '-c', '2>&1| tee', '', '>%s 2>&1', '', ''],
+   \ ['bash', '-c', '2>&1| tee', '', '>%s 2>&1', '', ''],
+   \ ['fish', '-c', '2>&1| tee', '', '>%s 2>&1', '', ''],
+   \ ['ash', '-c', '2>&1| tee', '', '>%s 2>&1', '', ''],
+   \ ['dash', '-c', '2>&1| tee', '', '>%s 2>&1', '', ''],
+   \ ['csh', '-c', '|& tee', '', '>&', '', ''],
+   \ ['tcsh', '-c', '|& tee', '', '>&', '', '']]
+   endif
+   if has('win32')
+ let shells += [['cmd', '/c', '>%s 2>&1', '', '>%s 2>&1', '"&|<>()@^', ''],
+   \ ['cmd.exe', '/c', '>%s 2>&1', '', '>%s 2>&1', '"&|<>()@^', '('],
+   \ ['powershell.exe', '-c', '>', '', '>', '"&|<>()@^', '"'],
+   \ ['powershell', '-c', '>', '', '>', '"&|<>()@^', '"'],
+   \