[bug] access beyond end of string in findmatchlimit in vim-7.4.2358

2016-09-09 Fir de Conversatie Dominique Pellé
Hi

Here is one more bug found by afl-fuzz using vim-7.4.2358.
Vim-7.4.52 in xubuntu-14.04 also has the bug so it's an old bug:

$ cat log
$ cat log
==4689== Memcheck, a memory error detector
==4689== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==4689== Using Valgrind-3.12.0.SVN and LibVEX; rerun with -h for copyright info
==4689== Command: ./vim -u NONE -i NONE -S bug.vim
==4689==
==4689== Invalid read of size 1
==4689==at 0x4F4B60: utf_head_off (mbyte.c:3740)
==4689==by 0x577C77: findmatchlimit (search.c:2159)
==4689==by 0x4DE418: find_match_char (misc1.c:6698)
==4689==by 0x4DE3D2: find_match_paren (misc1.c:6684)
==4689==by 0x4DD2F4: cin_isfuncdecl (misc1.c:6121)
==4689==by 0x4E1FA4: get_c_indent (misc1.c:8903)
==4689==by 0x507655: op_reindent (ops.c:732)
==4689==by 0x4F976C: do_pending_operator (normal.c:1954)
==4689==by 0x4F7F57: normal_cmd (normal.c:1182)
==4689==by 0x47E1DB: exec_normal (ex_docmd.c:10250)
==4689==by 0x47E19A: exec_normal_cmd (ex_docmd.c:10233)
==4689==by 0x47DFAC: ex_normal (ex_docmd.c:10142)
==4689==by 0x471B53: do_one_cmd (ex_docmd.c:2962)
==4689==by 0x46E5D4: do_cmdline (ex_docmd.c:1110)
==4689==by 0x46C296: do_source (ex_cmds2.c:4110)
==4689==by 0x46B8A8: cmd_source (ex_cmds2.c:3723)
==4689==by 0x46B7FA: ex_source (ex_cmds2.c:3698)
==4689==by 0x471B53: do_one_cmd (ex_docmd.c:2962)
==4689==by 0x46E5D4: do_cmdline (ex_docmd.c:1110)
==4689==by 0x46DC10: do_cmdline_cmd (ex_docmd.c:715)
==4689==by 0x5FA646: exe_commands (main.c:2896)
==4689==by 0x5F7A2B: vim_main2 (main.c:781)
==4689==by 0x5F73D5: main (main.c:415)
==4689==  Address 0x7697ff0 is 0 bytes after a block of size 4,096 alloc'd
==4689==at 0x4C2ABF5: malloc (vg_replace_malloc.c:299)
==4689==by 0x4E6CC0: lalloc (misc2.c:942)
==4689==by 0x4E6B8D: alloc (misc2.c:840)
==4689==by 0x5FD5E1: mf_alloc_bhdr (memfile.c:907)
==4689==by 0x5FCB1B: mf_new (memfile.c:381)
==4689==by 0x4CD146: ml_new_data (memline.c:3513)
==4689==by 0x4C6E34: ml_open (memline.c:400)
==4689==by 0x40691E: open_buffer (buffer.c:160)
==4689==by 0x5FA0C3: create_windows (main.c:2668)
==4689==by 0x5F7863: vim_main2 (main.c:704)
==4689==by 0x5F73D5: main (main.c:415)
...snip...

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.


Patch 7.4.2358

2016-09-09 Fir de Conversatie Bram Moolenaar

Patch 7.4.2358
Problem:Compiler warnings with Solaris Studio when using GTK3.
Solution:   Define FUNC2GENERIC depending on the system. (Kazunobu Kuriyama)
Files:  src/gui.h, src/gui_beval.c, src/gui_gtk_f.c


*** ../vim-7.4.2357/src/gui.h   2016-08-29 22:48:12.133106320 +0200
--- src/gui.h   2016-09-09 22:00:25.423601792 +0200
***
*** 541,543 
--- 541,569 
  # define CONVERT_FROM_UTF8(String) (String)
  # define CONVERT_FROM_UTF8_FREE(String) ((String) = (char_u *)NULL)
  #endif /* FEAT_GUI_GTK */
+ 
+ #ifdef FEAT_GUI_GTK
+ /*
+  * The second parameter of g_signal_handlers_disconnect_by_func() is supposed
+  * to be a function pointer which was passed to g_signal_connect_*() somewhere
+  * previously, and hence it must be of type GCallback, i.e., void (*)(void).
+  *
+  * Meanwhile, g_signal_handlers_disconnect_by_func() is a macro calling
+  * g_signal_handlers_disconnect_matched(), and the second parameter of the
+  * former is to be passed to the sixth parameter of the latter the type of
+  * which, however, is declared as void * in the function signature.
+  *
+  * While the ISO C Standard does not require that function pointers be
+  * interconvertible to void *, widely-used compilers such as gcc and clang
+  * do such conversion implicitly and automatically on some platforms without
+  * issuing any warning.
+  *
+  * For Solaris Studio, that is not the case.  An explicit type cast is needed
+  * to suppress warnings on that particular conversion.
+  */
+ # if defined(__SUNPRO_C) && defined(USE_GTK3)
+ #  define FUNC2GENERIC(func) (void *)(func)
+ # else
+ #  define FUNC2GENERIC(func) G_CALLBACK(func)
+ # endif
+ #endif /* FEAT_GUI_GTK */
*** ../vim-7.4.2357/src/gui_beval.c 2016-08-29 22:48:12.137106286 +0200
--- src/gui_beval.c 2016-09-09 22:00:25.427601739 +0200
***
*** 508,514 
  /* LINTED: avoid warning: dubious operation on enum */
  # if GTK_CHECK_VERSION(3,0,0)
  g_signal_handlers_disconnect_by_func(G_OBJECT(beval->target),
!G_CALLBACK(target_event_cb),
 beval);
  # else
  gtk_signal_disconnect_by_func((GtkObject*)(beval->target),
--- 508,514 
  /* LINTED: avoid warning: dubious operation on enum */
  # if GTK_CHECK_VERSION(3,0,0)
  g_signal_handlers_disconnect_by_func(G_OBJECT(beval->target),
!FUNC2GENERIC(target_event_cb),
 beval);
  # else
  gtk_signal_disconnect_by_func((GtkObject*)(beval->target),
***
*** 522,528 
/* LINTED: avoid warning: dubious operation on enum */
  # if GTK_CHECK_VERSION(3,0,0)
g_signal_handlers_disconnect_by_func(G_OBJECT(gui.mainwin),
!G_CALLBACK(mainwin_event_cb),
 beval);
  # else
gtk_signal_disconnect_by_func((GtkObject*)(gui.mainwin),
--- 522,528 
/* LINTED: avoid warning: dubious operation on enum */
  # if GTK_CHECK_VERSION(3,0,0)
g_signal_handlers_disconnect_by_func(G_OBJECT(gui.mainwin),
!FUNC2GENERIC(mainwin_event_cb),
 beval);
  # else
gtk_signal_disconnect_by_func((GtkObject*)(gui.mainwin),
*** ../vim-7.4.2357/src/gui_gtk_f.c 2016-08-29 22:48:12.137106286 +0200
--- src/gui_gtk_f.c 2016-09-09 22:00:25.427601739 +0200
***
*** 505,522 
{
  #if GTK_CHECK_VERSION(3,0,0)
g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget),
!   G_CALLBACK(gtk_form_child_map),
child);
g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget),
!   G_CALLBACK(gtk_form_child_unmap),
child);
  #else
gtk_signal_disconnect_by_func(GTK_OBJECT(child->widget),
! GTK_SIGNAL_FUNC(gtk_form_child_map),
! child);
gtk_signal_disconnect_by_func(GTK_OBJECT(child->widget),
! GTK_SIGNAL_FUNC(gtk_form_child_unmap),
! child);
  #endif
  
gdk_window_set_user_data(child->window, NULL);
--- 505,522 
{
  #if GTK_CHECK_VERSION(3,0,0)
g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget),
!   FUNC2GENERIC(gtk_form_child_map),
child);
g_signal_handlers_disconnect_by_func(G_OBJECT(child->widget),
!   FUNC2GENERIC(gtk_form_child_unmap),
child);
  #else
gtk_signal_disconnect_by_func(GTK_OBJECT(child->widget),
!   GTK_SIGNAL_FUNC(gtk_form_child_map),
!   child);
gtk_signal_disconnect_by_func(GTK_OBJECT(child->widget),
!  

Patch 7.4.2357

2016-09-09 Fir de Conversatie Bram Moolenaar

Patch 7.4.2357
Problem:Attempt to read history entry while not initialized.
Solution:   Skip when the index is negative.
Files:  src/ex_getln.c


*** ../vim-7.4.2356/src/ex_getln.c  2016-09-05 21:51:10.267270461 +0200
--- src/ex_getln.c  2016-09-09 21:35:27.423791818 +0200
***
*** 5762,5768 
   */
  if (histype == HIST_SEARCH && in_map)
  {
!   if (maptick == last_maptick)
{
/* Current line is from the same mapping, remove it */
hisptr = [HIST_SEARCH][hisidx[HIST_SEARCH]];
--- 5762,5768 
   */
  if (histype == HIST_SEARCH && in_map)
  {
!   if (maptick == last_maptick && hisidx[HIST_SEARCH] >= 0)
{
/* Current line is from the same mapping, remove it */
hisptr = [HIST_SEARCH][hisidx[HIST_SEARCH]];
*** ../vim-7.4.2356/src/version.c   2016-09-09 21:41:28.454932105 +0200
--- src/version.c   2016-09-09 21:42:02.626471903 +0200
***
*** 765,766 
--- 765,768 
  {   /* Add new patch number below this line */
+ /**/
+ 2357,
  /**/


-- 
hundred-and-one symptoms of being an internet addict:
218. Your spouse hands you a gift wrapped magnet with your PC's name
 on it and you accuse him or her of genocide.

 /// 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 7.4.2356

2016-09-09 Fir de Conversatie Bram Moolenaar

Patch 7.4.2356
Problem:Reading past end of line when using previous substitute pattern.
(Dominique Pelle)
Solution:   Don't set "pat" only set "searchstr".
Files:  src/search.c, src/testdir/test_search.vim


*** ../vim-7.4.2355/src/search.c2016-09-01 20:58:17.640011363 +0200
--- src/search.c2016-09-09 21:20:55.383530044 +0200
***
*** 1240,1253 
{
if (spats[RE_SEARCH].pat == NULL)   /* no previous pattern */
{
!   pat = spats[RE_SUBST].pat;
!   if (pat == NULL)
{
EMSG(_(e_noprevre));
retval = 0;
goto end_do_search;
}
-   searchstr = pat;
}
else
{
--- 1240,1252 
{
if (spats[RE_SEARCH].pat == NULL)   /* no previous pattern */
{
!   searchstr = spats[RE_SUBST].pat;
!   if (searchstr == NULL)
{
EMSG(_(e_noprevre));
retval = 0;
goto end_do_search;
}
}
else
{
*** ../vim-7.4.2355/src/testdir/test_search.vim 2016-09-03 21:04:54.993247355 
+0200
--- src/testdir/test_search.vim 2016-09-09 21:20:43.283693655 +0200
***
*** 268,270 
--- 268,281 
call test_disable_char_avail(0)
bw!
  endfunc
+ 
+ func Test_use_sub_pat()
+   split
+   let @/ = ''
+   func X()
+ s/^/a/
+ /
+   endfunc
+   call X()
+   bwipe!
+ endfunc
*** ../vim-7.4.2355/src/version.c   2016-09-09 20:29:46.661076183 +0200
--- src/version.c   2016-09-09 21:21:48.298814469 +0200
***
*** 765,766 
--- 765,768 
  {   /* Add new patch number below this line */
+ /**/
+ 2356,
  /**/

-- 
Don't be humble ... you're not that great.
  -- Golda Meir

 /// 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.


Re: [bug] access beyond end of string when doing search with /

2016-09-09 Fir de Conversatie Bram Moolenaar

Dominique wrote:

> afl-fuzz found a bug in vim-7.4.2354 and older.
> Default vim in xubuntu-14.04 (vim-7.4.52) also has
> the bug, so it's an old bug.
> 
> $ cat  func X()
>   s/^/a/
>   /
> endfunc
> call X()
> q!
> EOF
> 
> $ valgrind --num-callers=30 vim -u NONE -i NONE -S bug.vim 2>log
> 
> And log file contains:
> 
> ==10163== Memcheck, a memory error detector
> ==10163== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
> ==10163== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
> ==10163== Command: vim -u NONE -i NONE -S bug.vim
> ==10163==
> ==10163== Invalid read of size 1
> ==10163==at 0x8060A3D: skipwhite (charset.c:1522)
> ==10163==by 0x80B9F0A: get_address (ex_docmd.c:4593)
> ==10163==by 0x80B5A00: do_one_cmd (ex_docmd.c:2179)
> ==10163==by 0x80B3DA0: do_cmdline (ex_docmd.c:1110)
> ==10163==by 0x820129A: call_user_func (userfunc.c:893)
> ==10163==by 0x820220E: call_func (userfunc.c:1353)
> ==10163==by 0x82002C1: get_func_tv (userfunc.c:455)
> ==10163==by 0x8205944: ex_call (userfunc.c:2981)
> ==10163==by 0x80B6FF7: do_one_cmd (ex_docmd.c:2962)
> ==10163==by 0x80B3DA0: do_cmdline (ex_docmd.c:1110)
> ==10163==by 0x80B1CE5: do_source (ex_cmds2.c:4110)
> ==10163==by 0x80B13DD: cmd_source (ex_cmds2.c:3723)
> ==10163==by 0x80B133B: ex_source (ex_cmds2.c:3698)
> ==10163==by 0x80B6FF7: do_one_cmd (ex_docmd.c:2962)
> ==10163==by 0x80B3DA0: do_cmdline (ex_docmd.c:1110)
> ==10163==by 0x80B3465: do_cmdline_cmd (ex_docmd.c:715)
> ==10163==by 0x823BEE0: exe_commands (main.c:2896)
> ==10163==by 0x82392A2: vim_main2 (main.c:781)
> ==10163==by 0x8238BC3: main (main.c:415)
> ==10163==  Address 0x54f13dc is 0 bytes after a block of size 4 alloc'd
> ==10163==at 0x402C19C: malloc (in
> /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
> ==10163==by 0x8123BC1: lalloc (misc2.c:942)
> ==10163==by 0x8123AB1: alloc (misc2.c:840)
> ==10163==by 0x812407D: vim_strsave (misc2.c:1285)
> ==10163==by 0x8205E46: get_func_line (userfunc.c:3188)
> ==10163==by 0x80B3B2C: do_cmdline (ex_docmd.c:1006)
> ==10163==by 0x820129A: call_user_func (userfunc.c:893)
> ==10163==by 0x820220E: call_func (userfunc.c:1353)
> ==10163==by 0x82002C1: get_func_tv (userfunc.c:455)
> ==10163==by 0x8205944: ex_call (userfunc.c:2981)
> ==10163==by 0x80B6FF7: do_one_cmd (ex_docmd.c:2962)
> ==10163==by 0x80B3DA0: do_cmdline (ex_docmd.c:1110)
> ==10163==by 0x80B1CE5: do_source (ex_cmds2.c:4110)
> ==10163==by 0x80B13DD: cmd_source (ex_cmds2.c:3723)
> ==10163==by 0x80B133B: ex_source (ex_cmds2.c:3698)
> ==10163==by 0x80B6FF7: do_one_cmd (ex_docmd.c:2962)
> ==10163==by 0x80B3DA0: do_cmdline (ex_docmd.c:1110)
> ==10163==by 0x80B3465: do_cmdline_cmd (ex_docmd.c:715)
> ==10163==by 0x823BEE0: exe_commands (main.c:2896)
> ==10163==by 0x82392A2: vim_main2 (main.c:781)
> ==10163==by 0x8238BC3: main (main.c:415)
> 
> I can try to debug it this weekend.

I like to get fixes in ASAP before the Vim 8 release.
I'll look into it, I probably already found it, need to do some tests.

Oh, after writing a test for this I see another failure...

-- 
>From the classified section of a city newspaper:
Dog for sale: eats anything and is fond of children.

 /// 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 7.4.2355

2016-09-09 Fir de Conversatie Bram Moolenaar

Patch 7.4.2355
Problem:Regexp fails to match when using "\>\)\?". (Ramel)
Solution:   When a state is already in the list, but addstate_here() is used
and the existing state comes later, add the new state anyway.
Files:  src/regexp_nfa.c, src/testdir/test_regexp_latin.vim


*** ../vim-7.4.2354/src/regexp_nfa.c2016-09-09 17:59:46.689781750 +0200
--- src/regexp_nfa.c2016-09-09 20:26:46.959522104 +0200
***
*** 4340,4345 
--- 4340,4348 
  return FALSE;
  }
  
+ /* Offset used for "off" by addstate_here(). */
+ #define ADDSTATE_HERE_OFFSET 10
+ 
  /*
   * Add "state" and possibly what follows to state list ".".
   * Returns "subs_arg", possibly copied into temp_subs.
***
*** 4350,4358 
  nfa_state_T   *state, /* state to update */
  regsubs_T *subs_arg,  /* pointers to subexpressions */
  nfa_pim_T *pim,   /* postponed look-behind match */
! int   off)/* byte offset, when -1 go to next 
line */
  {
  int   subidx;
  nfa_thread_T  *thread;
  struct multipos   save_multipos;
  int   save_in_use;
--- 4353,4366 
  nfa_state_T   *state, /* state to update */
  regsubs_T *subs_arg,  /* pointers to subexpressions */
  nfa_pim_T *pim,   /* postponed look-behind match */
! int   off_arg)/* byte offset, when -1 go to next 
line */
  {
  int   subidx;
+ int   off = off_arg;
+ int   add_here = FALSE;
+ int   listindex = 0;
+ int   k;
+ int   found = FALSE;
  nfa_thread_T  *thread;
  struct multipos   save_multipos;
  int   save_in_use;
***
*** 4365,4370 
--- 4373,4385 
  int   did_print = FALSE;
  #endif
  
+ if (off_arg <= -ADDSTATE_HERE_OFFSET)
+ {
+   add_here = TRUE;
+   off = 0;
+   listindex = -(off_arg + ADDSTATE_HERE_OFFSET);
+ }
+ 
  switch (state->c)
  {
case NFA_NCLOSE:
***
*** 4448,4460 
if (!nfa_has_backref && pim == NULL && !l->has_pim
 && state->c != NFA_MATCH)
{
  skip_add:
  #ifdef ENABLE_LOG
!   nfa_set_code(state->c);
!   fprintf(log_fd, "> Not adding state %d to list %d. char %d: 
%s\n",
!   abs(state->id), l->id, state->c, code);
  #endif
!   return subs;
}
  
/* Do not add the state again when it exists with the same
--- 4463,4490 
if (!nfa_has_backref && pim == NULL && !l->has_pim
 && state->c != NFA_MATCH)
{
+   /* When called from addstate_here() do insert before
+* existing states. */
+   if (add_here)
+   {
+   for (k = 0; k < l->n && k < listindex; ++k)
+   if (l->t[k].state->id == state->id)
+   {
+   found = TRUE;
+   break;
+   }
+   }
+   if (!add_here || found)
+   {
  skip_add:
  #ifdef ENABLE_LOG
!   nfa_set_code(state->c);
!   fprintf(log_fd, "> Not adding state %d to list %d. char 
%d: %s pim: %s has_pim: %d found: %d\n",
!   abs(state->id), l->id, state->c, code,
!   pim == NULL ? "NULL" : "yes", l->has_pim, found);
  #endif
!   return subs;
!   }
}
  
/* Do not add the state again when it exists with the same
***
*** 4519,4532 
  
case NFA_SPLIT:
/* order matters here */
!   subs = addstate(l, state->out, subs, pim, off);
!   subs = addstate(l, state->out1, subs, pim, off);
break;
  
case NFA_EMPTY:
case NFA_NOPEN:
case NFA_NCLOSE:
!   subs = addstate(l, state->out, subs, pim, off);
break;
  
case NFA_MOPEN:
--- 4549,4562 
  
case NFA_SPLIT:
/* order matters here */
!   subs = addstate(l, state->out, subs, pim, off_arg);
!   subs = addstate(l, state->out1, subs, pim, off_arg);
break;
  
case NFA_EMPTY:
case NFA_NOPEN:
case NFA_NCLOSE:
!   subs = addstate(l, state->out, subs, pim, off_arg);
break;
  
case NFA_MOPEN:
***
*** 4626,4632 
sub->list.line[subidx].start = reginput + off;
}
  

[bug] access beyond end of string when doing search with /

2016-09-09 Fir de Conversatie Dominique Pellé
Hi

afl-fuzz found a bug in vim-7.4.2354 and older.
Default vim in xubuntu-14.04 (vim-7.4.52) also has
the bug, so it's an old bug.

$ cat log

And log file contains:

==10163== Memcheck, a memory error detector
==10163== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==10163== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==10163== Command: vim -u NONE -i NONE -S bug.vim
==10163==
==10163== Invalid read of size 1
==10163==at 0x8060A3D: skipwhite (charset.c:1522)
==10163==by 0x80B9F0A: get_address (ex_docmd.c:4593)
==10163==by 0x80B5A00: do_one_cmd (ex_docmd.c:2179)
==10163==by 0x80B3DA0: do_cmdline (ex_docmd.c:1110)
==10163==by 0x820129A: call_user_func (userfunc.c:893)
==10163==by 0x820220E: call_func (userfunc.c:1353)
==10163==by 0x82002C1: get_func_tv (userfunc.c:455)
==10163==by 0x8205944: ex_call (userfunc.c:2981)
==10163==by 0x80B6FF7: do_one_cmd (ex_docmd.c:2962)
==10163==by 0x80B3DA0: do_cmdline (ex_docmd.c:1110)
==10163==by 0x80B1CE5: do_source (ex_cmds2.c:4110)
==10163==by 0x80B13DD: cmd_source (ex_cmds2.c:3723)
==10163==by 0x80B133B: ex_source (ex_cmds2.c:3698)
==10163==by 0x80B6FF7: do_one_cmd (ex_docmd.c:2962)
==10163==by 0x80B3DA0: do_cmdline (ex_docmd.c:1110)
==10163==by 0x80B3465: do_cmdline_cmd (ex_docmd.c:715)
==10163==by 0x823BEE0: exe_commands (main.c:2896)
==10163==by 0x82392A2: vim_main2 (main.c:781)
==10163==by 0x8238BC3: main (main.c:415)
==10163==  Address 0x54f13dc is 0 bytes after a block of size 4 alloc'd
==10163==at 0x402C19C: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==10163==by 0x8123BC1: lalloc (misc2.c:942)
==10163==by 0x8123AB1: alloc (misc2.c:840)
==10163==by 0x812407D: vim_strsave (misc2.c:1285)
==10163==by 0x8205E46: get_func_line (userfunc.c:3188)
==10163==by 0x80B3B2C: do_cmdline (ex_docmd.c:1006)
==10163==by 0x820129A: call_user_func (userfunc.c:893)
==10163==by 0x820220E: call_func (userfunc.c:1353)
==10163==by 0x82002C1: get_func_tv (userfunc.c:455)
==10163==by 0x8205944: ex_call (userfunc.c:2981)
==10163==by 0x80B6FF7: do_one_cmd (ex_docmd.c:2962)
==10163==by 0x80B3DA0: do_cmdline (ex_docmd.c:1110)
==10163==by 0x80B1CE5: do_source (ex_cmds2.c:4110)
==10163==by 0x80B13DD: cmd_source (ex_cmds2.c:3723)
==10163==by 0x80B133B: ex_source (ex_cmds2.c:3698)
==10163==by 0x80B6FF7: do_one_cmd (ex_docmd.c:2962)
==10163==by 0x80B3DA0: do_cmdline (ex_docmd.c:1110)
==10163==by 0x80B3465: do_cmdline_cmd (ex_docmd.c:715)
==10163==by 0x823BEE0: exe_commands (main.c:2896)
==10163==by 0x82392A2: vim_main2 (main.c:781)
==10163==by 0x8238BC3: main (main.c:415)

I can try to debug it this weekend.

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.


Re: [vim/vim] gvim exits with "BadWindow (invalid window parameter)" when highlighting large regions (#1023)

2016-09-09 Fir de Conversatie Yegappan Lakshmanan
Hi,

On Fri, Sep 9, 2016 at 2:33 AM, John Little  wrote:
> On Thursday, September 8, 2016 at 7:54:00 PM UTC+12, nuko8 wrote:
>
>> Accordingly, I'd like to suggest that the issue be viewed more in
>> terms of interaction between KDE and GTK+ 2 as well as usage of the
>> KDE desktop environment.
>
> I agree with your conclusion, but it is a severe gvim failure.  For
> me, any text file large enough, about 5000 lines, causes gvim to exit
> if one tries to ggVG. In the vim source directory, eval.c is not big
> enough, but cat e*.c
> > x.c makes a file big enough.
>

I reported this problem a few years (2013) ago. The e-mail
thread with an analysis is below.

- Yegappan


-- Forwarded message --
From: Yegappan Lakshmanan 
Date: Mon, Aug 12, 2013 at 1:10 PM
Subject: Re: Vim crashes when selecting more than 262040 characters
To: vim_dev@googlegroups.com


Hi all,

On Tue, Apr 16, 2013 at 1:11 PM, Bram Moolenaar  wrote:
>
>> >>
>> >> I am running Vim 7.3.831 on a Linux system built with GTK 2.0.
>> >> When I execute the following steps, Vim crashes:
>> >>
>> >> 1. Open an empty buffer
>> >> 2. Enter insert mode using 'i'
>> >> 3. Insert 262040 characters using =repeat('a', 262040)
>> >> 4. Press 
>> >> 5. Select and yank all the characters using 'V' and 'y'
>> >> 6. Wait for a few seconds and move the cursor
>> >>
>> >> The crash traceback is below:
>> >>
>> >> #0  0x0048dfb9 in free () from /lib/tls/libc.so.6
>> >> #1  0x0088c3a3 in XtFree () from /usr/X11R6/lib/libXt.so.6
>> >> #2  0x008ad502 in XtAppGetSelectionTimeout () from 
>> >> /usr/X11R6/lib/libXt.so.6
>> >> #3  0x008a7144 in _XtRemoveAllInputs () from /usr/X11R6/lib/libXt.so.6
>> >> #4  0x008a74b2 in XtAppNextEvent () from /usr/X11R6/lib/libXt.so.6
>> >> #5  0x08139ae4 in xterm_update () at os_unix.c:6824
>> >> #6  0x08138089 in RealWaitForChar (fd=0, msec=0, check_for_gpm=0x0) at
>> >> os_unix.c:5200U __be_errno_kernel_to_ios
>> >> #7  0x08137e74 in mch_breakcheck () at os_unix.c:4847
>> >> #8  0x080dcc85 in vgetorpeek (advance=1) at getchar.c:2014
>> >> #9  0x080db494 in vgetc () at getchar.c:1582
>> >> #10 0x080db90f in safe_vgetc () at getchar.c:1787
>> >> #11 0x0811437c in normal_cmd (oap=0xbfff85d0, toplevel=1) at normal.c:665
>> >> #12 0x081b649e in main_loop (cmdwin=0, noexmode=0) at main.c:1306
>> >> #13 0x081b5c70 in main (argc=0, argv=0x0) at main.c:1010
>> >>
>> >> I can consistently reproduce this crash. I couldn't reproduce this crash
>> >> with
>> >> the earlier Vim 7.2 release.
>> >>
>> >> Anyone else able to reproduce this crash?
>> >
>> > I was able to reproduce the crash just once and then I couldn't
>> > reproduce it anymore. It seems that something in the X-libraries
>> > (starting with XtAppnextEvent()) is going wrong. (I got a double free()
>> > error in free())
>> >
>>
>> I spent some time trying to narrow down the patch that introduced
>> this problem. I am not able to reproduce the crash with the
>> 7.2.446 release. But I am able to reproduce the crash with Vim 7.3
>> version.
>>
>> I found that the following change to os_unix.c fixes the crash:
>>
>> *** os_unix.c.orig  2013-04-15 21:05:25.0 -0700
>> --- os_unix.c   2013-04-15 21:12:38.0 -0700
>> *** setup_term_clip()
>> *** 6465,6471 
>> return;
>>
>> x11_setup_atoms(xterm_dpy);
>> -   x11_setup_selection(xterm_Shell);
>> if (x11_display == NULL)
>> x11_display = xterm_dpy;
>>
>> --- 6465,6470 
>>
>> This line was introduced in the 7.3 Vim release.
>
> Interesting.  This line was added for good reasons, to fix the problems
> with not using a proper timestamp when owning the selection.
> Thus removing the line is not the way to fix your problem.
>
> Perhaps something in clip_x11_timestamp_cb() is causing the problem?
>

I still see this crash with Vim 7.4 (of course this problem is not yet fixed).

This crash is definitely caused by the code in the
clip_x11_convert_selection_cb()
function in ui.c. If I do an early return from this function, then I
am not able to
reproduce this problem. But I am not able to pinpoint the problem in
this function
(as the backtrace points to the Xt library functions).

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


Re: [vim/vim] Static analysis report (#1049)

2016-09-09 Fir de Conversatie Yegappan Lakshmanan
Hi Christian,

On Fri, Sep 9, 2016 at 12:08 AM, Christian Brabandt
 wrote:
> How did you create that report?
>

I use the following steps to run static analysis using the clang
static analyzer (http://clang-analyzer.llvm.org/)

$ scan-build -o /tmp/vim_report ./configure --with-features=huge
$ scan-build -o /tmp/vim_report make

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


Patch 7.4.2354

2016-09-09 Fir de Conversatie Bram Moolenaar

Patch 7.4.2354
Problem:The example that explains nested backreferences does not work
properly with the new regexp engine. (Harm te Hennepe)
Solution:   Also save the end position when adding a state. (closes #990)
Files:  src/regexp_nfa.c, src/testdir/test_regexp_latin.vim


*** ../vim-7.4.2353/src/regexp_nfa.c2016-08-29 22:48:12.165106045 +0200
--- src/regexp_nfa.c2016-09-09 17:45:51.693549619 +0200
***
*** 4354,4360 
  {
  int   subidx;
  nfa_thread_T  *thread;
! lpos_Tsave_lpos;
  int   save_in_use;
  char_u*save_ptr;
  int   i;
--- 4354,4360 
  {
  int   subidx;
  nfa_thread_T  *thread;
! struct multipos   save_multipos;
  int   save_in_use;
  char_u*save_ptr;
  int   i;
***
*** 4572,4579 
  
/* avoid compiler warnings */
save_ptr = NULL;
!   save_lpos.lnum = 0;
!   save_lpos.col = 0;
  
/* Set the position (with "off" added) in the subexpression.  Save
 * and restore it when it was in use.  Otherwise fill any gap. */
--- 4572,4578 
  
/* avoid compiler warnings */
save_ptr = NULL;
!   vim_memset(_multipos, 0, sizeof(save_multipos));
  
/* Set the position (with "off" added) in the subexpression.  Save
 * and restore it when it was in use.  Otherwise fill any gap. */
***
*** 4581,4588 
{
if (subidx < sub->in_use)
{
!   save_lpos.lnum = sub->list.multi[subidx].start_lnum;
!   save_lpos.col = sub->list.multi[subidx].start_col;
save_in_use = -1;
}
else
--- 4580,4586 
{
if (subidx < sub->in_use)
{
!   save_multipos = sub->list.multi[subidx];
save_in_use = -1;
}
else
***
*** 4640,4649 
if (save_in_use == -1)
{
if (REG_MULTI)
! {
!   sub->list.multi[subidx].start_lnum = save_lpos.lnum;
!   sub->list.multi[subidx].start_col = save_lpos.col;
! }
else
sub->list.line[subidx].start = save_ptr;
}
--- 4638,4644 
if (save_in_use == -1)
{
if (REG_MULTI)
!   sub->list.multi[subidx] = save_multipos;
else
sub->list.line[subidx].start = save_ptr;
}
***
*** 4707,4714 
sub->in_use = subidx + 1;
if (REG_MULTI)
{
!   save_lpos.lnum = sub->list.multi[subidx].end_lnum;
!   save_lpos.col = sub->list.multi[subidx].end_col;
if (off == -1)
{
sub->list.multi[subidx].end_lnum = reglnum + 1;
--- 4702,4708 
sub->in_use = subidx + 1;
if (REG_MULTI)
{
!   save_multipos = sub->list.multi[subidx];
if (off == -1)
{
sub->list.multi[subidx].end_lnum = reglnum + 1;
***
*** 4728,4735 
save_ptr = sub->list.line[subidx].end;
sub->list.line[subidx].end = reginput + off;
/* avoid compiler warnings */
!   save_lpos.lnum = 0;
!   save_lpos.col = 0;
}
  
subs = addstate(l, state->out, subs, pim, off);
--- 4722,4728 
save_ptr = sub->list.line[subidx].end;
sub->list.line[subidx].end = reginput + off;
/* avoid compiler warnings */
!   vim_memset(_multipos, 0, sizeof(save_multipos));
}
  
subs = addstate(l, state->out, subs, pim, off);
***
*** 4742,4751 
sub = >norm;
  
if (REG_MULTI)
! {
!   sub->list.multi[subidx].end_lnum = save_lpos.lnum;
!   sub->list.multi[subidx].end_col = save_lpos.col;
! }
else
sub->list.line[subidx].end = save_ptr;
sub->in_use = save_in_use;
--- 4735,4741 
sub = >norm;
  
if (REG_MULTI)
!   sub->list.multi[subidx] = save_multipos;
else
sub->list.line[subidx].end = save_ptr;
sub->in_use = save_in_use;
*** ../vim-7.4.2353/src/testdir/test_regexp_latin.vim   2016-08-18 
23:04:44.662592810 +0200
--- src/testdir/test_regexp_latin.vim   2016-09-09 17:52:55.139578167 +0200
***
*** 38,40 
--- 38,55 
call setwinvar(1, 'myvar', 1)
bwipe!
  endfunc

Patch 7.4.2353

2016-09-09 Fir de Conversatie Bram Moolenaar

Patch 7.4.2353
Problem:Not enough test coverage for Normal mode commands.
Solution:   Add more tests. (Christian Brabandt)
Files:  src/testdir/test_normal.vim


*** ../vim-7.4.2352/src/testdir/test_normal.vim 2016-09-08 23:35:27.022913833 
+0200
--- src/testdir/test_normal.vim 2016-09-09 16:54:46.336785660 +0200
***
*** 13,21 
call setline(ln, substitute(line, '\s\+$', '', '') . '->$')
  endif
endfor
! endfu
  
! function! CountSpaces(type, ...)
" for testing operatorfunc
" will count the number of spaces
" and return the result in g:a
--- 13,21 
call setline(ln, substitute(line, '\s\+$', '', '') . '->$')
  endif
endfor
! endfunc
  
! func! CountSpaces(type, ...)
" for testing operatorfunc
" will count the number of spaces
" and return the result in g:a
***
*** 33,39 
let g:a=strlen(substitute(@@, '[^ ]', '', 'g'))
let  = sel_save
let @@ = reg_save
! endfunction
  
  fun! Test_normal00_optrans()
new
--- 33,43 
let g:a=strlen(substitute(@@, '[^ ]', '', 'g'))
let  = sel_save
let @@ = reg_save
! endfunc
! 
! func! IsWindows()
!   return has("win32") || has("win64") || has("win95")
! endfunc
  
  fun! Test_normal00_optrans()
new
***
*** 60,86 
" clean up
set cpo-=#
bw!
! endfu
  
  func! Test_normal01_keymodel()
call Setup_NewWindow()
" Test 1: depending on 'keymodel'  does something different
!   :50
call feedkeys("V\y", 'tx')
call assert_equal(['47', '48', '49', '50'], getline("'<", "'>"))
!   :set keymodel=startsel
!   :50
call feedkeys("V\y", 'tx')
call assert_equal(['49', '50'], getline("'<", "'>"))
" Start visual mode when keymodel = startsel
!   :50
call feedkeys("\y", 'tx')
call assert_equal(['49', '5'], getreg(0, 0, 1))
" Do not start visual mode when keymodel=
!   :set keymodel=
!   :50
call feedkeys("\y$", 'tx')
call assert_equal(['42'], getreg(0, 0, 1))
  
" clean up
bw!
--- 64,100 
" clean up
set cpo-=#
bw!
! endfunc
  
  func! Test_normal01_keymodel()
call Setup_NewWindow()
" Test 1: depending on 'keymodel'  does something different
!   50
call feedkeys("V\y", 'tx')
call assert_equal(['47', '48', '49', '50'], getline("'<", "'>"))
!   set keymodel=startsel
!   50
call feedkeys("V\y", 'tx')
call assert_equal(['49', '50'], getline("'<", "'>"))
" Start visual mode when keymodel = startsel
!   50
call feedkeys("\y", 'tx')
call assert_equal(['49', '5'], getreg(0, 0, 1))
" Do not start visual mode when keymodel=
!   set keymodel=
!   50
call feedkeys("\y$", 'tx')
call assert_equal(['42'], getreg(0, 0, 1))
+   " Stop visual mode when keymodel=stopsel
+   set keymodel=stopsel
+   50
+   call feedkeys("Vkk\yy", 'tx')
+   call assert_equal(['47'], getreg(0, 0, 1))
+ 
+   set keymodel=
+   50
+   call feedkeys("Vkk\yy", 'tx')
+   call assert_equal(['47', '48', '49', '50'], getreg(0, 0, 1))
  
" clean up
bw!
***
*** 98,104 
call assert_equal('y60', getline('.'))
" clean up
bw!
! endfu
  
  func! Test_normal03_join()
" basic join test
--- 112,128 
call assert_equal('y60', getline('.'))
" clean up
bw!
! endfunc
! 
! func! Test_normal02_selectmode2()
!   " some basic select mode tests
!   call Setup_NewWindow()
!   50
!   call feedkeys(":set im\n\gHc\:set noim\n", 'tx')
!   call assert_equal('c51', getline('.'))
!   " clean up
!   bw!
! endfunc
  
  func! Test_normal03_join()
" basic join test
***
*** 118,129 
call assert_equal('100', getline('.'))
" clean up
bw!
! endfu
  
  func! Test_normal04_filter()
" basic filter test
" only test on non windows platform
!   if has("win32") || has("win64") || has("win95")
  return
endif
call Setup_NewWindow()
--- 142,153 
call assert_equal('100', getline('.'))
" clean up
bw!
! endfunc
  
  func! Test_normal04_filter()
" basic filter test
" only test on non windows platform
!   if IsWindows()
  return
endif
call Setup_NewWindow()
***
*** 144,150 
call assert_equal('one', getline('.'))
set cpo-=!
bw!
! endfu
  
  func! Test_normal05_formatexpr()
" basic formatexpr test
--- 168,174 
call assert_equal('one', getline('.'))
set cpo-=!
bw!
! endfunc
  
  func! Test_normal05_formatexpr()
" basic formatexpr test
***
*** 157,163 
call assert_equal(['here: 1->$', '2', 'here: 3->$', '4', 'not here:   '], 
getline(1,'$'))
set formatexpr=
bw!
! endfu
  
  func Test_normal05_formatexpr_newbuf()
" Edit another buffer in the 'formatexpr' function
--- 181,187 
call assert_equal(['here: 1->$', '2', 'here: 3->$', '4', 'not here:   '], 
getline(1,'$'))
set formatexpr=
bw!
! endfunc
  
  func Test_normal05_formatexpr_newbuf()
" Edit another buffer in the 'formatexpr' 

Re: [vim/vim] Runtime files do not include sbt.vim (#1051)

2016-09-09 Fir de Conversatie Matthew Desjardins
On Friday, September 9, 2016 at 9:24:11 AM UTC-4, Denton Liu wrote:
> Inside runtime/compiler, a file is missing, sbt.vim, which can be found here. 
> This is because ftplugin/scala.vim requires sbt in order to be sourced.
> 
> 
> Currently, I am getting this error when I'm loading any *.scala files:
> 
> Error detected while processing /usr/share/vim/vim74/ftplugin/scala.vim:
> line   35:
> E666: compiler not supported: sbt
> 
> 
> 
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub

The scala ftplugin (which was just added to the default runtime in the last 
month), was updated again 3 days ago to remove the "compiler sbt".

See:
https://github.com/vim/vim/pull/995
https://github.com/vim/vim/pull/1043
https://github.com/vim/vim/commit/64d8e25bf6efe5f18b032563521c3ce278c316ab#diff-15

-- 
-- 
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 7.4.2352

2016-09-09 Fir de Conversatie Bram Moolenaar

Patch 7.4.2352
Problem:Netbeans test fails in shadow directory.
Solution:   Also copy README.txt to the shadow directory.
Files:  src/Makefile


*** ../vim-7.4.2351/src/Makefile2016-09-07 20:46:13.769431891 +0200
--- src/Makefile2016-09-09 16:02:10.548462640 +0200
***
*** 2714,2719 
--- 2714,2720 
mkdir $(SHADOWDIR)/testdir
cd $(SHADOWDIR)/testdir; ln -s ../../testdir/Makefile \
 ../../testdir/Make_all.mak \
+../../testdir/README.txt \
 ../../testdir/*.in \
 ../../testdir/*.vim \
 ../../testdir/*.py \
*** ../vim-7.4.2351/src/version.c   2016-09-09 15:31:28.781679117 +0200
--- src/version.c   2016-09-09 16:02:49.727914557 +0200
***
*** 765,766 
--- 765,768 
  {   /* Add new patch number below this line */
+ /**/
+ 2352,
  /**/

-- 
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.


Re: [vim/vim] Runtime files do not include sbt.vim (#1051)

2016-09-09 Fir de Conversatie Charles E Campbell
Denton Liu wrote:
>
> Inside |runtime/compiler|, a file is missing, |sbt.vim|, which can be
> found here
> . This
> is because |ftplugin/scala.vim|
> 
> requires |sbt| in order to be sourced.
>
> Currently, I am getting this error when I'm loading any |*.scala| files:
>
> |Error detected while processing
> /usr/share/vim/vim74/ftplugin/scala.vim: line 35: E666: compiler not
> supported: sbt |
>
Hello:

I have vim v7.4.2351, huge version:

 * the string "sbt" does not appear in ftplugin/scala.vim (actually,
fgrep sbt *.vim in that directory shows that it doesn't appear anywhere
in that directory)
 * vim -u NONE -N junk.scala does not have the error message you're getting
 * I've also tried with a minimal .vimrc:  vim -u simple8.vimrc
junk.scala   and did not get any error messages  (the file "junk.scala"
doesn't exist on my system)

Are you sure that you haven't modified your system file(s)?

Regards,
Chip Campbell

-- 
-- 
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.
set nocp
filetype plugin indent on
syn on


Patch 7.4.2351

2016-09-09 Fir de Conversatie Bram Moolenaar

Patch 7.4.2351
Problem:Netbeans test fails when run from unpacked MS-Windows sources.
Solution:   Open README.txt instead of Makefile.
Files:  src/testdir/test_netbeans.py, src/testdir/test_netbeans.vim


*** ../vim-7.4.2350/src/testdir/test_netbeans.py2016-07-15 
17:08:45.65870 +0200
--- src/testdir/test_netbeans.py2016-09-09 15:27:58.028533727 +0200
***
*** 42,51 
  myfile.write(received)
  
  response = ''
! if received.find('Makefile') > 0:
  name = received.split('"')[1]
  response = '5:putBufferNumber!33 "' + name + '"\n'
! response += '5:setDot!1 2/19\n'
  elif received.find('disconnect') > 0:
  # we're done
  self.server.shutdown()
--- 42,51 
  myfile.write(received)
  
  response = ''
! if received.find('README.txt') > 0:
  name = received.split('"')[1]
  response = '5:putBufferNumber!33 "' + name + '"\n'
! response += '5:setDot!1 3/19\n'
  elif received.find('disconnect') > 0:
  # we're done
  self.server.shutdown()
*** ../vim-7.4.2350/src/testdir/test_netbeans.vim   2016-08-27 
19:52:43.069912717 +0200
--- src/testdir/test_netbeans.vim   2016-09-09 15:28:11.428352210 +0200
***
*** 23,35 
call assert_true(has("netbeans_enabled"))
  
call WaitFor('len(readfile("Xnetbeans")) > 2')
!   split +$ Makefile
  
!   " Opening Makefile will result in a setDot command
call WaitFor('len(readfile("Xnetbeans")) > 4')
call WaitFor('getcurpos()[1] == 2')
let pos = getcurpos()
!   call assert_equal(2, pos[1])
call assert_equal(20, pos[2])
close
nbclose
--- 23,35 
call assert_true(has("netbeans_enabled"))
  
call WaitFor('len(readfile("Xnetbeans")) > 2')
!   split +$ README.txt
  
!   " Opening README.txt will result in a setDot command
call WaitFor('len(readfile("Xnetbeans")) > 4')
call WaitFor('getcurpos()[1] == 2')
let pos = getcurpos()
!   call assert_equal(3, pos[1])
call assert_equal(20, pos[2])
close
nbclose
***
*** 39,45 
call assert_equal('AUTH bunny', lines[0])
call assert_equal('0:version=0 "2.5"', lines[1])
call assert_equal('0:startupDone=0', lines[2])
!   call assert_equal('0:fileOpened=0 "Makefile" T F', substitute(lines[3], 
'".*/', '"', ''))
  
call assert_equal('0:disconnect=1', lines[6])
  
--- 39,45 
call assert_equal('AUTH bunny', lines[0])
call assert_equal('0:version=0 "2.5"', lines[1])
call assert_equal('0:startupDone=0', lines[2])
!   call assert_equal('0:fileOpened=0 "README.txt" T F', substitute(lines[3], 
'".*/', '"', ''))
  
call assert_equal('0:disconnect=1', lines[6])
  
*** ../vim-7.4.2350/src/version.c   2016-09-09 14:59:35.211627252 +0200
--- src/version.c   2016-09-09 15:26:39.209601485 +0200
***
*** 765,766 
--- 765,768 
  {   /* Add new patch number below this line */
+ /**/
+ 2351,
  /**/

-- 
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/ \\\
\\\  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 7.4.2350

2016-09-09 Fir de Conversatie Bram Moolenaar

Patch 7.4.2350
Problem:Test 86 and 87 fail with some version of Python.
Solution:   Unify "can't" and "cannot".  Unify quotes.
Files:  src/testdir/test86.in, src/testdir/test86.ok,
src/testdir/test87.in, src/testdir/test87.ok


*** ../vim-7.4.2349/src/testdir/test86.in   2016-05-25 20:38:49.757864614 
+0200
--- src/testdir/test86.in   2016-09-09 14:40:40.015309142 +0200
***
*** 239,244 
--- 239,252 
'TypeError:("\'FailingNumber\' object is not 
iterable",)')
  if msg.find('(\'\'') > -1 or msg.find('(\'can\'t') > -1:
  msg = msg.replace('(\'', '("').replace('\',)', '",)')
+ # Some Python versions say can't, others cannot.
+ if msg.find('can\'t') > -1:
+ msg = msg.replace('can\'t', 'cannot')
+ # Some Python versions use single quote, some double quote
+ if msg.find('"cannot ') > -1:
+ msg = msg.replace('"cannot ', '\'cannot ')
+ if msg.find(' attributes"') > -1:
+ msg = msg.replace(' attributes"', ' attributes\'')
  if expr == 'fd(self=[])':
  # HACK: PyMapping_Check changed meaning
  msg = msg.replace('AttributeError:(\'keys\',)',
*** ../vim-7.4.2349/src/testdir/test86.ok   2016-05-31 22:31:19.778640756 
+0200
--- src/testdir/test86.ok   2016-09-06 23:21:07.586841782 +0200
***
*** 628,634 
  test86.in
  > Output
  >> OutputSetattr
! del sys.stdout.softspace:AttributeError:("can't delete OutputObject 
attributes",)
  >>> Testing NumberToLong using sys.stdout.softspace = %s
  sys.stdout.softspace = []:TypeError:('expected int(), long() or something 
supporting coercing to long(), but got list',)
  sys.stdout.softspace = None:TypeError:('expected int(), long() or something 
supporting coercing to long(), but got NoneType',)
--- 628,634 
  test86.in
  > Output
  >> OutputSetattr
! del sys.stdout.softspace:AttributeError:('cannot delete OutputObject 
attributes',)
  >>> Testing NumberToLong using sys.stdout.softspace = %s
  sys.stdout.softspace = []:TypeError:('expected int(), long() or something 
supporting coercing to long(), but got list',)
  sys.stdout.softspace = None:TypeError:('expected int(), long() or something 
supporting coercing to long(), but got NoneType',)
*** ../vim-7.4.2349/src/testdir/test87.in   2016-05-25 20:38:49.757864614 
+0200
--- src/testdir/test87.in   2016-09-09 14:57:15.943889362 +0200
***
*** 238,246 
  else:
  cb.append(expr + ':' + repr((e.__class__, e)))
  elif sys.version_info >= (3, 5) and e.__class__ is ValueError and 
str(e) == 'embedded null byte':
! msg = cb.append(expr + ':' + repr((TypeError, 
TypeError('expected bytes with no null'
  else:
! cb.append(expr + ':' + repr((e.__class__, e)))
  else:
  cb.append(expr + ':NOT FAILED')
  except Exception as e:
--- 238,255 
  else:
  cb.append(expr + ':' + repr((e.__class__, e)))
  elif sys.version_info >= (3, 5) and e.__class__ is ValueError and 
str(e) == 'embedded null byte':
! cb.append(expr + ':' + repr((TypeError, TypeError('expected 
bytes with no null'
  else:
! msg = repr((e.__class__, e))
! # Some Python versions say can't, others cannot.
! if msg.find('can\'t') > -1:
! msg = msg.replace('can\'t', 'cannot')
! # Some Python versions use single quote, some double quote
! if msg.find('"cannot ') > -1:
! msg = msg.replace('"cannot ', '\'cannot ')
! if msg.find(' attributes"') > -1:
! msg = msg.replace(' attributes"', ' attributes\'')
! cb.append(expr + ':' + msg)
  else:
  cb.append(expr + ':NOT FAILED')
  except Exception as e:
*** ../vim-7.4.2349/src/testdir/test87.ok   2016-05-31 22:31:19.778640756 
+0200
--- src/testdir/test87.ok   2016-09-09 14:57:25.769427204 +0200
***
*** 628,634 
  test87.in
  > Output
  >> OutputSetattr
! del sys.stdout.softspace:(, AttributeError("can't 
delete OutputObject attributes",))
  >>> Testing NumberToLong using sys.stdout.softspace = %s
  sys.stdout.softspace = []:(, TypeError('expected int() or 
something supporting coercing to int(), but got list',))
  sys.stdout.softspace = None:(, TypeError('expected int() 
or something supporting coercing to int(), but got NoneType',))
--- 628,634 
  test87.in
  > Output
  >> OutputSetattr
! del sys.stdout.softspace:(, AttributeError('cannot 
delete OutputObject attributes',))
  >>> Testing NumberToLong using sys.stdout.softspace = %s
  sys.stdout.softspace = []:(, TypeError('expected int() or 
something supporting coercing to int(), but got list',))
  sys.stdout.softspace 

Patch 7.4.2349

2016-09-09 Fir de Conversatie Bram Moolenaar

Patch 7.4.2349
Problem:Valgrind reports using uninitialzed memory. (Dominique Pelle)
Solution:   Check the length before checking for a NUL.
Files:  src/message.c


*** ../vim-7.4.2348/src/message.c   2016-09-06 22:15:04.753077591 +0200
--- src/message.c   2016-09-09 14:10:47.124165329 +0200
***
*** 2462,2468 
  if (!(silent_mode && p_verbose == 0))
mch_settmode(TMODE_COOK);   /* handle '\r' and '\n' correctly */
  #endif
! while (*s != NUL && (maxlen < 0 || (int)(s - str) < maxlen))
  {
if (!(silent_mode && p_verbose == 0))
{
--- 2462,2468 
  if (!(silent_mode && p_verbose == 0))
mch_settmode(TMODE_COOK);   /* handle '\r' and '\n' correctly */
  #endif
! while ((maxlen < 0 || (int)(s - str) < maxlen) && *s != NUL)
  {
if (!(silent_mode && p_verbose == 0))
{
*** ../vim-7.4.2348/src/version.c   2016-09-09 12:57:05.665313092 +0200
--- src/version.c   2016-09-09 14:12:38.458642881 +0200
***
*** 765,766 
--- 765,768 
  {   /* Add new patch number below this line */
+ /**/
+ 2349,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
211. Your husband leaves you...taking the computer with him and you
 call him crying, and beg him to bring the computer back.

 /// 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.


Re: update to the documentation

2016-09-09 Fir de Conversatie Tony Mechelynck
On Fri, Sep 9, 2016 at 1:41 PM, Bram Moolenaar  wrote:
> The logic for whether the .vimrc file is used is quite complicated.
> That's why we can't make this decision before loading a system vimrc.
>
> I think it's easier to suggest unletting skip_defaults_vim always:
>
>
> This should work well for new Vim users.  If you create your own .vimrc, it is
> recommended to add this line somewhere near the top: >
> unlet! skip_defaults_vim
> source $VIMRUNTIME/defaults.vim
>
ah, yes; maybe this is even better.

> --
> hundred-and-one symptoms of being an internet addict:
> 210. When you get a divorce, you don't care about who gets the children,
>  but discuss endlessly who can use the email address.
>
>  /// 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///

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: callback is not called when job exit immediately.

2016-09-09 Fir de Conversatie mattn
On Friday, September 9, 2016 at 9:52:09 AM UTC+9, mattn wrote:
> okay, will look into it soon.

I tried this but I cound't reproduce this. hmm, seems to be fixed already? 

-- 
-- 
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: update to the documentation

2016-09-09 Fir de Conversatie Bram Moolenaar

Tony Mechelynck wrote:

> On Fri, Sep 9, 2016 at 1:14 PM, Bram Moolenaar  wrote:
> >
> > Christian Brabandt wrote:
> >
> >> here is a small update to the documentation that mentions how to skip
> >> loading the defaults.vim file
> >>
> >> diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
> >> index 14a5f01..2142343 100644
> >> --- a/runtime/doc/starting.txt
> >> +++ b/runtime/doc/starting.txt
> >> @@ -1030,6 +1030,14 @@ If you don't like some of the defaults, you can 
> >> still source defaults.vim and
> >>  revert individual settings.  See the defaults.vim file for hints on how to
> >>  revert each item.
> >>
> >> +   *skip_defaults_vim*
> >> +If you want to skip loading the defaults.vim file, you can set the 
> >> variable
> >> +skip_defaults_vim in your |.vimrc| like this >
> >> +:let g:skip_defaults_vim = 1
> >> +<
> >> +Note: This must be done in a script that is actually loaded before the 
> >> defaults.vim
> >> +file is read |initialization|
> >> +
> >
> > That's a bit misleading, since when Vim finds a .vimrc file it won't
> > load the defaults.  Thus this really only applies to a system vimrc
> > file.  I have this now:
> >
> > *skip_defaults_vim*
> > If you use a system-wide vimrc and don't want defaults.vim to change 
> > settings,
> > set the "skip_defaults_vim" variable.
> >
> >
> 
> Note that this will disable defaults.vim _in all cases_, even when
> sourced by vimrc_example.vim or directly by .vimrc. I would put an
> example after the above paragraph, like this:
> 
> Example:
> if !(filereadable('~/.vimrc') || filereadable('~/_vimrc') ||
> filereadable(expand("$VIM/_vimrc")))
> let skip_defaults_vim = 'skip'
> endif

The logic for whether the .vimrc file is used is quite complicated.
That's why we can't make this decision before loading a system vimrc.

I think it's easier to suggest unletting skip_defaults_vim always:


This should work well for new Vim users.  If you create your own .vimrc, it is
recommended to add this line somewhere near the top: >
unlet! skip_defaults_vim
source $VIMRUNTIME/defaults.vim

-- 
hundred-and-one symptoms of being an internet addict:
210. When you get a divorce, you don't care about who gets the children,
 but discuss endlessly who can use the email address.

 /// 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.


Re: update to the documentation

2016-09-09 Fir de Conversatie Tony Mechelynck
On Fri, Sep 9, 2016 at 1:14 PM, Bram Moolenaar  wrote:
>
> Christian Brabandt wrote:
>
>> here is a small update to the documentation that mentions how to skip
>> loading the defaults.vim file
>>
>> diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
>> index 14a5f01..2142343 100644
>> --- a/runtime/doc/starting.txt
>> +++ b/runtime/doc/starting.txt
>> @@ -1030,6 +1030,14 @@ If you don't like some of the defaults, you can still 
>> source defaults.vim and
>>  revert individual settings.  See the defaults.vim file for hints on how to
>>  revert each item.
>>
>> +   *skip_defaults_vim*
>> +If you want to skip loading the defaults.vim file, you can set the variable
>> +skip_defaults_vim in your |.vimrc| like this >
>> +:let g:skip_defaults_vim = 1
>> +<
>> +Note: This must be done in a script that is actually loaded before the 
>> defaults.vim
>> +file is read |initialization|
>> +
>
> That's a bit misleading, since when Vim finds a .vimrc file it won't
> load the defaults.  Thus this really only applies to a system vimrc
> file.  I have this now:
>
> *skip_defaults_vim*
> If you use a system-wide vimrc and don't want defaults.vim to change settings,
> set the "skip_defaults_vim" variable.
>
>

Note that this will disable defaults.vim _in all cases_, even when
sourced by vimrc_example.vim or directly by .vimrc. I would put an
example after the above paragraph, like this:

Example:
if !(filereadable('~/.vimrc') || filereadable('~/_vimrc') ||
filereadable(expand("$VIM/_vimrc")))
let skip_defaults_vim = 'skip'
endif

> --
> "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///

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: update to the documentation

2016-09-09 Fir de Conversatie Christian Brabandt

On Fr, 09 Sep 2016, Bram Moolenaar wrote:

>   *skip_defaults_vim*
> If you use a system-wide vimrc and don't want defaults.vim to change settings,
> set the "skip_defaults_vim" variable.

Excellent.

Best,
Christian
-- 
Die Eitelkeit des Umgangs wächst am meisten durch Leute, an denen man
kein Interesse nimmt und mit denen man doch spricht.
-- Jean Paul

-- 
-- 
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: [vim/vim] gvim exits with "BadWindow (invalid window parameter)" when highlighting large regions (#1023)

2016-09-09 Fir de Conversatie Bram Moolenaar

John Little wrote:

> On Thursday, September 8, 2016 at 7:54:00 PM UTC+12, nuko8 wrote:
> 
> > Accordingly, I'd like to suggest that the issue be viewed more in terms of 
> > interaction between KDE and GTK+ 2 as well as usage of the KDE desktop 
> > environment.
> 
> I agree with your conclusion, but it is a severe gvim failure.  For me, any 
> text file large enough, about 5000 lines, causes gvim to exit if one tries to 
> ggVG. In the vim source directory, eval.c is not big enough, but cat e*.c > 
> x.c makes a file big enough.

Right, even when the problem is in the system or a library, that doesn't
mean it's OK that Vim crashes.

Is there a way we can detect the situation and avoid it?

-- 
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.


Re: update to the documentation

2016-09-09 Fir de Conversatie Bram Moolenaar

Christian Brabandt wrote:

> here is a small update to the documentation that mentions how to skip 
> loading the defaults.vim file
> 
> diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
> index 14a5f01..2142343 100644
> --- a/runtime/doc/starting.txt
> +++ b/runtime/doc/starting.txt
> @@ -1030,6 +1030,14 @@ If you don't like some of the defaults, you can still 
> source defaults.vim and
>  revert individual settings.  See the defaults.vim file for hints on how to
>  revert each item.
> 
> +   *skip_defaults_vim*
> +If you want to skip loading the defaults.vim file, you can set the variable
> +skip_defaults_vim in your |.vimrc| like this >
> +:let g:skip_defaults_vim = 1
> +<
> +Note: This must be done in a script that is actually loaded before the 
> defaults.vim
> +file is read |initialization|
> +

That's a bit misleading, since when Vim finds a .vimrc file it won't
load the defaults.  Thus this really only applies to a system vimrc
file.  I have this now:

*skip_defaults_vim*
If you use a system-wide vimrc and don't want defaults.vim to change settings,
set the "skip_defaults_vim" variable.


-- 
"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 7.4.2348

2016-09-09 Fir de Conversatie Bram Moolenaar

Patch 7.4.2348
Problem:Crash on exit when EXITFREE is defined. (Dominique Pelle)
Solution:   Don't access curwin when exiting.
Files:  src/buffer.c


*** ../vim-7.4.2347/src/buffer.c2016-09-08 23:35:27.018913864 +0200
--- src/buffer.c2016-09-09 12:51:56.030006528 +0200
***
*** 580,586 
  
  /* When closing the current buffer stop Visual mode before freeing
   * anything. */
! if (buf == curbuf)
end_visual_mode();
  
  /*
--- 580,590 
  
  /* When closing the current buffer stop Visual mode before freeing
   * anything. */
! if (buf == curbuf
! #if defined(EXITFREE)
!   && !entered_free_all_mem
! #endif
!   )
end_visual_mode();
  
  /*
*** ../vim-7.4.2347/src/version.c   2016-09-08 23:35:27.022913833 +0200
--- src/version.c   2016-09-09 12:52:44.353168648 +0200
***
*** 765,766 
--- 765,768 
  {   /* Add new patch number below this line */
+ /**/
+ 2348,
  /**/


-- 
hundred-and-one symptoms of being an internet addict:
207. You're given one phone call in prison and you ask them for a laptop.

 /// 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.


Re: update to the documentation

2016-09-09 Fir de Conversatie Christian Brabandt
Hi Tony!

On Fr, 09 Sep 2016, Tony Mechelynck wrote:

> You seem not to be using the latest help (which surprizes me, coming
> from you). In the  doc/starting.txt dated "Last change: 2016 Sep 03",
> at the exact position of your addition there is a paragraph, maybe not
> as detailed, but possibly more precise:
> 
> 
> If you use a system-wide vimrc and don't want defaults.vim to change settings,
> set the "skip_defaults_vim" variable.
> 
> 
> (i.e. what counts is not its value but its mere existence).

Oops, I did indeed overlook this. Then perhaps add at least a tag 
skip_defaults_vim (like undo_ftplugin)

Best,
Christian
-- 
In der Ehe schämt man sich mehr, der Gattin die geistige Liebe zu
offenbaren als die körperliche; vor der Ehe natürlich umgekehrt.
-- Jean Paul

-- 
-- 
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: some improvements for feedkeys()

2016-09-09 Fir de Conversatie Christian Brabandt
Hi 'Andy!

On Fr, 09 Sep 2016, 'Andy Wokula' via vim_dev wrote:

> Why do you want to "test" CursorHold in a situation where it is not supposed
> to be triggered?

It is in a normal way and I want to test the following thing
(from normal.c:597)

/* Restore counts from before receiving K_CURSORHOLD.  This means after
 * typing "3", handling K_CURSORHOLD and then typing "2" we get "32", not
 * "3 * 2". */

That means, I want to press d12l During hold, I expect CursorHold 
to be triggered and have Vim then remove 12 characters from the current 
line.

Best,
Christian
-- 

-- 
-- 
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: update to the documentation

2016-09-09 Fir de Conversatie Tony Mechelynck
On Fri, Sep 9, 2016 at 9:55 AM, Christian Brabandt  wrote:
> Bram,
> here is a small update to the documentation that mentions how to skip
> loading the defaults.vim file
>
> diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
> index 14a5f01..2142343 100644
> --- a/runtime/doc/starting.txt
> +++ b/runtime/doc/starting.txt
> @@ -1030,6 +1030,14 @@ If you don't like some of the defaults, you can still 
> source defaults.vim and
>  revert individual settings.  See the defaults.vim file for hints on how to
>  revert each item.
>
> +   *skip_defaults_vim*
> +If you want to skip loading the defaults.vim file, you can set the variable
> +skip_defaults_vim in your |.vimrc| like this >
> +:let g:skip_defaults_vim = 1
> +<
> +Note: This must be done in a script that is actually loaded before the 
> defaults.vim
> +file is read |initialization|
> +
>
>  Avoiding trojan horses ~
> *trojan-horse*
>
>
> Best,
> Christian

You seem not to be using the latest help (which surprizes me, coming
from you). In the  doc/starting.txt dated "Last change: 2016 Sep 03",
at the exact position of your addition there is a paragraph, maybe not
as detailed, but possibly more precise:


If you use a system-wide vimrc and don't want defaults.vim to change settings,
set the "skip_defaults_vim" variable.


(i.e. what counts is not its value but its mere existence).


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: some improvements for feedkeys()

2016-09-09 Fir de Conversatie 'Andy Wokula' via vim_dev

Am 09.09.2016 um 09:22 schrieb Christian Brabandt:

Hi 'Andy!

On Do, 08 Sep 2016, 'Andy Wokula' via vim_dev wrote:


Am 06.09.2016 um 20:42 schrieb Christian Brabandt:

Bram,
if in a test we do this:
 call feedkeys('d1', 'x!')
 call feedkeys('2l', 'x')

Vim will stay in the first feedkeys() call and wait for input.

I'd like to have feedkeys() return after CursorHold triggered,


You say Vim waits for input ... how does it trigger CursorHold then?


CusorHold is only triggered, if Vim is waiting for input. The problem
however in the tests is, that the keyboard buffer is never empty, so we
can't really test the CursorHold autocommand.


Why do you want to "test" CursorHold in a situation where it is not supposed
to be triggered?

--
Andy

--
--
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: [vim/vim] gvim exits with "BadWindow (invalid window parameter)" when highlighting large regions (#1023)

2016-09-09 Fir de Conversatie John Little
On Thursday, September 8, 2016 at 7:54:00 PM UTC+12, nuko8 wrote:

> Accordingly, I'd like to suggest that the issue be viewed more in terms of 
> interaction between KDE and GTK+ 2 as well as usage of the KDE desktop 
> environment.

I agree with your conclusion, but it is a severe gvim failure.  For me, any 
text file large enough, about 5000 lines, causes gvim to exit if one tries to 
ggVG. In the vim source directory, eval.c is not big enough, but cat e*.c > x.c 
makes a file big enough.

Regards, John Little

-- 
-- 
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.


update to the documentation

2016-09-09 Fir de Conversatie Christian Brabandt
Bram,
here is a small update to the documentation that mentions how to skip 
loading the defaults.vim file

diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt
index 14a5f01..2142343 100644
--- a/runtime/doc/starting.txt
+++ b/runtime/doc/starting.txt
@@ -1030,6 +1030,14 @@ If you don't like some of the defaults, you can still 
source defaults.vim and
 revert individual settings.  See the defaults.vim file for hints on how to
 revert each item.

+   *skip_defaults_vim*
+If you want to skip loading the defaults.vim file, you can set the variable
+skip_defaults_vim in your |.vimrc| like this >
+:let g:skip_defaults_vim = 1
+<
+Note: This must be done in a script that is actually loaded before the 
defaults.vim
+file is read |initialization|
+

 Avoiding trojan horses ~
*trojan-horse*


Best,
Christian
-- 
In mir schlummert ein Genie, nur das Biest wird nicht wach.

-- 
-- 
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: some improvements for feedkeys()

2016-09-09 Fir de Conversatie Christian Brabandt
Hi 'Andy!

On Do, 08 Sep 2016, 'Andy Wokula' via vim_dev wrote:

> Am 06.09.2016 um 20:42 schrieb Christian Brabandt:
> >Bram,
> >if in a test we do this:
> > call feedkeys('d1', 'x!')
> > call feedkeys('2l', 'x')
> >
> >Vim will stay in the first feedkeys() call and wait for input.
> >
> >I'd like to have feedkeys() return after CursorHold triggered,
> 
> You say Vim waits for input ... how does it trigger CursorHold then?

CusorHold is only triggered, if Vim is waiting for input. The problem 
however in the tests is, that the keyboard buffer is never empty, so we 
can't really test the CursorHold autocommand. Therefor Bram added the 
'!' flat to the feedkeys() function. This will consume the complete 
buffer and keep Vim in a state where it will wait for further input.

Look into src/testdir/test_autocmd.vim in the Vim source repository. It 
works around that by executing a timer command, that adds an  to 
the typebuf and so the test can continue.

> >Does that sound possible or should we not worry about those special case
> >(see normal.c:602)

I currently have this test skipped. I haven't posted the changes to 
test_normal.vim yes, as I am slowly going through 
https://coveralls.io/builds/7763791/source?filename=src%2Fnormal.c and 
add tests where I think we could need more.

Best,
Christian
-- 
Der beliebteste Fehler unter den Leuten, die etwas absolut
idiotensicheres konstruieren wollen ist der, daß sie den
Erfindungsreichtum von absoluten Idioten unterschätzen.
-- Douglas Adams

-- 
-- 
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.