Re: Patch 9.0.0072

2022-07-25 Fir de Conversatie Tony Mechelynck
On Mon, Jul 25, 2022 at 10:16 PM Bram Moolenaar  wrote:
>
>
> Patch 9.0.0072 (after 9.0.0067)
> Problem:Compiler warning for uninitialized variable.
> Solution:   Initialize it. (John Marriott)
> Files:  src/drawline.c

After this patch, I get a new warning in Big and Huge only, as follows:

gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK
-I/usr/include/gtk-3.0 -I/usr/include/pango-1.0
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
-I/usr/include/harfbuzz -I/usr/include/freetype2
-I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi
-I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng16
-I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0
-I/usr/include/wayland -I/usr/include/libxkbcommon
-I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0
-I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include
-I/usr/include/at-spi-2.0 -pthread-O2 -fno-strength-reduce -Wall
-Wno-deprecated-declarations  -D_REENTRANT  -U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=1-o objects/drawline.o drawline.c
drawline.c: In function ‘win_line’:
drawline.c:1541:35: warning: ‘used_tpi’ may be used uninitialized
[-Wmaybe-uninitialized]
 1541 | text_props[used_tpi].tp_id = -MAXCOL;
  |   ^
drawline.c:1489:25: note: ‘used_tpi’ was declared here
 1489 | int used_tpi;
  | ^~~~


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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAJkCKXtCXkj6UxCLVEZmx_O6Hgrh0DjfMwCN2-f_iTbVGhgZ5Q%40mail.gmail.com.


Re: Warning in drawline.c after applying patches 9.0.67 to 71

2022-07-25 Fir de Conversatie Bram Moolenaar


> The following (as shown for Big) also appears in Huge build:
> 
> gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK
> -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0
> -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
> -I/usr/include/harfbuzz -I/usr/include/freetype2
> -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi
> -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng16
> -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0
> -I/usr/include/wayland -I/usr/include/libxkbcommon
> -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0
> -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include
> -I/usr/include/at-spi-2.0 -pthread-O2 -fno-strength-reduce -Wall
> -Wno-deprecated-declarations  -D_REENTRANT  -U_FORTIFY_SOURCE
> -D_FORTIFY_SOURCE=3D1-o objects/drawline.o drawline.c
> drawline.c: In function =E2=80=98win_line=E2=80=99:
> drawline.c:858:16: warning: =E2=80=98charsize=E2=80=99 may be used uninitia=
> lized
> [-Wmaybe-uninitialized]
>   858 | if (( (*mb_ptr2cells)(ptr) >=3D charsize || *ptr =3D=3D
> TAB) && col =3D=3D 0)
>   |^
> drawline.c:822:25: note: =E2=80=98charsize=E2=80=99 was declared here
>   822 | int charsize;
>   | ^~~~
> drawline.c:1541:35: warning: =E2=80=98used_tpi=E2=80=99 may be used uniniti=
> alized
> [-Wmaybe-uninitialized]
>  1541 | text_props[used_tpi].tp_id =3D -MAXCOL;
>   |   ^
> drawline.c:1489:25: note: =E2=80=98used_tpi=E2=80=99 was declared here
>  1489 | int used_tpi;
>   | ^~~~

Should be fixed by patch 9.0.0072 

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?

 /// 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/20220725210123.2E4D21C065D%40moolenaar.net.


Patch 9.0.0073

2022-07-25 Fir de Conversatie Bram Moolenaar


Patch 9.0.0073
Problem:Too many files recognized as bsdl.
Solution:   Use pattern "*.bsd" instead of "*bsd". (Martin Tournoij,
closes #10783)
Files:  runtime/filetype.vim, src/testdir/test_filetype.vim


*** ../vim-9.0.0072/runtime/filetype.vim2022-07-16 17:46:41.673744844 
+0100
--- runtime/filetype.vim2022-07-25 21:39:31.941515248 +0100
***
*** 259,265 
  au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old   setf xml
  
  " BSDL
! au BufNewFile,BufRead *bsd,*.bsdl setf bsdl
  
  " Bazel (http://bazel.io)
  autocmd BufRead,BufNewFile *.bzl,*.bazel,WORKSPACEsetf bzl
--- 259,265 
  au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old   setf xml
  
  " BSDL
! au BufNewFile,BufRead *.bsd,*.bsdlsetf bsdl
  
  " Bazel (http://bazel.io)
  autocmd BufRead,BufNewFile *.bzl,*.bazel,WORKSPACEsetf bzl
*** ../vim-9.0.0072/src/testdir/test_filetype.vim   2022-07-16 
17:46:41.673744844 +0100
--- src/testdir/test_filetype.vim   2022-07-25 21:38:54.397619519 +0100
***
*** 43,49 
--- 43,51 
  endfunc
  
  " Filetypes detected just from matching the file name.
+ " First one is checking that these files have no filetype.
  let s:filename_checks = {
+ \ 'none': ['bsd', 'some-bsd'],
  \ '8th': ['file.8th'],
  \ 'a2ps': ['/etc/a2ps.cfg', '/etc/a2ps/file.cfg', 'a2psrc', '.a2psrc', 
'any/etc/a2ps.cfg', 'any/etc/a2ps/file.cfg'],
  \ 'a65': ['file.a65'],
***
*** 85,91 
  \ 'bindzone': ['named.root', '/bind/db.file', '/named/db.file', 
'any/bind/db.file', 'any/named/db.file'],
  \ 'bitbake': ['file.bb', 'file.bbappend', 'file.bbclass', 
'build/conf/local.conf', 'meta/conf/layer.conf', 'build/conf/bbappend.conf', 
'meta-layer/conf/distro/foo.conf'],
  \ 'blank': ['file.bl'],
! \ 'bsdl': ['file.bsd', 'file.bsdl', 'bsd', 'some-bsd'],
  \ 'bst': ['file.bst'],
  \ 'bzl': ['file.bazel', 'file.bzl', 'WORKSPACE'],
  \ 'bzr': ['bzr_log.any', 'bzr_log.file'],
--- 87,93 
  \ 'bindzone': ['named.root', '/bind/db.file', '/named/db.file', 
'any/bind/db.file', 'any/named/db.file'],
  \ 'bitbake': ['file.bb', 'file.bbappend', 'file.bbclass', 
'build/conf/local.conf', 'meta/conf/layer.conf', 'build/conf/bbappend.conf', 
'meta-layer/conf/distro/foo.conf'],
  \ 'blank': ['file.bl'],
! \ 'bsdl': ['file.bsd', 'file.bsdl'],
  \ 'bst': ['file.bst'],
  \ 'bzl': ['file.bazel', 'file.bzl', 'WORKSPACE'],
  \ 'bzr': ['bzr_log.any', 'bzr_log.file'],
***
*** 648,654 
if &filetype == '' && &readonly
" File exists but not able to edit it (permission denied)
else
!   call assert_equal(ft, &filetype, 'with file name: ' . names[i])
endif
bwipe!
  endfor
--- 650,657 
if &filetype == '' && &readonly
" File exists but not able to edit it (permission denied)
else
! let expected = ft == 'none' ? '' : ft
!   call assert_equal(expected, &filetype, 'with file name: ' . names[i])
endif
bwipe!
  endfor
*** ../vim-9.0.0072/src/version.c   2022-07-25 21:15:40.878155498 +0100
--- src/version.c   2022-07-25 21:30:35.219415312 +0100
***
*** 737,738 
--- 737,740 
  {   /* Add new patch number below this line */
+ /**/
+ 73,
  /**/

-- 
I have a watch cat! Just break in and she'll watch.

 /// 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/20220725204047.4F1971C065D%40moolenaar.net.


Patch 9.0.0072

2022-07-25 Fir de Conversatie Bram Moolenaar


Patch 9.0.0072 (after 9.0.0067)
Problem:Compiler warning for uninitialized variable.
Solution:   Initialize it. (John Marriott)
Files:  src/drawline.c


*** ../vim-9.0.0071/src/drawline.c  2022-07-25 18:13:33.046580756 +0100
--- src/drawline.c  2022-07-25 21:11:49.462293072 +0100
***
*** 819,825 
  {
char_u  *prev_ptr = ptr;
chartabsize_T   cts;
!   int charsize;
  
init_chartabsize_arg(&cts, wp, lnum, vcol, line, ptr);
while (cts.cts_vcol < v && *cts.cts_ptr != NUL)
--- 819,825 
  {
char_u  *prev_ptr = ptr;
chartabsize_T   cts;
!   int charsize = 0;
  
init_chartabsize_arg(&cts, wp, lnum, vcol, line, ptr);
while (cts.cts_vcol < v && *cts.cts_ptr != NUL)
*** ../vim-9.0.0071/src/version.c   2022-07-25 19:50:53.954361274 +0100
--- src/version.c   2022-07-25 21:12:53.046258579 +0100
***
*** 737,738 
--- 737,740 
  {   /* Add new patch number below this line */
+ /**/
+ 72,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
124. You begin conversations with, "Who is your internet service provider?"

 /// 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/20220725201613.530DB1C066C%40moolenaar.net.


Re: Patch 9.0.0067

2022-07-25 Fir de Conversatie Bram Moolenaar


John Marriott wrote:

> On 26-July-2022 03:14, Bram Moolenaar wrote:
> > Patch 9.0.0067
> > Problem:Cannot show virtual text.
> > Solution:   Initial changes for virtual text support, using text properti=
> es.
> > Files:  runtime/doc/textprop.txt, src/beval.c, src/charset.c,
> >  src/drawline.c, src/edit.c, src/errors.h, src/evalfunc.c,
> >  src/getchar.c, src/indent.c, src/misc1.c, src/misc2.c,
> >  src/mouse.c, src/ops.c, src/popupwin.c, src/proto/charset.pro,
> >  src/proto/textprop.pro, src/regexp.c, src/regexp_bt.c,
> >  src/regexp_nfa.c, src/register.c, src/structs.h, 
> > src/textprop.c,
> >  src/testdir/test_textprop.vim,
> >  src/testdir/dumps/Test_prop_inserts_text.dump
> >
> >
> After this patch, mingw64 (gcc 12.1.0) gives this warning:
> 
> gcc -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 
> -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO 
> -pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return 
> -fpie -fPIE -DFEAT_GUI_MSWIN -DFEAT_CLIPBOARD drawline.c -o 
> gobjnative/drawline.o
> drawline.c:858:16: warning: 'charsize' may be used uninitialized 
> [-Wmaybe-uninitialized]
>    858 | if (( (*mb_ptr2cells)(ptr) >= charsize || *ptr == 
> TAB) && col == 0)
>    |    ^
> drawline.c:822:25: note: 'charsize' was declared here
>    822 | int charsize;
>    | ^~~~
> 
> 
> The attached patch tries to fix it.

Thanks, I'll include it.

-- 
Would you care for a drink?   I mean, if it were, like,
disabled and you had to look after it?

 /// 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/20220725201613.4E7C31C065D%40moolenaar.net.


Re: Patch 9.0.0067

2022-07-25 Fir de Conversatie John Marriott


On 26-July-2022 03:14, Bram Moolenaar wrote:

Patch 9.0.0067
Problem:Cannot show virtual text.
Solution:   Initial changes for virtual text support, using text properties.
Files:  runtime/doc/textprop.txt, src/beval.c, src/charset.c,
 src/drawline.c, src/edit.c, src/errors.h, src/evalfunc.c,
 src/getchar.c, src/indent.c, src/misc1.c, src/misc2.c,
 src/mouse.c, src/ops.c, src/popupwin.c, src/proto/charset.pro,
 src/proto/textprop.pro, src/regexp.c, src/regexp_bt.c,
 src/regexp_nfa.c, src/register.c, src/structs.h, src/textprop.c,
 src/testdir/test_textprop.vim,
 src/testdir/dumps/Test_prop_inserts_text.dump



After this patch, mingw64 (gcc 12.1.0) gives this warning:

gcc -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 
-DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO 
-pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return 
-fpie -fPIE -DFEAT_GUI_MSWIN -DFEAT_CLIPBOARD drawline.c -o 
gobjnative/drawline.o
drawline.c:858:16: warning: 'charsize' may be used uninitialized 
[-Wmaybe-uninitialized]
  858 | if (( (*mb_ptr2cells)(ptr) >= charsize || *ptr == 
TAB) && col == 0)

  |    ^
drawline.c:822:25: note: 'charsize' was declared here
  822 | int charsize;
  | ^~~~


The attached patch tries to fix it.

Cheers
John

--
--
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/93c98f39-974f-e785-f4b9-b073b9b75d52%40internode.on.net.
--- drawline.c.orig 2022-07-26 05:56:43.552462500 +1000
+++ drawline.c  2022-07-26 06:02:55.006725800 +1000
@@ -819,7 +819,7 @@
 {
char_u  *prev_ptr = ptr;
chartabsize_T   cts;
-   int charsize;
+   int charsize = 0;
 
init_chartabsize_arg(&cts, wp, lnum, vcol, line, ptr);
while (cts.cts_vcol < v && *cts.cts_ptr != NUL)


Warning in drawline.c after applying patches 9.0.67 to 71

2022-07-25 Fir de Conversatie Tony Mechelynck
The following (as shown for Big) also appears in Huge build:

gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK
-I/usr/include/gtk-3.0 -I/usr/include/pango-1.0
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include
-I/usr/include/harfbuzz -I/usr/include/freetype2
-I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi
-I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng16
-I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gio-unix-2.0
-I/usr/include/wayland -I/usr/include/libxkbcommon
-I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0
-I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include
-I/usr/include/at-spi-2.0 -pthread-O2 -fno-strength-reduce -Wall
-Wno-deprecated-declarations  -D_REENTRANT  -U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=1-o objects/drawline.o drawline.c
drawline.c: In function ‘win_line’:
drawline.c:858:16: warning: ‘charsize’ may be used uninitialized
[-Wmaybe-uninitialized]
  858 | if (( (*mb_ptr2cells)(ptr) >= charsize || *ptr ==
TAB) && col == 0)
  |^
drawline.c:822:25: note: ‘charsize’ was declared here
  822 | int charsize;
  | ^~~~
drawline.c:1541:35: warning: ‘used_tpi’ may be used uninitialized
[-Wmaybe-uninitialized]
 1541 | text_props[used_tpi].tp_id = -MAXCOL;
  |   ^
drawline.c:1489:25: note: ‘used_tpi’ was declared here
 1489 | int used_tpi;
  | ^~~~


Normal has only the first of these (for line 858) but not the other
(for line 1541).
Tiny and Small have a different warning:

gcc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -fno-strength-reduce -Wall
-Wno-deprecated-declarations -D_REENTRANT -U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=1-o objects/drawline.o drawline.c
drawline.c: In function ‘win_line’:
drawline.c:854:18: warning: ‘charsize’ may be used uninitialized
[-Wmaybe-uninitialized]
  854 | vcol -= charsize;
  |  ^~
drawline.c:822:25: note: ‘charsize’ was declared here
  822 | int charsize;
  | ^~~~


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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/CAJkCKXuu9V_Fv7xVvQrgG8DeYkfebYt5FhX0qtnu%3DGYy0D8GBA%40mail.gmail.com.


Patch 9.0.0071

2022-07-25 Fir de Conversatie Bram Moolenaar


Patch 9.0.0071
Problem:Command overlaps with printed text in scrollback.
Solution:   Clear until end-of-line and use correct message chunk.
(closes #10765, closes #10764)
Files:  src/message.c, src/testdir/test_messages.vim


*** ../vim-9.0.0070/src/message.c   2022-07-06 13:31:25.295370106 +0100
--- src/message.c   2022-07-25 19:47:23.315432093 +0100
***
*** 2595,2600 
--- 2595,2601 
  sb_text_end_cmdline(void)
  {
  do_clear_sb_text = SB_CLEAR_CMDLINE_DONE;
+ msg_sb_eol();
  }
  
  /*
***
*** 2614,2620 
  {
if (last_msgchunk == NULL)
return;
!   lastp = &last_msgchunk->sb_prev;
  }
  
  while (*lastp != NULL)
--- 2615,2621 
  {
if (last_msgchunk == NULL)
return;
!   lastp = &msg_sb_start(last_msgchunk)->sb_prev;
  }
  
  while (*lastp != NULL)
*** ../vim-9.0.0070/src/testdir/test_messages.vim   2022-03-16 
11:09:57.0 +
--- src/testdir/test_messages.vim   2022-07-25 19:47:23.315432093 +0100
***
*** 233,239 
  
" Up all the way with 'g'.
call term_sendkeys(buf, 'g')
!   call WaitForAssert({-> assert_equal('  5 5', term_getline(buf, 5))})
call WaitForAssert({-> assert_equal('-- More --', term_getline(buf, 6))})
  
" All the way down. Pressing f should do nothing but pressing
--- 233,240 
  
" Up all the way with 'g'.
call term_sendkeys(buf, 'g')
!   call WaitForAssert({-> assert_equal('  4 4', term_getline(buf, 5))})
!   call WaitForAssert({-> assert_equal(':%p#', term_getline(buf, 1))})
call WaitForAssert({-> assert_equal('-- More --', term_getline(buf, 6))})
  
" All the way down. Pressing f should do nothing but pressing
*** ../vim-9.0.0070/src/version.c   2022-07-25 19:41:58.713627693 +0100
--- src/version.c   2022-07-25 19:49:04.014894379 +0100
***
*** 737,738 
--- 737,740 
  {   /* Add new patch number below this line */
+ /**/
+ 71,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
122. You ask if the Netaholics Anonymous t-shirt you ordered can be
 sent to you via e-mail.

 /// 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/20220725185122.1FD3A1C065D%40moolenaar.net.


Patch 9.0.0070

2022-07-25 Fir de Conversatie Bram Moolenaar


Patch 9.0.0070
Problem:Using utfc_ptr2char_len() when length is negative.
Solution:   Check value of length. (closes #10760)
Files:  src/screen.c


*** ../vim-9.0.0069/src/screen.c2022-07-09 04:56:12.522528981 +0100
--- src/screen.c2022-07-25 19:41:02.793825647 +0100
***
*** 1571,1591 
// check if this is the first byte of a multibyte
if (has_mbyte)
{
!   if (enc_utf8 && len > 0)
!   mbyte_blen = utfc_ptr2len_len(ptr, (int)((text + len) - ptr));
!   else
!   mbyte_blen = (*mb_ptr2len)(ptr);
if (enc_dbcs == DBCS_JPNU && c == 0x8e)
mbyte_cells = 1;
else if (enc_dbcs != 0)
mbyte_cells = mbyte_blen;
else// enc_utf8
{
!   if (len >= 0)
!   u8c = utfc_ptr2char_len(ptr, u8cc,
!  (int)((text + len) - ptr));
!   else
!   u8c = utfc_ptr2char(ptr, u8cc);
mbyte_cells = utf_char2cells(u8c);
  #ifdef FEAT_ARABIC
if (p_arshape && !p_tbidi && ARABIC_CHAR(u8c))
--- 1571,1588 
// check if this is the first byte of a multibyte
if (has_mbyte)
{
!   mbyte_blen = enc_utf8 && len > 0
!? utfc_ptr2len_len(ptr, (int)((text + len) - ptr))
!: (*mb_ptr2len)(ptr);
if (enc_dbcs == DBCS_JPNU && c == 0x8e)
mbyte_cells = 1;
else if (enc_dbcs != 0)
mbyte_cells = mbyte_blen;
else// enc_utf8
{
!   u8c = len >= 0
! ? utfc_ptr2char_len(ptr, u8cc, (int)((text + len) - ptr))
! : utfc_ptr2char(ptr, u8cc);
mbyte_cells = utf_char2cells(u8c);
  #ifdef FEAT_ARABIC
if (p_arshape && !p_tbidi && ARABIC_CHAR(u8c))
***
*** 1599,1606 
}
else
{
!   nc = utfc_ptr2char_len(ptr + mbyte_blen, pcc,
! (int)((text + len) - ptr - mbyte_blen));
nc1 = pcc[0];
}
pc = prev_c;
--- 1596,1605 
}
else
{
!   nc = len >= 0
!? utfc_ptr2char_len(ptr + mbyte_blen, pcc,
!   (int)((text + len) - ptr - mbyte_blen))
!: utfc_ptr2char(ptr + mbyte_blen, pcc);
nc1 = pcc[0];
}
pc = prev_c;
*** ../vim-9.0.0069/src/version.c   2022-07-25 19:07:01.097953885 +0100
--- src/version.c   2022-07-25 19:39:51.277980582 +0100
***
*** 737,738 
--- 737,740 
  {   /* Add new patch number below this line */
+ /**/
+ 70,
  /**/

-- 
~
~
~
".signature" 4 lines, 50 characters written

 /// 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/20220725184232.D05211C0696%40moolenaar.net.


Patch 9.0.0069

2022-07-25 Fir de Conversatie Bram Moolenaar


Patch 9.0.0069 (after 9.0.0067)
Problem:Leaking memory when using text prop with inserted text.
Solution:   Clear the growarray with text.
Files:  src/buffer.c


*** ../vim-9.0.0068/src/buffer.c2022-06-29 10:37:14.938302547 +0100
--- src/buffer.c2022-07-25 19:04:39.974051808 +0100
***
*** 1004,1009 
--- 1004,1012 
  #ifdef FEAT_NETBEANS_INTG
  netbeans_file_killed(buf);
  #endif
+ #ifdef FEAT_PROP_POPUP
+ ga_clear_strings(&buf->b_textprop_text);
+ #endif
  map_clear_mode(buf, MAP_ALL_MODES, TRUE, FALSE);  // clear local mappings
  map_clear_mode(buf, MAP_ALL_MODES, TRUE, TRUE);   // clear local abbrevs
  VIM_CLEAR(buf->b_start_fenc);
*** ../vim-9.0.0068/src/version.c   2022-07-25 18:35:12.002814240 +0100
--- src/version.c   2022-07-25 19:06:43.797966441 +0100
***
*** 737,738 
--- 737,740 
  {   /* Add new patch number below this line */
+ /**/
+ 69,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
120. You ask a friend, "What's that big shiny thing?" He says, "It's the sun."

 /// 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/20220725180728.19C291C065D%40moolenaar.net.


Re: Patch 9.0.0067

2022-07-25 Fir de Conversatie Bram Moolenaar


I wrote:

> Patch 9.0.0067
> Problem:Cannot show virtual text.
> Solution:   Initial changes for virtual text support, using text properties.

I worked on this while I was offline.  It adds just the basic things,
inserting text at a certain text column.  I haven't checked what works
and what doesn't, at least it shows up and line wrapping seems to work
OK.

You can try it out a bit, mainly to check the way that the virtual text
is added.  Commands that rely on the screen column may not work
correctly.  You can mention that, but there are various other things to
work on.  It will take a while before all of this works.

Please do check that the refactoring of various "chartabsize" functions
doesn't cause problems, when the new feature isn't used everything
should work as before.

-- 
hundred-and-one symptoms of being an internet addict:
119. You are reading a book and look for the scroll bar to get to
 the next page.

 /// 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/20220725174348.D5CE31C065D%40moolenaar.net.


Patch 9.0.0068

2022-07-25 Fir de Conversatie Bram Moolenaar


Patch 9.0.0068 (after 9.0.0067)
Problem:Build fails with tiny features.
Solution:   Add #ifdef.
Files:  src/charset.c


*** ../vim-9.0.0067/src/charset.c   2022-07-25 18:13:33.046580756 +0100
--- src/charset.c   2022-07-25 18:32:35.777970219 +0100
***
*** 960,969 
   * Free any allocated item in "cts".
   */
  void
! clear_chartabsize_arg(chartabsize_T *cts)
  {
  if (cts->cts_text_prop_count > 0)
vim_free(cts->cts_text_props);
  }
  
  /*
--- 960,971 
   * Free any allocated item in "cts".
   */
  void
! clear_chartabsize_arg(chartabsize_T *cts UNUSED)
  {
+ #ifdef FEAT_PROP_POPUP
  if (cts->cts_text_prop_count > 0)
vim_free(cts->cts_text_props);
+ #endif
  }
  
  /*
***
*** 1023,1029 
--- 1025,1033 
int *headp UNUSED)
  {
  win_T *wp = cts->cts_win;
+ #ifdef FEAT_PROP_POPUP
  char_u*line = cts->cts_line; // start of the line
+ #endif
  char_u*s = cts->cts_ptr;
  colnr_T   vcol = cts->cts_vcol;
  #ifdef FEAT_LINEBREAK
*** ../vim-9.0.0067/src/version.c   2022-07-25 18:13:33.054580717 +0100
--- src/version.c   2022-07-25 18:34:51.070620938 +0100
***
*** 737,738 
--- 737,740 
  {   /* Add new patch number below this line */
+ /**/
+ 68,
  /**/

-- 
An actual excerpt from a classified section of a city newspaper:
"Illiterate?  Write today for free help!"

 /// 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/20220725173549.A76C51C065D%40moolenaar.net.


Patch 9.0.0067

2022-07-25 Fir de Conversatie Bram Moolenaar


Patch 9.0.0067
Problem:Cannot show virtual text.
Solution:   Initial changes for virtual text support, using text properties.
Files:  runtime/doc/textprop.txt, src/beval.c, src/charset.c,
src/drawline.c, src/edit.c, src/errors.h, src/evalfunc.c,
src/getchar.c, src/indent.c, src/misc1.c, src/misc2.c,
src/mouse.c, src/ops.c, src/popupwin.c, src/proto/charset.pro,
src/proto/textprop.pro, src/regexp.c, src/regexp_bt.c,
src/regexp_nfa.c, src/register.c, src/structs.h, src/textprop.c,
src/testdir/test_textprop.vim,
src/testdir/dumps/Test_prop_inserts_text.dump


*** ../vim-9.0.0066/runtime/doc/textprop.txt2022-06-28 11:21:06.0 
+0100
--- runtime/doc/textprop.txt2022-07-25 15:42:47.103101003 +0100
***
*** 137,143 
   bufnrbuffer to add the property to; when omitted
the current buffer is used
   id   user defined ID for the property; must be a
!   number; when omitted zero is used
   type name of the text property type
All fields except "type" are optional.
  
--- 137,147 
   bufnrbuffer to add the property to; when omitted
the current buffer is used
   id   user defined ID for the property; must be a
!   number, should be positive; when using "text"
!   then "id" must not be present and will be set
!   automatically to a negative number; otherwise
!   zero is used
!  text text to be displayed at {col}
   type name of the text property type
All fields except "type" are optional.
  
***
*** 157,162 
--- 161,177 
"type" will first be looked up in the buffer the property is
added to. When not found, the global property types are used.
If not found an error is given.
+   *virtual-text*
+   When "text" is used this text will be displayed at the start
+   location of the text property.  The text of the buffer line
+   will be shifted to make room.  This is called "virtual text".
+   The text will be displayed but it is not part of the actual
+   buffer line, the cursor cannot be placed on it.  A mouse click
+   in the text will move the cursor to the first character after
+   the text.
+   A negative "id" will be chosen and is returned.  Once a
+   property with "text" has been added for a buffer then using a
+   negative "id" for any other property will give an error.
  
Can also be used as a |method|: >
GetLnum()->prop_add(col, props)
***
*** 181,186 
--- 196,204 
two items {end-lnum} and {end-col} specify the position just
after the text.
  
+   It is not possible to add a text property with a "text" field
+   here.
+ 
Example:
call prop_add_list(#{type: 'MyProp', id: 2},
\ [[1, 4, 1, 7],
*** ../vim-9.0.0066/src/beval.c 2022-05-27 17:18:23.0 +0100
--- src/beval.c 2022-07-25 15:42:47.103101003 +0100
***
*** 47,53 
{
// Not past end of the file.
lbuf = ml_get_buf(wp->w_buffer, lnum, FALSE);
!   if (col <= win_linetabsize(wp, lbuf, (colnr_T)MAXCOL))
{
// Not past end of line.
if (getword)
--- 47,53 
{
// Not past end of the file.
lbuf = ml_get_buf(wp->w_buffer, lnum, FALSE);
!   if (col <= win_linetabsize(wp, lnum, lbuf, (colnr_T)MAXCOL))
{
// Not past end of line.
if (getword)
*** ../vim-9.0.0066/src/charset.c   2022-05-22 19:57:32.0 +0100
--- src/charset.c   2022-07-25 16:54:09.730345955 +0100
***
*** 12,19 
  #if defined(HAVE_WCHAR_H)
  # include// for towupper() and towlower()
  #endif
- static int win_nolbr_chartabsize(win_T *wp, char_u *s, colnr_T col, int 
*headp);
  
  static unsigned nr2hex(unsigned c);
  
  static intchartab_initialized = FALSE;
--- 12,19 
  #if defined(HAVE_WCHAR_H)
  # include// for towupper() and towlower()
  #endif
  
+ static int win_nolbr_chartabsize(chartabsize_T *cts, int *headp);
  static unsigned nr2hex(unsigned c);
  
  static intchartab_initialized = FALSE;
***
*** 737,744 
  #endif
  
  /*
!  * Return the number of characters the string 's' will take on the scree

Patch 9.0.0066

2022-07-25 Fir de Conversatie Bram Moolenaar


Patch 9.0.0066
Problem:Switching window uneccarily when getting buffer options.
Solution:   Do not switch window when getting buffer options. (closes #10767)
Files:  src/evalvars.c


*** ../vim-9.0.0065/src/evalvars.c  2022-06-29 12:54:48.064572066 +0100
--- src/evalvars.c  2022-07-25 12:24:36.948648256 +0100
***
*** 4098,4103 
--- 4098,4104 
  int   done = FALSE;
  switchwin_T   switchwin;
  int   need_switch_win;
+ int   do_change_curbuf = buf != NULL && htname == 'b';
  
  ++emsg_off;
  
***
*** 4112,4118 
// autocommands get blocked.
// If we have a buffer reference avoid the switching, we're saving and
// restoring curbuf directly.
!   need_switch_win = !(tp == curtab && win == curwin) || (buf != NULL);
if (!need_switch_win || switch_win(&switchwin, win, tp, TRUE) == OK)
{
// Handle options. There are no tab-local options.
--- 4113,4119 
// autocommands get blocked.
// If we have a buffer reference avoid the switching, we're saving and
// restoring curbuf directly.
!   need_switch_win = !(tp == curtab && win == curwin) && !do_change_curbuf;
if (!need_switch_win || switch_win(&switchwin, win, tp, TRUE) == OK)
{
// Handle options. There are no tab-local options.
***
*** 4121,4132 
buf_T   *save_curbuf = curbuf;
  
// Change curbuf so the option is read from the correct buffer.
!   if (buf != NULL && htname == 'b')
curbuf = buf;
  
if (varname[1] == NUL)
{
!   // get all window-local options in a dict
dict_T  *opts = get_winbuf_options(htname == 'b');
  
if (opts != NULL)
--- 4122,4133 
buf_T   *save_curbuf = curbuf;
  
// Change curbuf so the option is read from the correct buffer.
!   if (do_change_curbuf)
curbuf = buf;
  
if (varname[1] == NUL)
{
!   // get all window-local or buffer-local options in a dict
dict_T  *opts = get_winbuf_options(htname == 'b');
  
if (opts != NULL)
*** ../vim-9.0.0065/src/version.c   2022-07-24 20:47:56.222680114 +0100
--- src/version.c   2022-07-25 12:25:49.500588559 +0100
***
*** 737,738 
--- 737,740 
  {   /* Add new patch number below this line */
+ /**/
+ 66,
  /**/

-- 
Two percent of zero is almost nothing.

 /// 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/20220725112838.158FC1C066C%40moolenaar.net.