Re: Patch 8.1.0745

2019-01-15 Thread Tony Mechelynck
On Mon, Jan 14, 2019 at 8:17 PM Bram Moolenaar  wrote:
>
>
> Patch 8.1.0745
> Problem:Compiler warnings for signed/unsigned string.
> Solution:   Remove type casts. (John Marriott)
> Files:  src/ex_docmd.c, src/mbyte.c

After this patch, there is one signedness warning in Small and Tiny
only, as follows. Make doesn't halt and an executable is produced.

linux-2iyu:~/.build/vim/vim-hg/src/shadow-tiny # (make || echo 'exit
status' $? ; date) 2>&1 |tee -a make.log
...
gcc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -fno-strength-reduce -Wall
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1-o objects/ex_docmd.o
ex_docmd.c
ex_docmd.c: In function ‘eval_vars’:
ex_docmd.c:10945:17: warning: pointer targets in assignment differ in
signedness [-Wpointer-sign]
   *errormsg = (char_u *)_("E809: #< is not available without the
+eval feature");
 ^
...
link.sh: Linked fine

-- 
-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: Patch 8.1.0746

2019-01-15 Thread Jason Franklin
All is now right in the Universe.

-- 
-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: Dropping the multi-byte feature?

2019-01-15 Thread Jon Newton
> Note that once condition is that the EBCDIC feature is dropped.  This
> feature makes it possible to compile Vim in EBCDIC mode, which is a
> compile time choice that conflicts with FEAT_MBYTE.  As far as I know
> hardly anyone uses the EBCDIC feature.  The last patch related to EBCDIC
> was Patch 8.0.0173 (I have emailed the reporter of the problem).
> Probably the only system where this is used is on z/OS with Linux.

FYI - Rocket Software maintains a port of Vim 8 to native z/OS (not zLinux).  I 
forwarded this thread to someone involved in the project. 

https://www.rocketsoftware.com/zos-open-source/tools

-- 
-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: Patch 8.1.0745

2019-01-15 Thread Bram Moolenaar


Tony wrote:

> On Mon, Jan 14, 2019 at 8:17 PM Bram Moolenaar  wrote:
> >
> >
> > Patch 8.1.0745
> > Problem:Compiler warnings for signed/unsigned string.
> > Solution:   Remove type casts. (John Marriott)
> > Files:  src/ex_docmd.c, src/mbyte.c
> 
> After this patch, there is one signedness warning in Small and Tiny
> only, as follows. Make doesn't halt and an executable is produced.
> 
> linux-2iyu:~/.build/vim/vim-hg/src/shadow-tiny # (make || echo 'exit
> status' $? ; date) 2>&1 |tee -a make.log
> ...
> gcc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -fno-strength-reduce -Wall
> -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1-o objects/ex_docmd.o
> ex_docmd.c
> ex_docmd.c: In function ‘eval_vars’:
> ex_docmd.c:10945:17: warning: pointer targets in assignment differ in
> signedness [-Wpointer-sign]
>*errormsg = (char_u *)_("E809: #< is not available without the
> +eval feature");
>  ^
> ...

I'll fix it.

-- 
"You mean there really is an answer?"
"Yes! But you're not going to like it!"
"Oh do please tell us!"
"You're really not going to like it!"
"but we MUST know - tell us"
"Alright, the answer is"
"yes..."
"... is ..."
"yes... come on!"
"is 42!"
(Douglas Adams - The Hitchhiker's Guide to the Galaxy)

 /// 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.
For more options, visit https://groups.google.com/d/optout.


Patch 8.1.0752

2019-01-15 Thread Bram Moolenaar


Patch 8.1.0752
Problem:One more compiler warning for signed/unsigned string. (Tony
Mechelynck)
Solution:   Remove type cast.
Files:  src/ex_docmd.c


*** ../vim-8.1.0751/src/ex_docmd.c  2019-01-14 20:16:37.203631334 +0100
--- src/ex_docmd.c  2019-01-15 20:05:22.610400887 +0100
***
*** 10942,10948 
return NULL;
}
  #else
!   *errormsg = (char_u *)_("E809: #< is not available without 
the +eval feature");
return NULL;
  #endif
}
--- 10942,10948 
return NULL;
}
  #else
!   *errormsg = _("E809: #< is not available without the +eval 
feature");
return NULL;
  #endif
}
*** ../vim-8.1.0751/src/version.c   2019-01-14 23:19:26.244853406 +0100
--- src/version.c   2019-01-15 20:06:27.745876032 +0100
***
*** 797,798 
--- 797,800 
  {   /* Add new patch number below this line */
+ /**/
+ 752,
  /**/

-- 
Your mouse has moved.  Windows must be restarted for the change
to take effect.  Reboot now?

 /// 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.
For more options, visit https://groups.google.com/d/optout.


Patch 8.1.0753

2019-01-15 Thread Bram Moolenaar


Patch 8.1.0753
Problem:printf format not checked for semsg().
Solution:   Add GNUC attribute and fix reported problems. (Dominique Pelle,
closes #3805)
Files:  src/buffer.c, src/diff.c, src/eval.c, src/evalfunc.c,
src/ex_docmd.c, src/if_cscope.c, src/netbeans.c, src/proto.h,
src/proto/message.pro, src/quickfix.c, src/regexp_nfa.c,
src/sign.c, src/spellfile.c, src/window.c, src/gui_x11.c


*** ../vim-8.1.0752/src/buffer.c2019-01-13 23:38:33.375773418 +0100
--- src/buffer.c2019-01-15 20:12:27.203089550 +0100
***
*** 1407,1413 
else
  #endif
{
!   semsg(_("E89: No write since last change for buffer %ld (add ! 
to override)"),
 buf->b_fnum);
return FAIL;
}
--- 1407,1413 
else
  #endif
{
!   semsg(_("E89: No write since last change for buffer %d (add ! 
to override)"),
 buf->b_fnum);
return FAIL;
}
***
*** 2283,2289 
if ((options & GETF_ALT) && n == 0)
emsg(_(e_noalt));
else
!   semsg(_("E92: Buffer %ld not found"), n);
return FAIL;
  }
  
--- 2283,2289 
if ((options & GETF_ALT) && n == 0)
emsg(_(e_noalt));
else
!   semsg(_("E92: Buffer %d not found"), n);
return FAIL;
  }
  
*** ../vim-8.1.0752/src/diff.c  2019-01-13 23:38:33.379773390 +0100
--- src/diff.c  2019-01-15 20:12:27.203089550 +0100
***
*** 173,179 
return;
}
  
! semsg(_("E96: Cannot diff more than %ld buffers"), DB_COUNT);
  }
  
  /*
--- 173,179 
return;
}
  
! semsg(_("E96: Cannot diff more than %d buffers"), DB_COUNT);
  }
  
  /*
*** ../vim-8.1.0752/src/eval.c  2019-01-14 22:53:26.750381258 +0100
--- src/eval.c  2019-01-15 20:12:27.207089517 +0100
***
*** 268,274 
  
  /*
   * Sort the function table by function name.
!  * The sorting of the table above is ASCII dependant.
   * On machines using EBCDIC we have to sort it.
   */
  static void
--- 268,274 
  
  /*
   * Sort the function table by function name.
!  * The sorting of the table above is ASCII dependent.
   * On machines using EBCDIC we have to sort it.
   */
  static void
*** ../vim-8.1.0752/src/evalfunc.c  2019-01-13 23:38:33.387773334 +0100
--- src/evalfunc.c  2019-01-15 20:12:27.207089517 +0100
***
*** 8256,8262 
return;
  if (id >= 1 && id <= 3)
  {
!   semsg(_("E798: ID is reserved for \":match\": %ld"), id);
return;
  }
  
--- 8256,8262 
return;
  if (id >= 1 && id <= 3)
  {
!   semsg(_("E798: ID is reserved for \":match\": %d"), id);
return;
  }
  
***
*** 8314,8320 
  /* id == 3 is ok because matchaddpos() is supposed to substitute :3match 
*/
  if (id == 1 || id == 2)
  {
!   semsg(_("E798: ID is reserved for \":match\": %ld"), id);
return;
  }
  
--- 8314,8320 
  /* id == 3 is ok because matchaddpos() is supposed to substitute :3match 
*/
  if (id == 1 || id == 2)
  {
!   semsg(_("E798: ID is reserved for \":match\": %d"), id);
return;
  }
  
*** ../vim-8.1.0752/src/ex_docmd.c  2019-01-15 20:07:44.693265335 +0100
--- src/ex_docmd.c  2019-01-15 20:12:31.131059874 +0100
***
*** 1347,1353 
}
else if (p != NULL)
{
!   semsg(p);
vim_free(p);
}
vim_free(sourcing_name);
--- 1347,1353 
}
else if (p != NULL)
{
!   emsg(p);
vim_free(p);
}
vim_free(sourcing_name);
***
*** 5788,5795 
return FAIL;
}
  #endif
!   semsg(NGETTEXT("E173: %ld more file to edit",
!   "E173: %ld more files to edit", n), n);
quitmore = 2;   /* next try to quit is allowed */
}
return FAIL;
--- 5788,5795 
return FAIL;
}
  #endif
!   semsg(NGETTEXT("E173: %d more file to edit",
!   "E173: %d more files to edit", n), n);
quitmore = 2;   /* next try to quit is allowed */
}
return FAIL;
***
*** 6958,6964 
}
}
  
!   /* break if there no  is found */
if (start == NULL || end == NULL)
break;
  
--- 6958,6964 
}
}
  
!   /* break if no  is found */
if (start == NULL || end == NULL)
break;
  
***
*** 8022,8028 
  /*
   * Handle a file drop. The 

Patch 8.1.0754

2019-01-15 Thread Bram Moolenaar


Patch 8.1.0754
Problem:Preferred column is lost when setting 'cursorcolumn'.
Solution:   Change option flag to P_RWINONLY. (Takayuki Kurosawa,
closes #3806)
Files:  src/option.c, src/testdir/test_cursor_func.vim


*** ../vim-8.1.0753/src/option.c2019-01-13 23:50:56.358162250 +0100
--- src/option.c2019-01-15 21:10:37.747224757 +0100
***
*** 989,995 
  {"cursorbind",  "crb",  P_BOOL|P_VI_DEF,
(char_u *)VAR_WIN, PV_CRBIND,
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
! {"cursorcolumn", "cuc", P_BOOL|P_VI_DEF|P_RWIN,
  #ifdef FEAT_SYN_HL
(char_u *)VAR_WIN, PV_CUC,
  #else
--- 989,995 
  {"cursorbind",  "crb",  P_BOOL|P_VI_DEF,
(char_u *)VAR_WIN, PV_CRBIND,
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
! {"cursorcolumn", "cuc", P_BOOL|P_VI_DEF|P_RWINONLY,
  #ifdef FEAT_SYN_HL
(char_u *)VAR_WIN, PV_CUC,
  #else
*** ../vim-8.1.0753/src/testdir/test_cursor_func.vim2017-03-18 
19:49:16.0 +0100
--- src/testdir/test_cursor_func.vim2019-01-15 21:08:08.320369420 +0100
***
*** 46,48 
--- 46,68 
quit!
  endfunc
  
+ " Tests for behavior of curswant with cursorcolumn/line
+ func Test_curswant_with_cursorcolumn()
+   new
+   call setline(1, ['01234567', ''])
+   exe "normal! ggf6j"
+   call assert_equal(6, winsaveview().curswant)
+   set cursorcolumn
+   call assert_equal(6, winsaveview().curswant)
+   quit!
+ endfunc
+ 
+ func Test_curswant_with_cursorline()
+   new
+   call setline(1, ['01234567', ''])
+   exe "normal! ggf6j"
+   call assert_equal(6, winsaveview().curswant)
+   set cursorline
+   call assert_equal(6, winsaveview().curswant)
+   quit!
+ endfunc
*** ../vim-8.1.0753/src/version.c   2019-01-15 20:19:36.747904404 +0100
--- src/version.c   2019-01-15 21:12:04.794604307 +0100
***
*** 797,798 
--- 797,800 
  {   /* Add new patch number below this line */
+ /**/
+ 754,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
214. Your MCI "Circle of Friends" are all Hayes-compatible.

 /// 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.
For more options, visit https://groups.google.com/d/optout.


Patch 8.1.0755

2019-01-15 Thread Bram Moolenaar


Patch 8.1.0755
Problem:Error message for get() on a Blob with invalid index.
Solution:   Return an empty Blob, like get() on a List does.
Files:  src/evalfunc.c, src/testdir/test_blob.vim


*** ../vim-8.1.0754/src/evalfunc.c  2019-01-15 20:19:36.743904434 +0100
--- src/evalfunc.c  2019-01-15 22:13:20.055796887 +0100
***
*** 4408,4417 
if (!error)
{
rettv->v_type = VAR_NUMBER;
!   if (idx >= blob_len(argvars[0].vval.v_blob))
!   semsg(_(e_blobidx), idx);
else
rettv->vval.v_number = blob_get(argvars[0].vval.v_blob, idx);
}
  }
  else if (argvars[0].v_type == VAR_LIST)
--- 4408,4422 
if (!error)
{
rettv->v_type = VAR_NUMBER;
!   if (idx < 0)
!   idx = blob_len(argvars[0].vval.v_blob) + idx;
!   if (idx < 0 || idx >= blob_len(argvars[0].vval.v_blob))
!   rettv->vval.v_number = -1;
else
+   {
rettv->vval.v_number = blob_get(argvars[0].vval.v_blob, idx);
+   tv = rettv;
+   }
}
  }
  else if (argvars[0].v_type == VAR_LIST)
*** ../vim-8.1.0754/src/testdir/test_blob.vim   2019-01-13 19:10:28.959419929 
+0100
--- src/testdir/test_blob.vim   2019-01-15 22:15:19.930912344 +0100
***
*** 20,26 
  
call assert_equal(0xDE, get(b, 0))
call assert_equal(0xEF, get(b, 3))
-   call assert_fails('let x = get(b, 4)')
  
call assert_fails('let b = 0z1', 'E973:')
call assert_fails('let b = 0z1x', 'E973:')
--- 20,25 
***
*** 79,84 
--- 78,95 
call assert_equal(0z, b[5:6])
  endfunc
  
+ func Test_blob_get()
+   let b = 0z0011223344
+   call assert_equal(0x00, get(b, 0))
+   call assert_equal(0x22, get(b, 2, 999))
+   call assert_equal(0x44, get(b, 4))
+   call assert_equal(0x44, get(b, -1))
+   call assert_equal(-1, get(b, 5))
+   call assert_equal(999, get(b, 5, 999))
+   call assert_equal(-1, get(b, -8))
+   call assert_equal(999, get(b, -8, 999))
+ endfunc
+ 
  func Test_blob_to_string()
let b = 0zDEADBEEF
call assert_equal('[0xDE,0xAD,0xBE,0xEF]', string(b))
*** ../vim-8.1.0754/src/version.c   2019-01-15 21:12:53.602254042 +0100
--- src/version.c   2019-01-15 22:15:52.206674053 +0100
***
*** 797,798 
--- 797,800 
  {   /* Add new patch number below this line */
+ /**/
+ 755,
  /**/

-- 
'Psychologist' -- Someone who looks at everyone else when
an attractive woman enters the room.

 /// 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.
For more options, visit https://groups.google.com/d/optout.


Patch 8.1.0756

2019-01-15 Thread Bram Moolenaar


Patch 8.1.0756
Problem:copy() does not make a copy of a Blob.
Solution:   Make a copy.
Files:  src/eval.c, src/testdir/test_blob.vim


*** ../vim-8.1.0755/src/eval.c  2019-01-15 20:19:36.739904461 +0100
--- src/eval.c  2019-01-15 22:41:46.940261209 +0100
***
*** 8198,8204 
case VAR_SPECIAL:
case VAR_JOB:
case VAR_CHANNEL:
-   case VAR_BLOB:
copy_tv(from, to);
break;
case VAR_LIST:
--- 8198,8203 
***
*** 8217,8222 
--- 8216,8236 
if (to->vval.v_list == NULL)
ret = FAIL;
break;
+   case VAR_BLOB:
+   to->v_type = VAR_BLOB;
+   if (from->vval.v_blob == NULL)
+   to->vval.v_blob = NULL;
+   else if (rettv_blob_alloc(to) == FAIL)
+   ret = FAIL;
+   else
+   {
+   int  len = from->vval.v_blob->bv_ga.ga_len;
+ 
+   to->vval.v_blob->bv_ga.ga_data =
+   vim_memsave(from->vval.v_blob->bv_ga.ga_data, len);
+   to->vval.v_blob->bv_ga.ga_len = len;
+   }
+   break;
case VAR_DICT:
to->v_type = VAR_DICT;
to->v_lock = 0;
*** ../vim-8.1.0755/src/testdir/test_blob.vim   2019-01-15 22:16:37.414340200 
+0100
--- src/testdir/test_blob.vim   2019-01-15 22:34:42.983215061 +0100
***
*** 112,118 
--- 112,125 
  
call assert_false(b1 is b2)
let b2 = b1
+   call assert_true(b1 == b2)
call assert_true(b1 is b2)
+   let b2 = copy(b1)
+   call assert_true(b1 == b2)
+   call assert_false(b1 is b2)
+   let b2 = b1[:]
+   call assert_true(b1 == b2)
+   call assert_false(b1 is b2)
  
call assert_fails('let x = b1 > b2')
call assert_fails('let x = b1 < b2')
*** ../vim-8.1.0755/src/version.c   2019-01-15 22:16:37.418340170 +0100
--- src/version.c   2019-01-15 22:43:53.431371171 +0100
***
*** 797,798 
--- 797,800 
  {   /* Add new patch number below this line */
+ /**/
+ 756,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
217. Your sex life has drastically improved...so what if it's only cyber-sex!

 /// 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.
For more options, visit https://groups.google.com/d/optout.


Patch 8.1.0757

2019-01-15 Thread Bram Moolenaar


Patch 8.1.0757
Problem:Not enough documentation for Blobs.
Solution:   Add a section about Blobs.
Files:  runtime/doc/eval.txt


*** ../vim-8.1.0756/runtime/doc/eval.txt2019-01-13 15:15:54.388762907 
+0100
--- runtime/doc/eval.txt2019-01-15 22:48:29.185422882 +0100
***
*** 17,23 
  1.2 Function references   |Funcref|
  1.3 Lists |Lists|
  1.4 Dictionaries  |Dictionaries|
! 1.5 More about variables  |more-variables|
  2.  Expression syntax |expression-syntax|
  3.  Internal variable |internal-variables|
  4.  Builtin Functions |functions|
--- 17,24 
  1.2 Function references   |Funcref|
  1.3 Lists |Lists|
  1.4 Dictionaries  |Dictionaries|
! 1.5 Blobs |Blobs|
! 1.6 More about variables  |more-variables|
  2.  Expression syntax |expression-syntax|
  3.  Internal variable |internal-variables|
  4.  Builtin Functions |functions|
***
*** 53,59 
  StringA NUL terminated string of 8-bit unsigned characters 
(bytes).
|expr-string| Examples: "ab\txx\"--"  'x-z''a,c'
  
! List  An ordered sequence of items |List|.
Example: [1, 2, ['a', 'b']]
  
  DictionaryAn associative, unordered array: Each entry has a key and a
--- 54,60 
  StringA NUL terminated string of 8-bit unsigned characters 
(bytes).
|expr-string| Examples: "ab\txx\"--"  'x-z''a,c'
  
! List  An ordered sequence of items, see |List| for details.
Example: [1, 2, ['a', 'b']]
  
  DictionaryAn associative, unordered array: Each entry has a key and a
***
*** 72,78 
  
  Channel   Used for a channel, see |ch_open()|. *Channel* 
*Channels*
  
! Blob  Binary Large Object. Stores any sequence of bytes. *Blob*
Example: 0zFF00ED015DAF
0z is an empty Blob.
  
--- 73,80 
  
  Channel   Used for a channel, see |ch_open()|. *Channel* 
*Channels*
  
! Blob  Binary Large Object. Stores any sequence of bytes.  See |Blob|
!   for details
Example: 0zFF00ED015DAF
0z is an empty Blob.
  
***
*** 621,627 
:call map(dict, '">> " . v:val')  " prepend ">> " to each item
  
  
! 1.5 More about variables ~
*more-variables*
  If you need to know the type of a variable or expression, use the |type()|
  function.
--- 623,744 
:call map(dict, '">> " . v:val')  " prepend ">> " to each item
  
  
! 1.5 Blobs ~
!   *blob* *Blob* *Blobs* *E978*
! A Blob mostly behaves like a |List| of numbers, where the numbers have an
! 8-bit value, from 0 to 255.
! 
! 
! Blob creation ~
! 
! A Blob can be created with a |blob-literal|: >
!   :let b = 0zFF00ED015DAF
! 
! A blob can be read from a file with |readfile()| passing the {type} argument
! set to "B", for example: >
!   :let b = readfile('image.png', 'B')
! 
! A blob can be read from a channel with the |ch_readblob()| function.
! 
! 
! Blob index ~
!   *blob-index* *E979*
! A byte in the Blob can be accessed by putting the index in square brackets
! after the Blob.  Indexes are zero-based, thus the first byte has index zero. >
!   :let myblob = 0z00112233
!   :let byte = myblob[0]   " get the first byte: 0x00
!   :let byte = myblob[2]   " get the third byte: 0x22
! 
! A negative index is counted from the end.  Index -1 refers to the last byte in
! the Blob, -2 to the last but one byte, etc. >
!   :let last = myblob[-1]  " get the last byte: 0x33
! 
! To avoid an error for an invalid index use the |get()| function.  When an item
! is not available it returns -1 or the default value you specify: >
!   :echo get(myblob, idx)
!   :echo get(myblob, idx, 999)
! 
! 
! Blob concatenation ~
! 
! Two blobs can be concatenated with the "+" operator: >
!   :let longblob = myblob + 0z4455
!   :let myblob += 0z6677
! 
! To change a blob in-place see |blob-modification| below.
! 
! 
! Part of a blob ~
! 
! A part of the Blob can be obtained by specifying the first and last index,
! separated by a colon in square brackets: >
!   :let myblob = 0z00112233
!   :let shortblob = myblob[2:-1]   " get 0z2233
! 
! Omitting the first index is similar to zero.  Omitting the last index is
! similar to -1. >
!   :let endblob = myblob[2:]   " from item 2 to the end: 0z2233
!   :let shortblob = myblob[2:2]" Blob with one byte: 0z22
!   :let otherblob = myblob[:]  " make a copy of the Blob
! 
! If the first index is beyond the last byte of the Blob or the second by

Re: Patch 8.1.0757

2019-01-15 Thread Tony Mechelynck
On Tue, Jan 15, 2019 at 10:52 PM Bram Moolenaar  wrote:
>
>
> Patch 8.1.0757
> Problem:Not enough documentation for Blobs.
> Solution:   Add a section about Blobs.
> Files:  runtime/doc/eval.txt

Ah, this is much better.

I suppose the item at todo.txt lines 142-143 can now be removed.

I noticed one typo: at eval.txt line 1146:
:let bs = b[]" copy ov 0zDEADBEEF
"ov" should of course be "of".

Best regards,
Tony.

-- 
-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: Patch 8.1.0757

2019-01-15 Thread Tom M
Hi!

I see a typo and have some questions:

> ! To change a sequence of bytes the [:] notation can be used: >
> ! let blob[1:3] = 0z445566
> ! The length of the replaced bytes much be exactly the same as the value

Typo: much -> must

> ! To change part of a blob you can specify the first and last byte to be
> ! modified.  The value must at least have the number of bytes in the
range: >
> ! :let blob[3:5] = [3, 4, 5]

Suddenly it's possible to specify longer sequences? The paragraph above
prohibits this.
Or is this paragraph a copy-paste leftover? Except for the length thing it
seems to say almost the same thing as the previous one.
Also the example uses a list as a replacement value, not a blob. Is it
intentional? What if the list contains something other than what fits in
bytes?

> + < *blob-identity* *E977*
> + When variable "aa" is a Blob and you assign it to another variable
"bb", both
> + variables refer to the same Blob.  Then the "is" operator returns true.
> +
> + When making a copy using [:] or |copy()| the values are the same, but
the
> + identity is different: >
> + :let blob = 0z112233
> + :let blob2 = blob
> + :echo blob == blob2
> + < 1 >
> + :echo blob is blob2
> + < 1 >
> + :let blob3 = blob[:]
> + :echo blob == blob3
> + < 1 >
> + :echo blob is blob3
> + < 0
> +
> + ! Making a copy of a list is done with the |copy()| function.  Using
[:] also
> + ! works, as explained above.

Wasn't this meant to say "copy of a blob" instead of "copy of a list"?

Thanks.

Tom

-- 
-- 
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.
For more options, visit https://groups.google.com/d/optout.


changes to runtime/doc/eval.txt

2019-01-15 Thread Dominique Pellé
Hi

Attached patch contains a few changes
to runtime/doc/eval.txt.

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.
For more options, visit https://groups.google.com/d/optout.
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 6e9ff7ca0..966f4502f 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -786,21 +786,21 @@ Expression syntax summary, from least to most significant:
 
 	expr5 ==? expr5		equal, ignoring case
 	expr5 ==# expr5		equal, match case
 	etc.			As above, append ? for ignoring case, # for
 matching case
 
 	expr5 is expr5		same |List| instance
 	expr5 isnot expr5	different |List| instance
 
 |expr5|	expr6
-	expr6 +	 expr6 ..	number addition or list concatenation
+	expr6 +	 expr6 ..	number addition, list or blob concatenation
 	expr6 -	 expr6 ..	number subtraction
 	expr6 .	 expr6 ..	string concatenation
 
 |expr6|	expr7
 	expr7 *	 expr7 ..	number multiplication
 	expr7 /	 expr7 ..	number division
 	expr7 %	 expr7 ..	number modulo
 
 |expr7|	expr8
 	! expr7			logical NOT
@@ -5876,20 +5876,22 @@ js_encode({expr})	*js_encode()*
 		than JSON, especially when using an array with optional items.
 
 
 json_decode({string})	*json_decode()*
 		This parses a JSON formatted string and returns the equivalent
 		in Vim values.  See |json_encode()| for the relation between
 		JSON and Vim values.
 		The decoding is permissive:
 		- A trailing comma in an array and object is ignored, e.g.
 		  "[1, 2, ]" is the same as "[1, 2]".
+		- Integer keys are accepted in objects, e.g. {1:2} is the
+		  same as {'1':2}.
 		- More floating point numbers are recognized, e.g. "1." for
 		  "1.0", or "001.2" for "1.2". Special floating point values
 		  "Infinity", "-Infinity" and "NaN" (capitalization ignored)
 		  are accepted.
 		- Leading zeroes in integer numbers are ignored, e.g. "012"
 		  for "12" or "-012" for "-12".
 		- Capitalization is ignored in literal names null, true or
 		  false, e.g. "NULL" for "null", "True" for "true".
 		- Control characters U+ through U+001F which are not
 		  escaped in strings are accepted, e.g. "	" (tab
@@ -5934,20 +5936,21 @@ json_encode({expr})	*json_encode()*
 keys({dict})		*keys()*
 		Return a |List| with all the keys of {dict}.  The |List| is in
 		arbitrary order.
 
 			*len()* *E701*
 len({expr})	The result is a Number, which is the length of the argument.
 		When {expr} is a String or a Number the length in bytes is
 		used, as with |strlen()|.
 		When {expr} is a |List| the number of items in the |List| is
 		returned.
+		When {expr} is a Blob the number of bytes is returned.
 		When {expr} is a |Dictionary| the number of entries in the
 		|Dictionary| is returned.
 		Otherwise an error is given.
 
 		*libcall()* *E364* *E368*
 libcall({libname}, {funcname}, {argument})
 		Call function {funcname} in the run-time library {libname}
 		with single argument {argument}.
 		This is useful to call functions in a library that you
 		especially made to be used with Vim.  Since only one argument


Re: changes to runtime/doc/eval.txt

2019-01-15 Thread ktakata65536
Hi Dominique,

2019/1/16 Wed 12:08:56 UTC+9 Dominique Pelle wrote:
> Hi
> 
> Attached patch contains a few changes
> to runtime/doc/eval.txt.

> + When {expr} is a Blob the number of bytes is returned.

+   When {expr} is a |Blob| the number of bytes is returned.

Adding a link might be better, I think.

Regards,
Ken Takata

-- 
-- 
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.
For more options, visit https://groups.google.com/d/optout.