Re: [vim/vim] [netrw] Fix file move when g:netrw_keepdir=0 (PR #10757)

2022-09-18 Fir de Conversatie Charles Campbell

Alexandre Lepretre (Vim Github Repository) wrote:


@Matsa59  pushed 1 commit.

  * 22bd830

Merge branch 'vim:master' into master

—
View it on GitHub 
 
or unsubscribe 
.
You are receiving this because you are subscribed to this 
thread.Message ID: 




Hello!

I'm netrw's maintainer; would you please send me a patch?

Thank you,
Chip Campbell

--
--
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/1984f79e-9a8a-44de-5adb-7b62739d2521%40drchip.org.


[patch] valgrind uninitialized memory in test_terminal3

2022-09-18 Fir de Conversatie Dominique Pellé
Hi

In runtime/doc/todo.txt, I see this item:

Conditional jump or move depends on uninitialised value(s)
==2819005==at 0x2E9134: jump_to_mouse (mouse.c:2015)
==2819005==by 0x2E69E6: do_mouse (mouse.c:702)
==2819005==by 0x2E95C2: nv_mouse (mouse.c:2166)

If we add the valgrind option --track-origins=yes then we can
see where the uninitialized memory comes from:

==10697== Conditional jump or move depends on uninitialised value(s)
==10697==at 0x2A2225: jump_to_mouse (mouse.c:2015)
==10697==by 0x2A0544: do_mouse (mouse.c:702)
==10697==by 0x2AA3A6: normal_cmd (normal.c:937)
==10697==by 0x225F0C: exec_normal (ex_docmd.c:0)
==10697==by 0x1FFF49: f_feedkeys (evalfunc.c:4352)
==10697==by 0x1FD6EC: call_internal_func (evalfunc.c:2989)
==10697==by 0x3A734C: call_func (userfunc.c:3683)
==10697==by 0x3A684F: get_func_tv (userfunc.c:1839)
==10697==by 0x3AEC52: ex_call_inner (userfunc.c:5577)
==10697==by 0x3AEC52: ex_call (???:5901)
==10697==by 0x21E132: do_one_cmd (ex_docmd.c:2569)
==10697==by 0x21E132: do_cmdline (???:990)
==10697==by 0x3A896F: call_user_func (userfunc.c:2947)
==10697==by 0x3A896F: call_user_func_check (???:3109)
==10697==by 0x3A7273: call_func (userfunc.c:3665)
==10697==by 0x3A684F: get_func_tv (userfunc.c:1839)
==10697==by 0x3AEC52: ex_call_inner (userfunc.c:5577)
==10697==by 0x3AEC52: ex_call (???:5901)
==10697==by 0x21E132: do_one_cmd (ex_docmd.c:2569)
==10697==by 0x21E132: do_cmdline (???:990)
==10697==by 0x1F9878: ex_execute (eval.c:6817)
==10697==by 0x21E132: do_one_cmd (ex_docmd.c:2569)
==10697==by 0x21E132: do_cmdline (???:990)
==10697==by 0x3A896F: call_user_func (userfunc.c:2947)
==10697==by 0x3A896F: call_user_func_check (???:3109)
==10697==by 0x3A7273: call_func (userfunc.c:3665)
==10697==by 0x3A684F: get_func_tv (userfunc.c:1839)
==10697==by 0x3AEC52: ex_call_inner (userfunc.c:5577)
==10697==by 0x3AEC52: ex_call (???:5901)
==10697==by 0x21E132: do_one_cmd (ex_docmd.c:2569)
==10697==by 0x21E132: do_cmdline (???:990)
==10697==by 0x3308ED: do_source_ext (scriptfile.c:1667)
==10697==by 0x32FE55: do_source (scriptfile.c:1811)
==10697==by 0x32FE55: cmd_source (???:1163)
==10697==by 0x21E132: do_one_cmd (ex_docmd.c:2569)
==10697==by 0x21E132: do_cmdline (???:990)
==10697==by 0x441BD8: exe_commands (main.c:3139)
==10697==by 0x441BD8: vim_main2 (???:781)
==10697==by 0x440B9A: main (main.c:432)

==10697==  Uninitialised value was created by a heap allocation
==10697==at 0x40367BA: malloc (vg_replace_malloc.c:393)
==10697==by 0x1A5477: lalloc (alloc.c:246)
==10697==by 0x329CC9: screenalloc (screen.c:2711)
==10697==by 0x32AD3D: screenclear (screen.c:2981)
==10697==by 0x3775FB: set_shellsize (term.c:3436)
==10697==by 0x3767EA: set_termname (term.c:2063)
==10697==by 0x4406CC: main (main.c:368)

So the uninitialized memory comes from screen.c:2711:

 2711 new_ScreenCols = LALLOC_MULT(colnr_T, (Rows + 1) * Columns);

This one-line patch fixes it:

diff --git a/src/screen.c b/src/screen.c
index 27f484837..17a6fd24e 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -2708,7 +2708,7 @@ retry:
 if (enc_dbcs == DBCS_JPNU)
new_ScreenLines2 = LALLOC_MULT(schar_T, (Rows + 1) * Columns);
 new_ScreenAttrs = LALLOC_MULT(sattr_T, (Rows + 1) * Columns);
-new_ScreenCols = LALLOC_MULT(colnr_T, (Rows + 1) * Columns);
+new_ScreenCols = LALLOC_CLEAR_MULT(colnr_T, (Rows + 1) * Columns);
 new_LineOffset = LALLOC_MULT(unsigned, Rows);
 new_LineWraps = LALLOC_MULT(char_u, Rows);
 new_TabPageIdxs = LALLOC_MULT(short, Columns);

However, I am not sure that the fix is correct as
the function screenalloc(...) has a doclear parameter,
so maybe it's the caller that should have called
screenalloc(TRUE)?

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_j7cxw2pB7i8mfz0XPaF%3DBasC0_tGm3UfqivfXkBCpKWg%40mail.gmail.com.


Patch 9.0.0500

2022-09-18 Fir de Conversatie Bram Moolenaar


Patch 9.0.0500
Problem:When quitting the cmdline window with CTRL-C it remains visible.
Solution:   Redraw to avoid confusion. Adjust the error message.
(closes #11152)  Adjust the cursor position after CTRL-C.
Files:  src/ex_getln.c, src/errors.h, src/testdir/test_cmdwin.vim,
src/testdir/dumps/Test_cmdwin_wrong_command_1.dump,
src/testdir/dumps/Test_cmdwin_wrong_command_2.dump


*** ../vim-9.0.0499/src/ex_getln.c  2022-09-17 19:43:19.254427034 +0100
--- src/ex_getln.c  2022-09-18 14:54:13.020741003 +0100
***
*** 4631,4643 
ccline.cmdlen = (int)STRLEN(ccline.cmdbuff);
ccline.cmdbufflen = ccline.cmdlen + 1;
ccline.cmdpos = curwin->w_cursor.col;
!   if (ccline.cmdpos > ccline.cmdlen)
ccline.cmdpos = ccline.cmdlen;
-   if (cmdwin_result == K_IGNORE)
-   {
-   set_cmdspos_cursor();
-   redrawcmd();
-   }
}
  
  # ifdef FEAT_CONCEAL
--- 4631,4641 
ccline.cmdlen = (int)STRLEN(ccline.cmdbuff);
ccline.cmdbufflen = ccline.cmdlen + 1;
ccline.cmdpos = curwin->w_cursor.col;
!   // If the cursor is on the last character, it probably should be
!   // after it.
!   if (ccline.cmdpos == ccline.cmdlen - 1
!   || ccline.cmdpos > ccline.cmdlen)
ccline.cmdpos = ccline.cmdlen;
}
  
  # ifdef FEAT_CONCEAL
***
*** 4664,4669 
--- 4662,4676 
// Restore window sizes.
win_size_restore(&winsizes);
skip_win_fix_cursor = FALSE;
+ 
+   if (cmdwin_result == K_IGNORE)
+   {
+   // It can be confusing that the cmdwin still shows, redraw the
+   // screen.
+   update_screen(UPD_VALID);
+   set_cmdspos_cursor();
+   redrawcmd();
+   }
  }
  
  ga_clear(&winsizes);
*** ../vim-9.0.0499/src/errors.h2022-09-17 21:07:52.103993150 +0100
--- src/errors.h2022-09-18 14:43:37.278218001 +0100
***
*** 17,23 
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"));
--- 17,23 
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; :q closes the 
window"));
  #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"));
*** ../vim-9.0.0499/src/testdir/test_cmdwin.vim 2022-09-17 21:20:38.646360597 
+0100
--- src/testdir/test_cmdwin.vim 2022-09-18 14:55:43.240527208 +0100
***
*** 73,79 
call writefile(lines, 'XTest_restore', 'D')
  
let buf = RunVimInTerminal('-S XTest_restore', {'rows': 12})
-   call TermWait(buf, 50)
call term_sendkeys(buf, "q:")
call VerifyScreenDump(buf, 'Test_cmdwin_restore_1', {})
  
--- 73,78 
***
*** 93,103 
  endfunc
  
  func Test_cmdwin_no_terminal()
!   CheckFeature terminal
!   CheckNotMSWindows
  
let buf = RunVimInTerminal('', {'rows': 12})
-   call TermWait(buf, 50)
call term_sendkeys(buf, ":set cmdheight=2\")
call term_sendkeys(buf, "q:")
call term_sendkeys(buf, ":let buf = term_start(['/bin/echo'], #{hidden: 
1})\")
--- 92,100 
  endfunc
  
  func Test_cmdwin_no_terminal()
!   CheckScreendump
  
let buf = RunVimInTerminal('', {'rows': 12})
call term_sendkeys(buf, ":set cmdheight=2\")
call term_sendkeys(buf, "q:")
call term_sendkeys(buf, ":let buf = term_start(['/bin/echo'], #{hidden: 
1})\")
***
*** 105,110 
--- 102,123 
call term_sendkeys(buf, ":q\")
call StopVimInTerminal(buf)
  endfunc
+ 
+ func Test_cmdwin_wrong_command()
+   CheckScreendump
+ 
+   let buf = RunVimInTerminal('', {'rows': 12})
+   call term_sendkeys(buf, "q:")
+   call term_sendkeys(buf, "als\")
+   call term_sendkeys(buf, "\k")
+   call VerifyScreenDump(buf, 'Test_cmdwin_wrong_command_1', {})
+ 
+   call term_sendkeys(buf, "\")
+   call VerifyScreenDump(buf, 'Test_cmdwin_wrong_command_2', {})
+ 
+   call term_sendkeys(buf, ":q\")
+   call StopVimInTerminal(buf)
+ endfunc
  
  func Test_cmdwin_feedkeys()
" This should not generate E488
*** ../vim-9.0.0499/src/testdir/dumps/Test_cmdwin_wrong_command_1.dump  
2022-09-18 15:02:59.651536793 +0100
--- src/testdir/dumps/Test_cmdwin_wrong_command_1.dump  2022-09-18 
14:55:48.140515578 +0100
***
*** 0 
--- 1,12 
+ | +0&#ff0@74
+ |~+0#4040ff13&| @73
+ |[+1#000&|N|o| |N|a|m|e

Patch 9.0.0499

2022-09-18 Fir de Conversatie Bram Moolenaar


Patch 9.0.0499
Problem:In :def function list created after const is locked.
Solution:   Reset v_lock. (closes #11154)
Files:  src/vim9execute.c, src/testdir/test_vim9_assign.vim


*** ../vim-9.0.0498/src/vim9execute.c   2022-09-18 12:00:16.260337802 +0100
--- src/vim9execute.c   2022-09-18 13:45:33.479731972 +0100
***
*** 200,205 
--- 200,206 
  tv = STACK_TV_BOT(-1);
  tv->v_type = VAR_LIST;
  tv->vval.v_list = list;
+ tv->v_lock = 0;
  if (list != NULL)
++list->lv_refcount;
  return OK;
*** ../vim-9.0.0498/src/testdir/test_vim9_assign.vim2022-09-17 
21:07:52.111993132 +0100
--- src/testdir/test_vim9_assign.vim2022-09-18 13:44:09.267919330 +0100
***
*** 2023,2028 
--- 2023,2035 
unlet w:FLIST
  enddef
  
+ def Test_create_list_after_const()
+   const a = 1
+   g:ll = []
+   assert_equal(0, islocked('g:ll'))
+   unlet g:ll
+ enddef
+ 
  def Test_var_declaration_fails()
var lines =<< trim END
  vim9script
*** ../vim-9.0.0498/src/version.c   2022-09-18 13:06:36.461124371 +0100
--- src/version.c   2022-09-18 13:45:08.459787596 +0100
***
*** 701,702 
--- 701,704 
  {   /* Add new patch number below this line */
+ /**/
+ 499,
  /**/

-- 
The primary purpose of the DATA statement is to give names to constants;
instead of referring to pi as 3.141592653589793 at every appearance, the
variable PI can be given that value with a DATA statement and used instead
of the longer form of the constant.  This also simplifies modifying the
program, should the value of pi change.
-- FORTRAN manual for Xerox Computers

 /// 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/20220918124719.C6B261C0852%40moolenaar.net.


Patch 9.0.0498

2022-09-18 Fir de Conversatie Bram Moolenaar


Patch 9.0.0498
Problem:Various small issues.
Solution:   Various small fixes.
Files:  src/arglist.c, src/cmdexpand.c, src/debugger.c, src/findfile.c,
src/if_xcmdsrv.c, src/testdir/test_lambda.vim,
src/testdir/test_vim9_cmd.vim


*** ../vim-9.0.0497/src/arglist.c   2022-09-05 18:27:38.847160366 +0100
--- src/arglist.c   2022-09-06 10:28:15.235056859 +0100
***
*** 982,988 
{
if (i < aall->alist->al_ga.ga_len
&& (AARGLIST(aall->alist)[i].ae_fnum == buf->b_fnum
!   || 
fullpathcmp(alist_name(&AARGLIST(aall->alist)[i]),
buf->b_ffname, TRUE, TRUE) & FPC_SAME))
{
int weight = 1;
--- 982,989 
{
if (i < aall->alist->al_ga.ga_len
&& (AARGLIST(aall->alist)[i].ae_fnum == buf->b_fnum
!   || fullpathcmp(alist_name(
!   &AARGLIST(aall->alist)[i]),
buf->b_ffname, TRUE, TRUE) & FPC_SAME))
{
int weight = 1;
***
*** 1000,1006 
if (i == 0)
{
if (aall->new_curwin != NULL)
!   aall->new_curwin->w_arg_idx = 
aall->opened_len;
aall->new_curwin = wp;
aall->new_curtab = curtab;
}
--- 1001,1008 
if (i == 0)
{
if (aall->new_curwin != NULL)
!   aall->new_curwin->w_arg_idx =
! aall->opened_len;
aall->new_curwin = wp;
aall->new_curtab = curtab;
}
*** ../vim-9.0.0497/src/cmdexpand.c 2022-09-02 15:15:11.059569191 +0100
--- src/cmdexpand.c 2022-09-02 19:16:03.531827526 +0100
***
*** 2394,2399 
--- 2394,2400 
  
  /*
   * Expand file or directory names.
+  * Returns OK or FAIL.
   */
  static int
  expand_files_and_dirs(
*** ../vim-9.0.0497/src/debugger.c  2022-09-13 12:36:53.860094694 +0100
--- src/debugger.c  2022-09-13 14:34:14.989235331 +0100
***
*** 135,141 
ignore_script = TRUE;
}
  
!   // don't debug any function call, e.g. from an expresion mapping
n = debug_break_level;
debug_break_level = -1;
  
--- 135,141 
ignore_script = TRUE;
}
  
!   // don't debug any function call, e.g. from an expression mapping
n = debug_break_level;
debug_break_level = -1;
  
*** ../vim-9.0.0497/src/findfile.c  2022-08-25 18:12:00.350668422 +0100
--- src/findfile.c  2022-09-05 12:06:46.064816893 +0100
***
*** 1931,1942 
   */
  len = 0;
  while (vim_isfilec(ptr[len]) || (ptr[len] == '\\' && ptr[len + 1] == ' ')
!|| ((options & FNAME_HYP) && path_is_url(ptr + len))
!|| (is_url && vim_strchr((char_u *)":?&=", ptr[len]) 
!= NULL))
  {
!   // After type:// we also include :, ?, & and = as valid characters, so 
that
!   // http://google.com:8080?q=this&that=ok works.
!   if ((ptr[len] >= 'A' && ptr[len] <= 'Z') || (ptr[len] >= 'a' && 
ptr[len] <= 'z'))
{
if (in_type && path_is_url(ptr + len + 1))
is_url = TRUE;
--- 1931,1943 
   */
  len = 0;
  while (vim_isfilec(ptr[len]) || (ptr[len] == '\\' && ptr[len + 1] == ' ')
!|| ((options & FNAME_HYP) && path_is_url(ptr + len))
!|| (is_url && vim_strchr((char_u *)":?&=", ptr[len]) != NULL))
  {
!   // After type:// we also include :, ?, & and = as valid characters, so
!   // that http://google.com:8080?q=this&that=ok works.
!   if ((ptr[len] >= 'A' && ptr[len] <= 'Z')
!  || (ptr[len] >= 'a' && ptr[len] <= 'z'))
{
if (in_type && path_is_url(ptr + len + 1))
is_url = TRUE;
*** ../vim-9.0.0497/src/if_xcmdsrv.c2022-03-20 11:02:23.0 +
--- src/if_xcmdsrv.c2022-09-08 10:52:33.439871522 +0100
***
*** 774,780 
  /*
   * Wait for replies from id (win)
   * When "timeout" is non-zero wait up to this many seconds.
!  * Return 0 and the malloc'ed string when a reply is available.
   * Return -1 if the window becomes invalid while waiting.
   */
  int
--- 774,780 
  /*
   * Wait for replies from id (win)
   * When "timeout" is non-zero wait up to this many seconds.
!  * Return 0 and the allocated string in "*str" when a reply is availab

Patch 9.0.0497

2022-09-18 Fir de Conversatie Bram Moolenaar


Patch 9.0.0497
Problem:LyRiCs files are not recognized.
Solution:   Add a pattern to detect LyRiCs files. (closes #11155)
Files:  runtime/filetype.vim, src/testdir/test_filetype.vim


*** ../vim-9.0.0496/runtime/filetype.vim2022-09-16 15:46:57.392979652 
+0100
--- runtime/filetype.vim2022-09-18 12:43:12.788422035 +0100
***
*** 448,453 
--- 448,456 
  " Lynx config files
  au BufNewFile,BufRead lynx.cfgsetf lynx
  
+ " LyRiCs
+ au BufNewFile,BufRead *.lrc   setf lyrics
+ 
  " Modula-3 configuration language (must be before *.cfg and *makefile)
  au BufNewFile,BufRead *.quake,cm3.cfg setf m3quake
  au BufNewFile,BufRead m3makefile,m3overrides  setf m3build
*** ../vim-9.0.0496/src/testdir/test_filetype.vim   2022-09-16 
15:46:57.392979652 +0100
--- src/testdir/test_filetype.vim   2022-09-18 12:43:12.788422035 +0100
***
*** 327,332 
--- 327,333 
  \ 'lss': ['file.lss'],
  \ 'lua': ['file.lua', 'file.rockspec', 'file.nse'],
  \ 'lynx': ['lynx.cfg'],
+ \ 'lyrics': ['file.lrc'],
  \ 'm3build': ['m3makefile', 'm3overrides'],
  \ 'm3quake': ['file.quake', 'cm3.cfg'],
  \ 'm4': ['file.at'],
*** ../vim-9.0.0496/src/version.c   2022-09-18 12:24:30.546430897 +0100
--- src/version.c   2022-09-18 12:44:31.132270398 +0100
***
*** 701,702 
--- 701,704 
  {   /* Add new patch number below this line */
+ /**/
+ 497,
  /**/

-- 
I AM THANKFUL...
...for the taxes that I pay because it means that I am employed.

 /// 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/20220918114714.ADCB21C0846%40moolenaar.net.


Patch 9.0.0496

2022-09-18 Fir de Conversatie Bram Moolenaar


Patch 9.0.0496
Problem:No good reason to keep supporting Windows-XP.
Solution:   Drop Windows-XP support. (Ken Takata, closes #11089)
Files:  README.md, README.txt, runtime/doc/gui_w32.txt,
runtime/doc/os_win32.txt, src/INSTALLpc.txt,
src/Make_cyg_ming.mak, src/Make_mvc.mak, src/os_mswin.c,
src/os_win32.c


*** ../vim-9.0.0495/README.md   2022-06-28 11:26:05.0 +0100
--- README.md   2022-09-18 12:17:58.514925208 +0100
***
*** 1,6 
  [![Vim 
Logo](https://github.com/vim/vim/raw/master/runtime/vimlogo.gif)](https://www.vim.org)
  
! [![Github Build 
status](https://github.com/vim/vim/workflows/GitHub%20CI/badge.svg)](https://github.com/vim/vim/actions?query=workflow%3A%22GitHub+CI%22)
 [![Travis Build 
Status](https://travis-ci.com/vim/vim.svg?branch=master)](https://travis-ci.com/github/vim/vim)
 [![Appveyor Build 
status](https://ci.appveyor.com/api/projects/status/o2qht2kjm02sgghk?svg=true)](https://ci.appveyor.com/project/chrisbra/vim)
 [![Cirrus Build 
Status](https://api.cirrus-ci.com/github/vim/vim.svg)](https://cirrus-ci.com/github/vim/vim)
 [![Coverage 
Status](https://codecov.io/gh/vim/vim/coverage.svg?branch=master)](https://codecov.io/gh/vim/vim?branch=master)
 [![Coverity 
Scan](https://scan.coverity.com/projects/241/badge.svg)](https://scan.coverity.com/projects/vim)
 [![Language Grade: 
C/C++](https://img.shields.io/lgtm/grade/cpp/g/vim/vim.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/vim/vim/context:cpp)
 [![Debian 
CI](https://badges.debian.net/badges/debian/testing/vim/version.svg)](https://buil
 dd.debian.org/vim) 
[![Packages](https://repology.org/badge/tiny-repos/vim.svg)](https://repology.org/metapackage/vim)
 [![Fossies codespell 
report](https://fossies.org/linux/test/vim-master.tar.gz/codespell.svg)](https://fossies.org/linux/test/vim-master.tar.gz/codespell.html)
  
  For translations of this README see the end.
  
--- 1,6 
  [![Vim 
Logo](https://github.com/vim/vim/raw/master/runtime/vimlogo.gif)](https://www.vim.org)
  
! [![Github Build 
status](https://github.com/vim/vim/workflows/GitHub%20CI/badge.svg)](https://github.com/vim/vim/actions?query=workflow%3A%22GitHub+CI%22)
 [![Appveyor Build 
status](https://ci.appveyor.com/api/projects/status/o2qht2kjm02sgghk?svg=true)](https://ci.appveyor.com/project/chrisbra/vim)
 [![Cirrus Build 
Status](https://api.cirrus-ci.com/github/vim/vim.svg)](https://cirrus-ci.com/github/vim/vim)
 [![Coverage 
Status](https://codecov.io/gh/vim/vim/coverage.svg?branch=master)](https://codecov.io/gh/vim/vim?branch=master)
 [![Coverity 
Scan](https://scan.coverity.com/projects/241/badge.svg)](https://scan.coverity.com/projects/vim)
 [![Language Grade: 
C/C++](https://img.shields.io/lgtm/grade/cpp/g/vim/vim.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/vim/vim/context:cpp)
 [![Debian 
CI](https://badges.debian.net/badges/debian/testing/vim/version.svg)](https://buildd.debian.org/vim)
 
[![Packages](https://repology.org/badge/tiny-repos/vim.svg)](https://repology.org/metapackage
 /vim) [![Fossies codespell 
report](https://fossies.org/linux/test/vim-master.tar.gz/codespell.svg)](https://fossies.org/linux/test/vim-master.tar.gz/codespell.html)
  
  For translations of this README see the end.
  
***
*** 28,37 
  with ten fingers can work very fast.  Additionally, function keys can be
  mapped to commands by the user, and the mouse can be used.
  
! Vim runs under MS-Windows (XP, Vista, 7, 8, 10), macOS, Haiku, VMS and almost
! all flavours of UNIX.  Porting to other systems should not be very difficult.
! Older versions of Vim run on MS-DOS, MS-Windows 95/98/Me/NT/2000, Amiga DOS,
! Atari MiNT, BeOS, RISC OS and OS/2.  These are no longer maintained.
  
  For Vim9 script see [README_VIM9](README_VIM9.md).
  
--- 28,37 
  with ten fingers can work very fast.  Additionally, function keys can be
  mapped to commands by the user, and the mouse can be used.
  
! Vim runs under MS-Windows (7, 8, 10, 11), macOS, Haiku, VMS and almost all
! flavours of UNIX.  Porting to other systems should not be very difficult.
! Older versions of Vim run on MS-DOS, MS-Windows 95/98/Me/NT/2000/XP/Vista,
! Amiga DOS, Atari MiNT, BeOS, RISC OS and OS/2.  These are no longer 
maintained.
  
  For Vim9 script see [README_VIM9](README_VIM9.md).
  
***
*** 128,133 
--- 128,135 
  
  ## Information ##
  
+ If you are on macOS, you can use 
[Macvim](https://macvim-dev.github.io/macvim/).
+ 
  The latest news about Vim can be found on the Vim home page:
https://www.vim.org/
  
***
*** 150,157 
  
  
  This is `README.md` for version 9.0 of Vim: Vi IMproved.
- 
- 
- ## Translations of this README ##
- 
- [Korean](https://github.com/cjw1359/opensource/blob/master/Vim/README_ko.md)
--- 152,154 
*** ../vim-9.0.0495/README.txt  2022-06-28 11:21:05.0 +0100
--- README.txt  2022-09-18 12:17:58.514925208 +0100
***
**

Patch 9.0.0495

2022-09-18 Fir de Conversatie Bram Moolenaar


Patch 9.0.0495
Problem:Closure doesn't work properly in nested loop.
Solution:   Save variables up to the outer loop.
Files:  src/vim9execute.c, src/testdir/test_vim9_script.vim


*** ../vim-9.0.0494/src/vim9execute.c   2022-09-17 21:07:52.103993150 +0100
--- src/vim9execute.c   2022-09-18 11:19:16.428456980 +0100
***
*** 2671,2677 
  {
partial_T   *pt = ((partial_T **)gap->ga_data)[idx];
  
!   if (pt->pt_refcount > 1)
{
int refcount = pt->pt_refcount;
int i;
--- 2671,2677 
  {
partial_T   *pt = ((partial_T **)gap->ga_data)[idx];
  
!   if (pt->pt_refcount > 1 && pt->pt_loopvars == NULL)
{
int refcount = pt->pt_refcount;
int i;
***
*** 2727,2733 
  {
partial_T   *pt = ((partial_T **)gap->ga_data)[idx];
  
!   if (pt->pt_refcount > 1)
{
++loopvars->lvs_refcount;
pt->pt_loopvars = loopvars;
--- 2727,2733 
  {
partial_T   *pt = ((partial_T **)gap->ga_data)[idx];
  
!   if (pt->pt_refcount > 1 && pt->pt_loopvars == NULL)
{
++loopvars->lvs_refcount;
pt->pt_loopvars = loopvars;
*** ../vim-9.0.0494/src/testdir/test_vim9_script.vim2022-09-17 
15:44:48.369409492 +0100
--- src/testdir/test_vim9_script.vim2022-09-18 11:43:34.681092655 +0100
***
*** 2300,2305 
--- 2300,2331 
endfor
END
v9.CheckDefAndScriptSuccess(lines)
+ 
+   # Also works for a nested loop
+   lines =<< trim END
+   var flist: list
+   var n = 0
+   for i in range(3)
+ var ii = i
+ for a in ['a', 'b', 'c']
+   var aa = a
+   flist[n] = () => ii .. aa
+   ++n
+ endfor
+   endfor
+ 
+   n = 0
+   for i in range(3)
+ for a in ['a', 'b', 'c']
+   assert_equal(i .. a, flist[n]())
+   ++n
+ endfor
+   endfor
+   END
+   v9.CheckScriptSuccess(['vim9script'] + lines)
+   # FIXME: not yet right for :def
+   lines[14] = 'assert_equal(2 .. a, flist[n]())'
+   v9.CheckDefSuccess(lines)
  enddef
  
  def Test_for_loop_fails()
*** ../vim-9.0.0494/src/version.c   2022-09-17 21:57:35.860822365 +0100
--- src/version.c   2022-09-18 11:27:19.589988988 +0100
***
*** 701,702 
--- 701,704 
  {   /* Add new patch number below this line */
+ /**/
+ 495,
  /**/

-- 
>From "know your smileys":
 :-FBucktoothed vampire with one tooth missing

 /// 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/20220918110105.5B54A1C0846%40moolenaar.net.


Re: [patch] typos in doc of Vim-9.0.494

2022-09-18 Fir de Conversatie Bram Moolenaar


Dominique wrote:

> Attached patch fixes typos in doc of Vim-9.0.494.

I'll include it, thanks.

-- 
>From "know your smileys":
 @:-()  Elvis Presley

 /// 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/20220918101003.F1A661C0846%40moolenaar.net.


detecting whether (local) option was set by a session file

2022-09-18 Fir de Conversatie Enno

Hello,

Assuming that 'sessionoptions' contains localoptions, would the 
SessionLoadPost event be a safe bet to detect whether a local option was 
(explicitly) set by loading a session file?
That is, are all local options always (re)set in a session file?

  Thank you for your help

 Enno

-- 
-- 
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/aff9ffa0-4a6b-4d30-a2fb-5af3b8c67f06n%40googlegroups.com.