Re: Patch 9.0.0121

2022-07-31 Fir de Conversatie Bram Moolenaar


I wrote:

> Patch 9.0.0121
> Problem:Cannot put virtual text after or below a line.
> Solution:   Add "text_align" and "text_wrap" arguments.
> Files:  runtime/doc textprop.txt, src/textprop.c, src/structs.h,
> src/drawline.c, src/charset.c, src/testdir/test_textprop.vim,
> src/testdir/dumps/Test_prop_with_text_after_1.dump

With this patch (and a few following fixes) it should be possible to add
virtual text inside and after a line.

Note that there are likely various problems, especially with multi-byte
characters, longer texts, etc.  Also, truncating isn't implemented yet.

It should give you a good idea how this can be used and how it behaves.
Let me know if the way this done isn't right.  Bugs will be fixed the
coming weeks (it's complicated, many corner cases to take care of).

-- 
hundred-and-one symptoms of being an internet addict:
213. Your kids start referring to you as "that guy in front of the monitor."

 /// 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/20220731174609.B3D731C0C11%40moolenaar.net.


Re: Patch 9.0.0121

2022-07-31 Fir de Conversatie Bram Moolenaar


Tony wrote:

> On Sun, Jul 31, 2022 at 6:36 PM Bram Moolenaar  wrote:
> >
> >
> > Patch 9.0.0121
> > Problem:Cannot put virtual text after or below a line.
> > Solution:   Add "text_align" and "text_wrap" arguments.
> > Files:  runtime/doc textprop.txt, src/textprop.c, src/structs.h,
> > src/drawline.c, src/charset.c, src/testdir/test_textprop.vim,
> > src/testdir/dumps/Test_prop_with_text_after_1.dump
> 
> This patch gives a fatal error in Small and Tiny builds:
> 
> 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/charset.o charset.c
> charset.c: In function ‘win_linetabsize’:
> charset.c:774:8: error: ‘chartabsize_T’ has no member named 
> ‘cts_with_trailing’
>   774 | cts.cts_with_trailing = len = MAXCOL;
>   |^
> make: *** [Makefile:3156: objects/charset.o] Error 1
> exit status 2
> Sun 31 Jul 18:41:30 CEST 2022

I'll add the missing #ifdef.

-- 
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/ ///
 \\\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/20220731170450.744781C0C11%40moolenaar.net.


Re: Patch 9.0.0121

2022-07-31 Fir de Conversatie Tony Mechelynck
On Sun, Jul 31, 2022 at 6:36 PM Bram Moolenaar  wrote:
>
>
> Patch 9.0.0121
> Problem:Cannot put virtual text after or below a line.
> Solution:   Add "text_align" and "text_wrap" arguments.
> Files:  runtime/doc textprop.txt, src/textprop.c, src/structs.h,
> src/drawline.c, src/charset.c, src/testdir/test_textprop.vim,
> src/testdir/dumps/Test_prop_with_text_after_1.dump

This patch gives a fatal error in Small and Tiny builds:

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/charset.o charset.c
charset.c: In function ‘win_linetabsize’:
charset.c:774:8: error: ‘chartabsize_T’ has no member named ‘cts_with_trailing’
  774 | cts.cts_with_trailing = len = MAXCOL;
  |^
make: *** [Makefile:3156: objects/charset.o] Error 1
exit status 2
Sun 31 Jul 18:41:30 CEST 2022

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/CAJkCKXsd9oaOMmVChaLhmYgH3%3DK7CsbrSA6C%2Bjt_zgw_H%2Bv4Yw%40mail.gmail.com.


Patch 9.0.0121

2022-07-31 Fir de Conversatie Bram Moolenaar


Patch 9.0.0121
Problem:Cannot put virtual text after or below a line.
Solution:   Add "text_align" and "text_wrap" arguments.
Files:  runtime/doc textprop.txt, src/textprop.c, src/structs.h,
src/drawline.c, src/charset.c, src/testdir/test_textprop.vim,
src/testdir/dumps/Test_prop_with_text_after_1.dump


*** ../vim-9.0.0120/runtime/doc/textprop.txt2022-07-25 18:13:33.046580756 
+0100
--- runtime/doc/textprop.txt2022-07-31 15:03:34.516688562 +0100
***
*** 141,147 
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.
  
--- 141,160 
then "id" must not be present and will be set
automatically to a negative number; otherwise
zero is used
!  text text to be displayed before {col}, or after the
!   line if {col} is zero
!  text_align   when "text" is present and {col} is zero
!   specifies where to display the text:
!  after   after the end of the line
!  right   right aligned in the window
!  below   in the next screen line
!   When omitted "after" is used.
!  text_wrapwhen "text" is present and {col} is zero,
!   specifies what happens if the text doesn't
!   fit:
!  wrap  wrap the text to the next line
!  truncate  truncate the text to make it fit
!   When omitted "truncate" is used.
   type name of the text property type
All fields except "type" are optional.
  
***
*** 162,177 
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)
--- 175,200 
added to. When not found, the global property types are used.
If not found an error is given.
*virtual-text*
!   When "text" is used and the column is non-zero then this text
!   will be displayed at the start location of the text property
!   after the text.  The text of the buffer line will be shifted
!   to make room.  This is called "virtual text".
!   When the column is zero the virtual text will appear after the
!   buffer text.  The "text_align" and "text_wrap" arguments
!   determine how it is displayed.
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, or the last character of the line.
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:
!   *E1293*
!   Make sure to use a highlight that makes clear to the user that
!   this is virtual text, otherwise it will be very confusing that
!   the text cannot be edited.
!   To separate the virtual text from the buffer text prepe