Patch 9.0.1384

2023-03-05 Fir de Conversatie Bram Moolenaar


Patch 9.0.1384
Problem:Setting HOMEBREW_NO_AUTO_UPDATE is not needed with Homebew version
4.
Solution:   Remove setting HOMEBREW_NO_AUTO_UPDATE. (closes #12008)
Files:  .github/workflows/ci.yml


*** ../vim-9.0.1383/.github/workflows/ci.yml2023-02-06 20:22:44.461678819 
+
--- .github/workflows/ci.yml2023-03-05 20:56:06.332078590 +
***
*** 299,306 
  
- name: Install packages
  if: matrix.features == 'huge'
- env:
-   HOMEBREW_NO_AUTO_UPDATE: 1
  run: |
brew install lua
echo "LUA_PREFIX=/usr/local" >> $GITHUB_ENV
--- 299,304 
*** ../vim-9.0.1383/src/version.c   2023-03-05 20:17:36.151194621 +
--- src/version.c   2023-03-05 20:55:26.616068587 +
***
*** 697,698 
--- 697,700 
  {   /* Add new patch number below this line */
+ /**/
+ 1384,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
230. You spend your Friday nights typing away at your keyboard

 /// 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/20230305205715.97F1D1C0419%40moolenaar.net.


Patch 9.0.1383

2023-03-05 Fir de Conversatie Bram Moolenaar


Patch 9.0.1383
Problem:xxd: combination of little endian and cols fails. (Aapo
Rantalainen)
Solution:   Round up the space taken by the hex output. (closes #12097)
Files:  src/xxd/xxd.c, src/testdir/test_xxd.vim


*** ../vim-9.0.1382/src/xxd/xxd.c   2022-09-06 16:31:22.380166840 +0100
--- src/xxd/xxd.c   2023-03-05 20:16:43.099191668 +
***
*** 837,843 
{
  addrlen = sprintf(l, decimal_offset ? "%08ld:" : "%08lx:",
  ((unsigned long)(n + seekoff + displayoff)));
! for (c = addrlen; c < LLEN; l[c++] = ' ');
}
x = hextype == HEX_LITTLEENDIAN ? p ^ (octspergrp-1) : p;
c = addrlen + 1 + (grplen * x) / octspergrp;
--- 837,844 
{
  addrlen = sprintf(l, decimal_offset ? "%08ld:" : "%08lx:",
  ((unsigned long)(n + seekoff + displayoff)));
! for (c = addrlen; c < LLEN; l[c++] = ' ')
!   ;
}
x = hextype == HEX_LITTLEENDIAN ? p ^ (octspergrp-1) : p;
c = addrlen + 1 + (grplen * x) / octspergrp;
***
*** 857,863 
if (ebcdic)
e = (e < 64) ? '.' : etoa64[e-64];
/* When changing this update definition of LLEN above. */
!   c = addrlen + 3 + (grplen * cols - 1)/octspergrp + p;
l[c++] =
  #ifdef __MVS__
  (e >= 64)
--- 858,869 
if (ebcdic)
e = (e < 64) ? '.' : etoa64[e-64];
/* When changing this update definition of LLEN above. */
!   if (hextype == HEX_LITTLEENDIAN)
!   /* last group will be fully used, round up */
!   c = grplen * ((cols + octspergrp - 1) / octspergrp);
!   else
!   c = (grplen * cols - 1) / octspergrp;
!   c += addrlen + 3 + p;
l[c++] =
  #ifdef __MVS__
  (e >= 64)
*** ../vim-9.0.1382/src/testdir/test_xxd.vim2023-01-28 19:18:56.741720608 
+
--- src/testdir/test_xxd.vim2023-03-05 20:14:23.379176859 +
***
*** 401,404 
--- 401,418 
endfor
  endfunc
  
+ func Test_xxd_little_endian_with_cols()
+   enew!
+   call writefile(["ABCDEF"], 'Xxdin', 'D')
+   exe 'r! ' .. s:xxd_cmd .. ' -e -c6 ' .. ' Xxdin'
+   call assert_equal(': 44434241 4645   ABCDEF', getline(2))
+ 
+   enew!
+   call writefile(["ABCDEFGHI"], 'Xxdin', 'D')
+   exe 'r! ' .. s:xxd_cmd .. ' -e -c9 ' .. ' Xxdin'
+   call assert_equal(': 44434241 48474645   49   ABCDEFGHI', 
getline(2))
+ 
+   bwipe!
+ endfunc
+ 
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-9.0.1382/src/version.c   2023-03-05 19:27:43.646982550 +
--- src/version.c   2023-03-05 20:15:38.939192193 +
***
*** 697,698 
--- 697,700 
  {   /* Add new patch number below this line */
+ /**/
+ 1383,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
228. You spend Saturday night making the counter on your home page
 pass that 2000 mark.

 /// 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/20230305201808.A65741C0419%40moolenaar.net.


Patch 9.0.1382

2023-03-05 Fir de Conversatie Bram Moolenaar


Patch 9.0.1382
Problem:Failing test for strptime() doesn't show returned value.
Solution:   Use assert_equal() instead of assert_true().
Files:  src/testdir/test_vim9_builtin.vim


*** ../vim-9.0.1381/src/testdir/test_vim9_builtin.vim   2023-01-15 
18:17:08.789655225 +
--- src/testdir/test_vim9_builtin.vim   2023-03-05 19:24:52.046648628 +
***
*** 4286,4293 
if exists_compiled('*strptime')
  v9.CheckDefAndScriptFailure(['strptime(10, "2021")'], ['E1013: Argument 
1: type mismatch, expected string but got number', 'E1174: String required for 
argument 1'])
  v9.CheckDefAndScriptFailure(['strptime("%Y", 2021)'], ['E1013: Argument 
2: type mismatch, expected string but got number', 'E1174: String required for 
argument 2'])
! assert_true(strptime('%Y', '2021') != 0)
! assert_true(strptime('%Y', '') == 0)
endif
  enddef
  
--- 4286,4293 
if exists_compiled('*strptime')
  v9.CheckDefAndScriptFailure(['strptime(10, "2021")'], ['E1013: Argument 
1: type mismatch, expected string but got number', 'E1174: String required for 
argument 1'])
  v9.CheckDefAndScriptFailure(['strptime("%Y", 2021)'], ['E1013: Argument 
2: type mismatch, expected string but got number', 'E1174: String required for 
argument 2'])
! assert_notequal(0, strptime('%Y', '2021'))
! assert_equal(0, strptime('%Y', ''))
endif
  enddef
  
*** ../vim-9.0.1381/src/version.c   2023-03-05 13:12:28.492767233 +
--- src/version.c   2023-03-05 19:24:16.258573356 +
***
*** 697,698 
--- 697,700 
  {   /* Add new patch number below this line */
+ /**/
+ 1382,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
204. You have learned not to fall asleep on your keyboard
 the hard way

 /// 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/20230305192814.356F01C042C%40moolenaar.net.


Re: [vim/vim] Decrementing 2**64 gives wrong result (Issue #12103)

2023-03-05 Fir de Conversatie Marvin Renich
* Bram Moolenaar  [230304 15:47]:
> 
> > ### Steps to reproduce
> > 
> > Create a buffer with the number `18446744073709551616`.
> > Press `Ctrl-x` with the cursor on the number.
> > Number is changed to `18446744073709551614`.
> > 
> > ### Expected behaviour
> > 
> > Number is changed to `18446744073709551615`
> 
> The problem is that 2 ** 64 does not fit in the variable being used.
> Getting the number from the text results in the maximum number that can
> be represented, which is 18446744073709551615.  Then one is subtracted.
> 
> I think the best we can do is keep a flag for the "overflow" and then
> not subtract one.  That makes this corner case work, although it won't
> be fixed in the general case.  Still better than doing nothing.

I don't think this is the right fix.  I think you should either document
that 64-bit arithmetic is being used, and load the original number as 0
(the correct modulo-64 representation) and decrement gives -1 and
increment gives 1, or decide to use arbitrary-precision arithmetic and
give the correct answer for numbers larger than 2^64.

Either of these two approaches give consistent results for numbers
larger than 2^64-1, whereas the fix you suggest only makes one
'out-of-bounds' value work.  I would prefer the current behavior to
applying the fix you are suggesting.

I would be willing to write the arbitrary-precision code so that no
external library need be used, but I might not get to it right away.

...Marvin

-- 
-- 
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/ZATMw7uo9w/xcfcs%40basil.wdw.


Patch 9.0.1381

2023-03-05 Fir de Conversatie Bram Moolenaar


Patch 9.0.1381
Problem:ACCESS_ names have a conflict with on some systems.
Solution:   Rename by prepending VIM_. (Ola Söder, closes #12105)
Files:  src/structs.h, src/eval.c, src/vim9class.c, src/fileio.c


*** ../vim-9.0.1380/src/structs.h   2023-03-03 12:26:11.553759303 +
--- src/structs.h   2023-03-05 13:08:45.088581967 +
***
*** 1469,1477 
  #define TTFLAG_SUPER  0x40// object from "super".
  
  typedef enum {
! ACCESS_PRIVATE,   // read/write only inside th class
! ACCESS_READ,  // read everywhere, write only inside th class
! ACCESS_ALL// read/write everywhere
  } omacc_T;
  
  /*
--- 1469,1477 
  #define TTFLAG_SUPER  0x40// object from "super".
  
  typedef enum {
! VIM_ACCESS_PRIVATE,   // read/write only inside th class
! VIM_ACCESS_READ,  // read everywhere, write only inside th class
! VIM_ACCESS_ALL// read/write everywhere
  } omacc_T;
  
  /*
*** ../vim-9.0.1380/src/eval.c  2023-02-21 19:55:02.795958051 +
--- src/eval.c  2023-03-05 13:06:40.040438088 +
***
*** 1576,1586 
{
switch (om->ocm_access)
{
!   case ACCESS_PRIVATE:

semsg(_(e_cannot_access_private_member_str),
 om->ocm_name);
return NULL;
!   case ACCESS_READ:
if ((flags & GLV_READ_ONLY) == 0)
{

semsg(_(e_member_is_not_writable_str),
--- 1576,1586 
{
switch (om->ocm_access)
{
!   case VIM_ACCESS_PRIVATE:

semsg(_(e_cannot_access_private_member_str),
 om->ocm_name);
return NULL;
!   case VIM_ACCESS_READ:
if ((flags & GLV_READ_ONLY) == 0)
{

semsg(_(e_member_is_not_writable_str),
***
*** 1588,1594 
return NULL;
}
break;
!   case ACCESS_ALL:
break;
}
  
--- 1588,1594 
return NULL;
}
break;
!   case VIM_ACCESS_ALL:
break;
}
  
*** ../vim-9.0.1380/src/vim9class.c 2023-02-25 19:59:27.892421722 +
--- src/vim9class.c 2023-03-05 13:07:20.552488503 +
***
*** 148,155 
return FAIL;
  ocmember_T *m = ((ocmember_T *)gap->ga_data) + gap->ga_len;
  m->ocm_name = vim_strnsave(varname, varname_end - varname);
! m->ocm_access = has_public ? ACCESS_ALL
! : *varname == '_' ? ACCESS_PRIVATE : ACCESS_READ;
  m->ocm_type = type;
  if (init_expr != NULL)
m->ocm_init = init_expr;
--- 148,155 
return FAIL;
  ocmember_T *m = ((ocmember_T *)gap->ga_data) + gap->ga_len;
  m->ocm_name = vim_strnsave(varname, varname_end - varname);
! m->ocm_access = has_public ? VIM_ACCESS_ALL
! : *varname == '_' ? VIM_ACCESS_PRIVATE : VIM_ACCESS_READ;
  m->ocm_type = type;
  if (init_expr != NULL)
m->ocm_init = init_expr;
*** ../vim-9.0.1380/src/fileio.c2023-01-02 16:54:48.932860868 +
--- src/fileio.c2023-03-05 13:07:53.648526904 +
***
*** 3830,3836 
   * original file will be somewhere else so the backup isn't really
   * important. If autoscripting is off the rename may fail.
   */
! flock = Lock((UBYTE *)from, (long)ACCESS_READ);
  #endif
  mch_remove(to);
  #ifdef AMIGA
--- 3830,3836 
   * original file will be somewhere else so the backup isn't really
   * important. If autoscripting is off the rename may fail.
   */
! flock = Lock((UBYTE *)from, (long)VIM_ACCESS_READ);
  #endif
  mch_remove(to);
  #ifdef AMIGA
*** ../vim-9.0.1380/src/version.c   2023-03-04 20:47:32.308617862 +
--- src/version.c   2023-03-05 13:10:42.328688951 +
***
*** 697,698 
--- 697,700 
  {   /* Add new patch number below this line */
+ /**/
+ 1381,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
226. You sit down at the