Re: [vim/vim] Proposal: sign_setlist (#4557)

2019-07-01 Fir de Conversatie Bram Moolenaar


Yegappan wrote:

> > > > > Thinking about this some more, we should modify the existing
> > > > > sign_place() function to always accept a List argument
> > > >
> > > > Just to say, I don't have any strong feelings either way. I'll defer
> > > > to those with more experience of the Vim API and how changes are made.
> > >
> > > The current sign_place() function is basically mimicking ":sign place".
> > > One of the quirks is that it takes a file name, not a buffer number.
> > >
> >
> > The sign_place() function accepts either a buffer name or a buffer
> > number. The {expr} argument to sign_place() is same as the {expr}
> > argument to bufname().
> >
> > >
> > > It also has an optional {id}, where zero means it's not passed in.
> > >
> >
> > Yes. Converting sign_place() to accept a List of dicts will make this
> > simpler.
> >
> > >
> > > Adding a new function that takes a list of dictionaries could be a good
> > > alternative. We then do need to validate the entries to check if the
> > > required keys are included. It will then be possible to either pass a
> > > buffer number or a file name.
> > >
> >
> > I have the changes for this ready to go (including the check for existence
> > of the required keys). I will merge my local changes with the recent
> > changes to sign.c/evalfunc.c and create a pull request.
> >
> 
> I have created PR #4602 (https://github.com/vim/vim/pull/4602) for this.
> I have simplified the sign_place(), sign_unplace() and sign_getplaced()
> functions. Took some time to make these changes as the sign tests heavily
> use these functions. Note that this change is not backward compatible.

The sign functions were added more than half a year ago.  I don't think
a change that is not backward compatible will be appreciated.

I think for sign_define() we can support both the old arguments and a
list argument.  for sign_getplaced() we don't need changes.  For
place/unplace add a new "list" function:

sign_define({name} [, {dict}])
sign_define({list}) 

sign_getplaced([{expr} [, {dict}]])

sign_place({id}, {group}, {name}, {expr} [, {dict}])
sign_placelist({list})

sign_unplace({group} [, {dict}])
sign_unplacelist({list})

Does that sound reasonable?

-- 
   An extraordinary TALL KNIGHT in all black (possibly John with Mike on his
   shoulders) walks out from the dark trees.  He is extremely fierce and
   gruesome countenance.  He walks towards KING ARTHUR and PATSY, who are
   wazzing like mad.  (Salopian slang, meaning very scared.  almost to the
   point of wetting oneself, e.g. before an important football match or
   prior to a postering.  Salopian slang meaning a beating by the school
   praeposters.  Sorry about the Salopian slant to this stage direction - Ed.)
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201907012038.x61KcrVb020618%40masaka.moolenaar.net.
For more options, visit https://groups.google.com/d/optout.


Patch 8.1.1616

2019-07-01 Fir de Conversatie Bram Moolenaar


Patch 8.1.1616
Problem:Build failure with gcc on Amiga.
Solution:   Add missing header includes. (Ola Söder, closes #4603)
Files:  src/os_amiga.h


*** ../vim-8.1.1615/src/os_amiga.h  2018-03-01 21:49:24.0 +0100
--- src/os_amiga.h  2019-07-01 22:26:37.353847560 +0200
***
*** 88,93 
--- 88,97 
  #ifdef __GNUC__
  # include 
  # include 
+ # include 
+ # include 
+ # include 
+ # include 
  #endif
  
  #ifndef PROTO
*** ../vim-8.1.1615/src/version.c   2019-07-01 22:20:57.204052858 +0200
--- src/version.c   2019-07-01 22:27:47.469392416 +0200
***
*** 779,780 
--- 779,782 
  {   /* Add new patch number below this line */
+ /**/
+ 1616,
  /**/

-- 
"My particular problem is with registry entries, which seem to just
accumulate like plastic coffee cups..."   -- Paul Moore

 /// 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201907012028.x61KSqiu018791%40masaka.moolenaar.net.
For more options, visit https://groups.google.com/d/optout.


Patch 8.1.1615

2019-07-01 Fir de Conversatie Bram Moolenaar


Patch 8.1.1615
Problem:Crash when passing buffer number to popup_create(). (Yasuhiro
Matsumoto)
Solution:   Initialze the window properly.
Files:  src/popupwin.c, src/testdir/test_popupwin.vim


*** ../vim-8.1.1614/src/popupwin.c  2019-06-30 22:16:06.931821750 +0200
--- src/popupwin.c  2019-07-01 22:19:03.092790807 +0200
***
*** 1056,1063 
  {
// use existing buffer
new_buffer = FALSE;
!   wp->w_buffer = buf;
!   ++buf->b_nwindows;
buffer_ensure_loaded(buf);
  }
  else
--- 1056,1062 
  {
// use existing buffer
new_buffer = FALSE;
!   win_init_popup_win(wp, buf);
buffer_ensure_loaded(buf);
  }
  else
*** ../vim-8.1.1614/src/testdir/test_popupwin.vim   2019-06-30 
22:16:06.935821727 +0200
--- src/testdir/test_popupwin.vim   2019-07-01 22:18:46.644897078 +0200
***
*** 1668,1671 
--- 1668,1676 
call assert_equal({}, popup_getpos(winid))
call assert_equal(1, bufloaded(buf))
exe 'bwipe! ' .. buf
+ 
+   edit test_popupwin.vim
+   let winid = popup_create(bufnr(''), {})
+   redraw
+   call popup_close(winid)
  endfunc
*** ../vim-8.1.1614/src/version.c   2019-07-01 22:05:44.457897080 +0200
--- src/version.c   2019-07-01 22:20:49.516102610 +0200
***
*** 779,780 
--- 779,782 
  {   /* Add new patch number below this line */
+ /**/
+ 1615,
  /**/

-- 
Experience is what you get when you don't get what you want.

 /// 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201907012021.x61KLStC017046%40masaka.moolenaar.net.
For more options, visit https://groups.google.com/d/optout.


Patch 8.1.1614

2019-07-01 Fir de Conversatie Bram Moolenaar


Patch 8.1.1614
Problem:'numberwidth' can only go up to 10.
Solution:   Allow up to 20. (Charlie Stanton, closes #4584)
Files:  runtime/doc/options.txt, src/option.c, src/screen.c,
src/testdir/gen_opt_test.vim, src/testdir/test_options.vim


*** ../vim-8.1.1613/runtime/doc/options.txt 2019-06-17 21:48:02.211646291 
+0200
--- runtime/doc/options.txt 2019-07-01 22:00:36.935801289 +0200
***
*** 5385,5391 
rows in the window, depending on whether 'number' or 'relativenumber'
is set. Thus with the Vim default of 4 there is room for a line number
up to 999. When the buffer has 1000 lines five columns will be used.
!   The minimum value is 1, the maximum value is 10.
NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
  
--- 5385,5391 
rows in the window, depending on whether 'number' or 'relativenumber'
is set. Thus with the Vim default of 4 there is room for a line number
up to 999. When the buffer has 1000 lines five columns will be used.
!   The minimum value is 1, the maximum value is 20.
NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
  
***
*** 6804,6810 
   "no" never
   "yes"always
   "number" display signs in the 'number' column. If the number
!   column is not present, then behaves like 'auto'.
  
  
*'smartcase'* *'scs'* *'nosmartcase'* *'noscs'*
--- 6804,6810 
   "no" never
   "yes"always
   "number" display signs in the 'number' column. If the number
!   column is not present, then behaves like "auto".
  
  
*'smartcase'* *'scs'* *'nosmartcase'* *'noscs'*
*** ../vim-8.1.1613/src/option.c2019-06-24 05:45:08.925616559 +0200
--- src/option.c2019-07-01 22:00:36.935801289 +0200
***
*** 9493,9502 
errmsg = e_positive;
curwin->w_p_nuw = 1;
}
!   if (curwin->w_p_nuw > 10)
{
errmsg = e_invarg;
!   curwin->w_p_nuw = 10;
}
curwin->w_nrwidth_line_count = 0; /* trigger a redraw */
  }
--- 9493,9502 
errmsg = e_positive;
curwin->w_p_nuw = 1;
}
!   if (curwin->w_p_nuw > 20)
{
errmsg = e_invarg;
!   curwin->w_p_nuw = 20;
}
curwin->w_nrwidth_line_count = 0; /* trigger a redraw */
  }
*** ../vim-8.1.1613/src/screen.c2019-06-30 22:16:06.931821750 +0200
--- src/screen.c2019-07-01 22:02:20.275168189 +0200
***
*** 3149,3180 
  int   nochange UNUSED,// not updating for changed text
  int   number_only)// only update the number column
  {
! int   col = 0;/* visual column on screen */
! unsigned  off;/* offset in ScreenLines/ScreenAttrs */
! int   c = 0;  /* init for GCC */
! long  vcol = 0;   /* virtual column (for tabs) */
  #ifdef FEAT_LINEBREAK
! long  vcol_sbr = -1;  /* virtual column after showbreak */
  #endif
! long  vcol_prev = -1; /* "vcol" of previous character */
! char_u*line;  /* current line */
! char_u*ptr;   /* current position in "line" */
! int   row;/* row in the window, excl 
w_winrow */
! int   screen_row; /* row on the screen, incl 
w_winrow */
  
! char_uextra[20];  /* "%ld" and 'fdc' must fit in here */
! int   n_extra = 0;/* number of extra chars */
! char_u*p_extra = NULL;/* string of extra chars, plus NUL */
! char_u*p_extra_free = NULL;   /* p_extra needs to be freed */
! int   c_extra = NUL;  /* extra chars, all the same */
! int   c_final = NUL;  /* final char, mandatory if set 
*/
! int   extra_attr = 0; /* attributes when n_extra != 0 
*/
! static char_u *at_end_str = (char_u *)""; /* used for p_extra when
!  displaying lcs_eol at end-of-line */
! int   lcs_eol_one = lcs_eol;  /* lcs_eol until it's been used 
*/
! int   lcs_prec_todo = lcs_prec;   /* lcs_prec until it's been 
used */
  
! /* saved "extra" items for when draw_state becomes WL_LINE (again) */
  int   saved_n_extra = 0;
  char_u*saved_p_extra = NULL;
  int   saved_c_extra = 0;
--- 3149,3180 
  int   nochange UNUSED,// not 

Re: test_popupwin.vim fails on an ATHENA build

2019-07-01 Fir de Conversatie Bram Moolenaar


Elimar Riesebieter wrote:

> Building vim with --enable-gui=athena just runs smooth. Tests fails
> as follows:
> 
> Failures:
> From test_popupwin.vim:
> Found errors in Test_popup_scrollbar():
> Run 1:
> function RunTheTest[40]..Test_popup_scrollbar[46]..VerifyScreenDump line 55: 
> See dump file difference: call 
> term_dumpdiff("testdir/failed/Test_popupwin_scroll_5.dump", 
> "testdir/dumps/Test_popupwin_scroll_5.dump"); difference in line 6: "|6| 
> @31|t+0#001#ffd7ff255|h|r|e@1| @2| +0#000#ff0@33"; difference in 
> line 7: "|7| @31|f+0#001#ffd7ff255|o|u|r| @3| +0#000#ff0@33"
> function RunTheTest[40]..Test_popup_scrollbar[50]..VerifyScreenDump line 55: 
> See dump file difference: call 
> term_dumpdiff("testdir/failed/Test_popupwin_scroll_6.dump", 
> "testdir/dumps/Test_popupwin_scroll_6.dump"); difference in line 4: "|4| 
> @31|t+0#001#ffd7ff255|h|r|e@1| @2| +0#000#ff0@33"; difference in 
> line 7: "|7| @31|s+0#001#ffd7ff255|i|x| @4| +0#000#ff0@33"
> function RunTheTest[40]..Test_popup_scrollbar[56]..VerifyScreenDump line 55: 
> See dump file difference: call 
> term_dumpdiff("testdir/failed/Test_popupwin_scroll_7.dump", 
> "testdir/dumps/Test_popupwin_scroll_7.dump"); difference in line 4: "|4| 
> @31|s+0#001#ffd7ff255|i|x| @4| +0#000#ff0@33"; difference in line 
> 5: "|5| @31|s+0#001#ffd7ff255|e|v|e|n| @2| +0#000#ff0@33"
> function RunTheTest[40]..Test_popup_scrollbar[61]..VerifyScreenDump line 55: 
> See dump file difference: call 
> term_dumpdiff("testdir/failed/Test_popupwin_scroll_8.dump", 
> "testdir/dumps/Test_popupwin_scroll_8.dump"); difference in line 4: "|4| 
> @31|f+0#001#ffd7ff255|o|u|r| @3| +0#000#ff0@33"; difference in 
> line 7: "|7| @31|s+0#001#ffd7ff255|e|v|e|n| @2| +0#000#ff0@33"
> function RunTheTest[40]..Test_popup_scrollbar[65]..VerifyScreenDump line 55: 
> See dump file difference: call 
> term_dumpdiff("testdir/failed/Test_popupwin_scroll_9.dump", 
> "testdir/dumps/Test_popupwin_scroll_9.dump"); difference in line 4: "|4| 
> @31|f+0#001#ffd7ff255|i|v|e| @3| +0#000#ff0@33"; difference in 
> line 5: "|5| @31|s+0#001#ffd7ff255|i|x| @4| +0#000#ff0@33"

I can reproduce it, and I made a fix.

-- 
"Intelligence has much less practical application than you'd think."
  -- Scott Adams, Dilbert.

 /// 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201907011949.x61JnEgH010208%40masaka.moolenaar.net.
For more options, visit https://groups.google.com/d/optout.


Patch 8.1.1613

2019-07-01 Fir de Conversatie Bram Moolenaar


Patch 8.1.1613
Problem:Popup window test fails with Athena and Motif.
Solution:   Compute the highlight attribut when the GUI is not active.
Files:  src/syntax.c


*** ../vim-8.1.1612/src/syntax.c2019-06-29 03:42:32.060749532 +0200
--- src/syntax.c2019-07-01 21:41:56.878938880 +0200
***
*** 8202,8207 
--- 8202,8209 
{
if (gui.in_use && do_colors)
gui_new_scrollbar_colors();
+   else
+   set_hl_attr(idx);
}
  # ifdef FEAT_BEVAL_GUI
else if (is_tooltip_group)
*** ../vim-8.1.1612/src/version.c   2019-06-30 22:16:06.935821727 +0200
--- src/version.c   2019-07-01 21:47:18.968791572 +0200
***
*** 779,780 
--- 779,782 
  {   /* Add new patch number below this line */
+ /**/
+ 1613,
  /**/

-- 
The psychic said, "God bless you."  I said, "I didn't sneeze."  She
looked deep into my eyes and said, "You will, eventually."  And, damn
if she wasn't right.  Two days later, I sneezed.  --Ellen Degeneres

 /// 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201907011949.x61JnEFS010214%40masaka.moolenaar.net.
For more options, visit https://groups.google.com/d/optout.


test_popupwin.vim fails on an ATHENA build

2019-07-01 Fir de Conversatie Elimar Riesebieter
Building vim with --enable-gui=athena just runs smooth. Tests fails
as follows:

Failures:
From test_popupwin.vim:
Found errors in Test_popup_scrollbar():
Run 1:
function RunTheTest[40]..Test_popup_scrollbar[46]..VerifyScreenDump line 55: 
See dump file difference: call 
term_dumpdiff("testdir/failed/Test_popupwin_scroll_5.dump", 
"testdir/dumps/Test_popupwin_scroll_5.dump"); difference in line 6: "|6| 
@31|t+0#001#ffd7ff255|h|r|e@1| @2| +0#000#ff0@33"; difference in 
line 7: "|7| @31|f+0#001#ffd7ff255|o|u|r| @3| +0#000#ff0@33"
function RunTheTest[40]..Test_popup_scrollbar[50]..VerifyScreenDump line 55: 
See dump file difference: call 
term_dumpdiff("testdir/failed/Test_popupwin_scroll_6.dump", 
"testdir/dumps/Test_popupwin_scroll_6.dump"); difference in line 4: "|4| 
@31|t+0#001#ffd7ff255|h|r|e@1| @2| +0#000#ff0@33"; difference in 
line 7: "|7| @31|s+0#001#ffd7ff255|i|x| @4| +0#000#ff0@33"
function RunTheTest[40]..Test_popup_scrollbar[56]..VerifyScreenDump line 55: 
See dump file difference: call 
term_dumpdiff("testdir/failed/Test_popupwin_scroll_7.dump", 
"testdir/dumps/Test_popupwin_scroll_7.dump"); difference in line 4: "|4| 
@31|s+0#001#ffd7ff255|i|x| @4| +0#000#ff0@33"; difference in line 
5: "|5| @31|s+0#001#ffd7ff255|e|v|e|n| @2| +0#000#ff0@33"
function RunTheTest[40]..Test_popup_scrollbar[61]..VerifyScreenDump line 55: 
See dump file difference: call 
term_dumpdiff("testdir/failed/Test_popupwin_scroll_8.dump", 
"testdir/dumps/Test_popupwin_scroll_8.dump"); difference in line 4: "|4| 
@31|f+0#001#ffd7ff255|o|u|r| @3| +0#000#ff0@33"; difference in line 
7: "|7| @31|s+0#001#ffd7ff255|e|v|e|n| @2| +0#000#ff0@33"
function RunTheTest[40]..Test_popup_scrollbar[65]..VerifyScreenDump line 55: 
See dump file difference: call 
term_dumpdiff("testdir/failed/Test_popupwin_scroll_9.dump", 
"testdir/dumps/Test_popupwin_scroll_9.dump"); difference in line 4: "|4| 
@31|f+0#001#ffd7ff255|i|v|e| @3| +0#000#ff0@33"; difference in line 
5: "|5| @31|s+0#001#ffd7ff255|i|x| @4| +0#000#ff0@33"

Elimar
-- 
  You cannot propel yourself forward by
  patting yourself on the back.

-- 
-- 
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/20190701091451.elors5wg4rs3kaw7%40toy.home.lxtec.de.
For more options, visit https://groups.google.com/d/optout.


Re: [vim/vim] Proposal: sign_setlist (#4557)

2019-07-01 Fir de Conversatie Yegappan Lakshmanan
Hi,

On Sat, Jun 29, 2019 at 6:34 AM Yegappan Lakshmanan  wrote:
>
> Hi Bram,
>
> On Sat, Jun 29, 2019 at 5:57 AM Bram Moolenaar
>  wrote:
> >
> >
> > > > Thinking about this some more, we should modify the existing
> > > > sign_place() function to always accept a List argument
> > >
> > > Just to say, I don't have any strong feelings either way. I'll defer
> > > to those with more experience of the Vim API and how changes are made.
> >
> > The current sign_place() function is basically mimicking ":sign place".
> > One of the quirks is that it takes a file name, not a buffer number.
> >
>
> The sign_place() function accepts either a buffer name or a buffer
> number. The {expr} argument to sign_place() is same as the {expr}
> argument to bufname().
>
> >
> > It also has an optional {id}, where zero means it's not passed in.
> >
>
> Yes. Converting sign_place() to accept a List of dicts will make this
> simpler.
>
> >
> > Adding a new function that takes a list of dictionaries could be a good
> > alternative. We then do need to validate the entries to check if the
> > required keys are included. It will then be possible to either pass a
> > buffer number or a file name.
> >
>
> I have the changes for this ready to go (including the check for existence
> of the required keys). I will merge my local changes with the recent
> changes to sign.c/evalfunc.c and create a pull request.
>

I have created PR #4602 (https://github.com/vim/vim/pull/4602) for this.
I have simplified the sign_place(), sign_unplace() and sign_getplaced()
functions. Took some time to make these changes as the sign tests heavily
use these functions. Note that this change is not backward compatible.

- Yegappan

-- 
-- 
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/CAAW7x7%3DrJ22qEqXTEEipVbZhr7TLuMumeo9x21h9s_GbR1eLug%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.