Patch 7.4.828

2015-08-25 Thread Bram Moolenaar

Patch 7.4.828
Problem:Crash when using "syn keyword x c". (Dominique Pelle)
Solution:   Initialize the keyword tabble. (Raymond Ko, PR 397)
Files:  src/syntax.c


*** ../vim-7.4.827/src/syntax.c 2015-08-13 22:53:20.188768573 +0200
--- src/syntax.c2015-08-25 11:53:24.461171966 +0200
***
*** 6314,6319 
--- 6314,6321 
  {
curwin->w_s = (synblock_T *)alloc(sizeof(synblock_T));
memset(curwin->w_s, 0, sizeof(synblock_T));
+   hash_init(&curwin->w_s->b_keywtab);
+   hash_init(&curwin->w_s->b_keywtab_ic);
  #ifdef FEAT_SPELL
/* TODO: keep the spell checking as it was. */
curwin->w_p_spell = FALSE;  /* No spell checking */
*** ../vim-7.4.827/src/version.c2015-08-18 13:48:49.831988811 +0200
--- src/version.c   2015-08-25 11:52:20.817823019 +0200
***
*** 743,744 
--- 743,746 
  {   /* Add new patch number below this line */
+ /**/
+ 828,
  /**/

-- 
BRIDGEKEEPER: What is the air-speed velocity of an unladen swallow?
ARTHUR:   What do you mean?  An African or European swallow?
BRIDGEKEEPER: Er ...  I don't know that ... Arrggghhh!
   BRIDGEKEEPER is cast into the gorge.
 "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.
For more options, visit https://groups.google.com/d/optout.


Patch 7.4.829

2015-08-25 Thread Bram Moolenaar

Patch 7.4.829
Problem:Crash when clicking in beval balloon. (Travis Lebsock)
Solution:   Use PostMessage() instead of DestroyWindow(). (Raymond Ko, PR 298)
Files:  src/gui_w32.c


*** ../vim-7.4.828/src/gui_w32.c2015-08-11 19:13:55.138175689 +0200
--- src/gui_w32.c   2015-08-25 12:20:08.668726500 +0200
***
*** 4836,4842 
  delete_tooltip(beval)
  BalloonEval   *beval;
  {
! DestroyWindow(beval->balloon);
  }
  
  /*ARGSUSED*/
--- 4836,4843 
  delete_tooltip(beval)
  BalloonEval   *beval;
  {
! PostMessage(beval->balloon, WM_DESTROY, 0, 0);
! PostMessage(beval->balloon, WM_NCDESTROY, 0, 0);
  }
  
  /*ARGSUSED*/
*** ../vim-7.4.828/src/version.c2015-08-25 11:57:45.026505650 +0200
--- src/version.c   2015-08-25 12:18:39.021646821 +0200
***
*** 743,744 
--- 743,746 
  {   /* Add new patch number below this line */
+ /**/
+ 829,
  /**/

-- 
BEDEVERE: How do you know so much about swallows?
ARTHUR:   Well you have to know these things when you're a king, you know.
 "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.
For more options, visit https://groups.google.com/d/optout.


Patch 7.4.830

2015-08-25 Thread Bram Moolenaar

Patch 7.4.830
Problem:Resetting 'encoding' when doing ":set all&" causes problems.
(Bjorn Linse) Display is not updated.
Solution:   Do not reset 'encoding'. Do a full redraw.
Files:  src/option.c


*** ../vim-7.4.829/src/option.c 2015-08-11 18:52:58.073121563 +0200
--- src/option.c2015-08-25 12:52:02.764997919 +0200
***
*** 3656,3661 
--- 3656,3662 
  
  /*
   * Set all options (except terminal options) to their default value.
+  * When "opt_flags" is non-zero skip 'encoding'.
   */
  static void
  set_options_default(opt_flags)
***
*** 3668,3674 
  #endif
  
  for (i = 0; !istermoption(&options[i]); i++)
!   if (!(options[i].flags & P_NODEFAULT))
set_option_default(i, opt_flags, p_cp);
  
  #ifdef FEAT_WINDOWS
--- 3669,3676 
  #endif
  
  for (i = 0; !istermoption(&options[i]); i++)
!   if (!(options[i].flags & P_NODEFAULT)
!   && (opt_flags == 0 || options[i].var != (char_u *)&p_enc))
set_option_default(i, opt_flags, p_cp);
  
  #ifdef FEAT_WINDOWS
***
*** 4204,4209 
--- 4206,4212 
++arg;
/* Only for :set command set global value of local options. */
set_options_default(OPT_FREE | opt_flags);
+   redraw_all_later(CLEAR);
}
else
{
*** ../vim-7.4.829/src/version.c2015-08-25 12:21:23.583957205 +0200
--- src/version.c   2015-08-25 12:50:16.870092540 +0200
***
*** 743,744 
--- 743,746 
  {   /* Add new patch number below this line */
+ /**/
+ 830,
  /**/

-- 
Every exit is an entrance into something else.

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

2015-08-25 Thread Bram Moolenaar

Patch 7.4.831
Problem:When expanding `=expr` on the command line and encountering an
error, the command is executed anyway.
Solution:   Bail out when an error is detected.
Files:  src/misc1.c


*** ../vim-7.4.830/src/misc1.c  2015-07-28 21:17:31.522069387 +0200
--- src/misc1.c 2015-08-25 13:32:09.704105987 +0200
***
*** 10875,10880 
--- 10875,10881 
  char_u*p;
  static intrecursive = FALSE;
  int   add_pat;
+ int   retval = OK;
  #if defined(FEAT_SEARCHPATH)
  int   did_expand_in_path = FALSE;
  #endif
***
*** 10924,10930 
--- 10925,10935 
  
  #ifdef VIM_BACKTICK
if (vim_backtick(p))
+   {
add_pat = expand_backtick(&ga, p, flags);
+   if (add_pat == -1)
+   retval = FAIL;
+   }
else
  #endif
{
***
*** 11013,11019 
  
  recursive = FALSE;
  
! return (ga.ga_data != NULL) ? OK : FAIL;
  }
  
  # ifdef VIM_BACKTICK
--- 11018,11024 
  
  recursive = FALSE;
  
! return (ga.ga_data != NULL) ? retval : FAIL;
  }
  
  # ifdef VIM_BACKTICK
***
*** 11031,11037 
  /*
   * Expand an item in `backticks` by executing it as a command.
   * Currently only works when pat[] starts and ends with a `.
!  * Returns number of file names found.
   */
  static int
  expand_backtick(gap, pat, flags)
--- 11036,11042 
  /*
   * Expand an item in `backticks` by executing it as a command.
   * Currently only works when pat[] starts and ends with a `.
!  * Returns number of file names found, -1 if an error is encountered.
   */
  static int
  expand_backtick(gap, pat, flags)
***
*** 11048,11054 
  /* Create the command: lop off the backticks. */
  cmd = vim_strnsave(pat + 1, (int)STRLEN(pat) - 2);
  if (cmd == NULL)
!   return 0;
  
  #ifdef FEAT_EVAL
  if (*cmd == '=')  /* `={expr}`: Expand expression */
--- 11053,11059 
  /* Create the command: lop off the backticks. */
  cmd = vim_strnsave(pat + 1, (int)STRLEN(pat) - 2);
  if (cmd == NULL)
!   return -1;
  
  #ifdef FEAT_EVAL
  if (*cmd == '=')  /* `={expr}`: Expand expression */
***
*** 11059,11065 
(flags & EW_SILENT) ? SHELL_SILENT : 0, NULL);
  vim_free(cmd);
  if (buffer == NULL)
!   return 0;
  
  cmd = buffer;
  while (*cmd != NUL)
--- 11064,11070 
(flags & EW_SILENT) ? SHELL_SILENT : 0, NULL);
  vim_free(cmd);
  if (buffer == NULL)
!   return -1;
  
  cmd = buffer;
  while (*cmd != NUL)
*** ../vim-7.4.830/src/version.c2015-08-25 12:56:22.622312124 +0200
--- src/version.c   2015-08-25 13:55:45.693438779 +0200
***
*** 743,744 
--- 743,746 
  {   /* Add new patch number below this line */
+ /**/
+ 831,
  /**/

-- 
Every person is responsible for the choices he makes.

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


vim_dev@googlegroups.com

2015-08-25 Thread Björn Linse
On Sunday, August 23, 2015 at 10:08:41 PM UTC+2, Björn Linse wrote:
> On Saturday, August 22, 2015 at 4:04:57 PM UTC+2, Bram Moolenaar wrote:
> > ...
> 
> Similar issue with laststatus. `:set ls=2` and then `set all&` now `set ls` 
> gives 1 but vim still behaves as if `&ls=2`. Also, I think a redraw is 
> missing (for nohlsearch, for instance)

In fact, I would suspect a general pattern of options relying on sideeffects in 
did_set_string_option and friends, for instance
set clipboard=unnamed
set all&
set cb?
would show the default cb=autoselect,exclude..., but vim behaves still as if 
cb=unnamed
  

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


vim_dev@googlegroups.com

2015-08-25 Thread Bram Moolenaar

Björn Linse wrote:

> On Sunday, August 23, 2015 at 10:08:41 PM UTC+2, Björn Linse wrote:
> > On Saturday, August 22, 2015 at 4:04:57 PM UTC+2, Bram Moolenaar wrote:
> > > ...
> > 
> > Similar issue with laststatus. `:set ls=2` and then `set all&` now `set ls` 
> > gives 1 but vim still behaves as if `&ls=2`. Also, I think a redraw is 
> > missing (for nohlsearch, for instance)
> 
> In fact, I would suspect a general pattern of options relying on
> sideeffects in did_set_string_option and friends, for instance
> set clipboard=unnamed
> set all&
> set cb?
> would show the default cb=autoselect,exclude..., but vim behaves still
> as if cb=unnamed

Yes, there is still more work to do on this.  Probably requires a
completely different approach.

-- 
There is no right or wrong, there is only your personal opinion.
 (Bram Moolenaar)

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

2015-08-25 Thread Bram Moolenaar

Patch 7.4.832
Problem:$HOME in `=$HOME . '/.vimrc'` is expanded too early.
Solution:   Skip over `=expr` when expanding environment names.
Files:  src/misc1.c


*** ../vim-7.4.831/src/misc1.c  2015-08-25 13:57:00.188667536 +0200
--- src/misc1.c 2015-08-25 14:12:46.678814290 +0200
***
*** 3969,3974 
--- 3969,3994 
  --dstlen; /* leave one char space for "\," */
  while (*src && dstlen > 0)
  {
+ #ifdef FEAT_EVAL
+   /* Skip over `=expr`. */
+   if (src[0] == '`' && src[1] == '=')
+   {
+   size_t len;
+ 
+   var = src;
+   src += 2;
+   (void)skip_expr(&src);
+   if (*src == '`')
+   ++src;
+   len = src - var;
+   if (len > (size_t)dstlen)
+   len = dstlen;
+   vim_strncpy(dst, var, len);
+   dst += len;
+   dstlen -= len;
+   continue;
+   }
+ #endif
copy_char = TRUE;
if ((*src == '$'
  #ifdef VMS
*** ../vim-7.4.831/src/version.c2015-08-25 13:57:00.188667536 +0200
--- src/version.c   2015-08-25 14:14:36.573656094 +0200
***
*** 743,744 
--- 743,746 
  {   /* Add new patch number below this line */
+ /**/
+ 832,
  /**/

-- 
It is illegal for anyone to try and stop a child from playfully jumping over
puddles of water.
[real standing law in California, United States of America]

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

2015-08-25 Thread Bram Moolenaar

Patch 7.4.833
Problem:More side effects of ":set all&" are missing. (Björn Linse)
Solution:   Call didset_options() and add didset_options2() to collect more
side effects to take care of.  Still not everything...
Files:  src/option.c


*** ../vim-7.4.832/src/option.c 2015-08-25 12:56:22.618312165 +0200
--- src/option.c2015-08-25 15:29:31.402326593 +0200
***
*** 3079,3084 
--- 3079,3085 
  #endif
  static char_u *option_expand __ARGS((int opt_idx, char_u *val));
  static void didset_options __ARGS((void));
+ static void didset_options2 __ARGS((void));
  static void check_string_option __ARGS((char_u **pp));
  #if defined(FEAT_EVAL) || defined(PROTO)
  static long_u *insecure_flag __ARGS((int opt_idx, int opt_flags));
***
*** 3096,3101 
--- 3097,3103 
  static char_u *check_clipboard_option __ARGS((void));
  #endif
  #ifdef FEAT_SPELL
+ static char_u *did_set_spell_option __ARGS((int is_spellfile));
  static char_u *compile_cap_prog __ARGS((synblock_T *synblock));
  #endif
  #ifdef FEAT_EVAL
***
*** 3376,3392 
  didset_options();
  
  #ifdef FEAT_SPELL
! /* Use the current chartab for the generic chartab. */
  init_spell_chartab();
  #endif
  
- #ifdef FEAT_LINEBREAK
- /*
-  * initialize the table for 'breakat'.
-  */
- fill_breakat_flags();
- #endif
- 
  /*
   * Expand environment variables and things like "~" for the defaults.
   * If option_expand() returns non-NULL the variable is expanded.  This can
--- 3378,3388 
  didset_options();
  
  #ifdef FEAT_SPELL
! /* Use the current chartab for the generic chartab. This is not in
!  * didset_options() because it only depends on 'encoding'. */
  init_spell_chartab();
  #endif
  
  /*
   * Expand environment variables and things like "~" for the defaults.
   * If option_expand() returns non-NULL the variable is expanded.  This can
***
*** 3418,3431 
}
  }
  
- /* Initialize the highlight_attr[] table. */
- highlight_changed();
- 
  save_file_ff(curbuf); /* Buffer is unchanged */
  
- /* Parse default for 'wildmode'  */
- check_opt_wim();
- 
  #if defined(FEAT_ARABIC)
  /* Detect use of mlterm.
   * Mlterm is a terminal emulator akin to xterm that has some special
--- 3414,3421 
***
*** 3437,3451 
set_option_value((char_u *)"tbidi", 1L, NULL, 0);
  #endif
  
! #if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
! /* Parse default for 'fillchars'. */
! (void)set_chars_option(&p_fcs);
! #endif
! 
! #ifdef FEAT_CLIPBOARD
! /* Parse default for 'clipboard' */
! (void)check_clipboard_option();
! #endif
  
  #ifdef FEAT_MBYTE
  # if defined(WIN3264) && defined(FEAT_GETTEXT)
--- 3427,3433 
set_option_value((char_u *)"tbidi", 1L, NULL, 0);
  #endif
  
! didset_options2();
  
  #ifdef FEAT_MBYTE
  # if defined(WIN3264) && defined(FEAT_GETTEXT)
***
*** 3670,3676 
  
  for (i = 0; !istermoption(&options[i]); i++)
if (!(options[i].flags & P_NODEFAULT)
!   && (opt_flags == 0 || options[i].var != (char_u *)&p_enc))
set_option_default(i, opt_flags, p_cp);
  
  #ifdef FEAT_WINDOWS
--- 3652,3661 
  
  for (i = 0; !istermoption(&options[i]); i++)
if (!(options[i].flags & P_NODEFAULT)
!   && (opt_flags == 0
!   || (options[i].var != (char_u *)&p_enc
!   && options[i].var != (char_u *)&p_cm
!   && options[i].var != (char_u *)&p_key)))
set_option_default(i, opt_flags, p_cp);
  
  #ifdef FEAT_WINDOWS
***
*** 4206,4211 
--- 4191,4198 
++arg;
/* Only for :set command set global value of local options. */
set_options_default(OPT_FREE | opt_flags);
+   didset_options();
+   didset_options2();
redraw_all_later(CLEAR);
}
else
***
*** 5348,5353 
--- 5335,5341 
  (void)spell_check_msm();
  (void)spell_check_sps();
  (void)compile_cap_prog(curwin->w_s);
+ (void)did_set_spell_option(TRUE);
  #endif
  #if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_W32)
  (void)opt_strings_flags(p_toolbar, p_toolbar_values, &toolbar_flags, 
TRUE);
***
*** 5362,5367 
--- 5350,5384 
  #ifdef FEAT_LINEBREAK
  briopt_check(curwin);
  #endif
+ #ifdef FEAT_LINEBREAK
+ /* initialize the table for 'breakat'. */
+ fill_breakat_flags();
+ #endif
+ 
+ }
+ 
+ /*
+  * More side effects of setting options.
+  */
+ static void
+ didset_options2()
+ {
+ /* Initialize the highlight_attr[] table. */
+ (void)highlight_changed();
+ 
+ /* Parse default for 'wildmode'  */
+ check_opt_wim();
+ 
+ (void)set_chars_option(&p_lcs);
+ #if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
+ /* Parse 

Patch 7.4.834

2015-08-25 Thread Bram Moolenaar

Patch 7.4.834
Problem:gettabvar() doesn't work after Vim start. (Szymon Wrozynski)
Solution:   Handle first window in tab still being NULL. (Christian Brabandt)
Files:  src/eval.c, src/testdir/test91.in, src/testdir/test91.ok


*** ../vim-7.4.833/src/eval.c   2015-08-13 23:28:38.242878357 +0200
--- src/eval.c  2015-08-25 16:14:37.962043098 +0200
***
*** 12291,12297 
  {
/* Set tp to be our tabpage, temporarily.  Also set the window to the
 * first window in the tabpage, otherwise the window is not valid. */
!   if (switch_win(&oldcurwin, &oldtabpage, tp->tp_firstwin, tp, TRUE)
== OK)
{
/* look up the variable */
--- 12291,12298 
  {
/* Set tp to be our tabpage, temporarily.  Also set the window to the
 * first window in the tabpage, otherwise the window is not valid. */
!   if (switch_win(&oldcurwin, &oldtabpage,
!   tp->tp_firstwin == NULL ? firstwin : tp->tp_firstwin, tp, 
TRUE)
== OK)
{
/* look up the variable */
*** ../vim-7.4.833/src/testdir/test91.in2014-09-09 16:13:05.040531695 
+0200
--- src/testdir/test91.in   2015-08-25 16:14:21.978209619 +0200
***
*** 5,12 
  :so small.vim
  :so mbyte.vim
  :"
- :" Test for getbufvar()
  :" Use strings to test for memory leaks.
  :let b:var_num = '1234'
  :let def_num = '5678'
  :$put =string(getbufvar(1, 'var_num'))
--- 5,16 
  :so small.vim
  :so mbyte.vim
  :"
  :" Use strings to test for memory leaks.
+ :" First, check that in an empty window, gettabvar() returns the correct value
+ :let t:testvar='abcd'
+ :$put =string(gettabvar(1,'testvar'))
+ :$put =string(gettabvar(1,'testvar'))
+ :" Test for getbufvar()
  :let b:var_num = '1234'
  :let def_num = '5678'
  :$put =string(getbufvar(1, 'var_num'))
*** ../vim-7.4.833/src/testdir/test91.ok2014-09-09 16:13:05.040531695 
+0200
--- src/testdir/test91.ok   2015-08-25 16:14:21.978209619 +0200
***
*** 1,4 
--- 1,6 
  start:
+ 'abcd'
+ 'abcd'
  '1234'
  '1234'
  {'var_num': '1234'}
*** ../vim-7.4.833/src/version.c2015-08-25 15:39:51.459826645 +0200
--- src/version.c   2015-08-25 16:14:09.318341510 +0200
***
*** 743,744 
--- 743,746 
  {   /* Add new patch number below this line */
+ /**/
+ 834,
  /**/

-- 
A special law prohibits unmarried women from parachuting on Sunday or she
shall risk arrest, fine, and/or jailing.
[real standing law in Florida, United States of America]

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

2015-08-25 Thread Bram Moolenaar

Patch 7.4.835
Problem:Comparing utf-8 sequences does not handle different byte sizes
correctly.
Solution:   Get the byte size of each character. (Dominique Pelle)
Files:  src/misc2.c


*** ../vim-7.4.834/src/misc2.c  2015-07-17 13:22:43.153523709 +0200
--- src/misc2.c 2015-08-25 16:27:31.565982817 +0200
***
*** 5058,5064 
  char_u*s1;
  char_u*s2;
  {
! int   i;
  int   prev1 = NUL;
  int   prev2 = NUL;
  
--- 5058,5064 
  char_u*s1;
  char_u*s2;
  {
! int   i, j;
  int   prev1 = NUL;
  int   prev2 = NUL;
  
***
*** 5068,5086 
  if (s1 == NULL || s2 == NULL)
return FALSE;
  
! if (STRLEN(s1) != STRLEN(s2))
!   return FAIL;
! 
! for (i = 0; s1[i] != NUL && s2[i] != NUL; i += MB_PTR2LEN(s1 + i))
  {
int c1 = PTR2CHAR(s1 + i);
!   int c2 = PTR2CHAR(s2 + i);
  
if ((p_fic ? MB_TOLOWER(c1) != MB_TOLOWER(c2) : c1 != c2)
&& (prev1 != '*' || prev2 != '*'))
return FAIL;
prev2 = prev1;
prev1 = c1;
  }
  return TRUE;
  }
--- 5068,5086 
  if (s1 == NULL || s2 == NULL)
return FALSE;
  
! for (i = 0, j = 0; s1[i] != NUL;)
  {
int c1 = PTR2CHAR(s1 + i);
!   int c2 = PTR2CHAR(s2 + j);
  
if ((p_fic ? MB_TOLOWER(c1) != MB_TOLOWER(c2) : c1 != c2)
&& (prev1 != '*' || prev2 != '*'))
return FAIL;
prev2 = prev1;
prev1 = c1;
+ 
+ i += MB_PTR2LEN(s1 + i);
+ j += MB_PTR2LEN(s2 + j);
  }
  return TRUE;
  }
***
*** 5814,5827 
  const char *p, *q;
  int maxlen;
  {
! int   i;
  int   c1, c2;
  const char*s = NULL;
  
! for (i = 0; maxlen < 0 || i < maxlen; i += MB_PTR2LEN((char_u *)p + i))
  {
c1 = PTR2CHAR((char_u *)p + i);
!   c2 = PTR2CHAR((char_u *)q + i);
  
/* End of "p": check if "q" also ends or just has a slash. */
if (c1 == NUL)
--- 5814,5827 
  const char *p, *q;
  int maxlen;
  {
! int   i, j;
  int   c1, c2;
  const char*s = NULL;
  
! for (i = 0, j = 0; maxlen < 0 || (i < maxlen && j < maxlen);)
  {
c1 = PTR2CHAR((char_u *)p + i);
!   c2 = PTR2CHAR((char_u *)q + j);
  
/* End of "p": check if "q" also ends or just has a slash. */
if (c1 == NUL)
***
*** 5829,5834 
--- 5829,5835 
if (c2 == NUL)  /* full match */
return 0;
s = q;
+ i = j;
break;
}
  
***
*** 5854,5861 
return p_fic ? MB_TOUPPER(c1) - MB_TOUPPER(c2)
: c1 - c2;  /* no match */
}
  }
! if (s == NULL)/* "i" ran into "maxlen" */
return 0;
  
  c1 = PTR2CHAR((char_u *)s + i);
--- 5855,5865 
return p_fic ? MB_TOUPPER(c1) - MB_TOUPPER(c2)
: c1 - c2;  /* no match */
}
+ 
+   i += MB_PTR2LEN((char_u *)p + i);
+   j += MB_PTR2LEN((char_u *)q + j);
  }
! if (s == NULL)/* "i" or "j" ran into "maxlen" */
return 0;
  
  c1 = PTR2CHAR((char_u *)s + i);
*** ../vim-7.4.834/src/version.c2015-08-25 16:19:01.587296525 +0200
--- src/version.c   2015-08-25 16:22:58.444828674 +0200
***
*** 743,744 
--- 743,746 
  {   /* Add new patch number below this line */
+ /**/
+ 835,
  /**/

-- 
If an elephant is left tied to a parking meter, the parking fee has to be paid
just as it would for a vehicle.
[real standing law in Florida, United States of America]

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

2015-08-25 Thread Bram Moolenaar

Patch 7.4.836
Problem:Accessing unitinialized memory.
Solution:   Add missing calls to init_tv(). (Dominique Pelle)
Files:  src/eval.c


*** ../vim-7.4.835/src/eval.c   2015-08-25 16:19:01.583296566 +0200
--- src/eval.c  2015-08-25 16:47:06.109777570 +0200
***
*** 5371,5376 
--- 5371,5378 
  }
  #endif
  
+ init_tv(&var1);
+ init_tv(&var2);
  if (**arg == '.')
  {
/*
*** ../vim-7.4.835/src/version.c2015-08-25 16:31:34.631453176 +0200
--- src/version.c   2015-08-25 16:46:21.294243211 +0200
***
*** 743,744 
--- 743,746 
  {   /* Add new patch number below this line */
+ /**/
+ 836,
  /**/

-- 
Men may not be seen publicly in any kind of strapless gown.
[real standing law in Florida, United States of America]

 /// 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: Repository cleanup (Was: Preparations for moving to github)

2015-08-25 Thread Christian Brabandt
On Do, 20 Aug 2015, Bram Moolenaar wrote:

> I have done the "for real" update of the Vim repository.
> I used the same sequence of commands as for the tryout, thus the result
> should be the same.

Did the .gitignore file change between the old googlecode repository and 
the new github repository? I get a modification here:

diff --git a/.gitignore b/.gitignore
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,3 @@
-# This is .gitignore
-
 # Unixen: object and executable files.
 *.o
 src/vim

I can commit it in the mirror or you can fix it in the original ;)

Best,
Christian
-- 
Das ganze Leben besteht aus
  Wollen und Nichtvollbringen,
  Vollbringen und Nichtwollen.
-- Goethe, Maximen und Reflektionen, Nr. 694

-- 
-- 
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] Compiler warning for MSVC compilers with +sniff

2015-08-25 Thread tux.
Seems to work.

-- 
-- 
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.diff
Description: Binary data


Re: Mail from Vim Github Repository

2015-08-25 Thread tux.
BTW: Having my local hg repository set to Bitbucket and typing "hg
pull" does *not* pull the newest tags, it's still at 7.4.826 for me :/

-- 
-- 
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: Mail from Vim Github Repository

2015-08-25 Thread Gary Johnson
On 2015-08-25, tux. wrote:
> BTW: Having my local hg repository set to Bitbucket and typing "hg
> pull" does *not* pull the newest tags, it's still at 7.4.826 for me :/

I just did that (2015-08-25 17:03Z) and retrieved through 7.4.836.

vim/.hg/hgrc:
default = https://bitbucket.org/vim-mirror/vim

Regards,
Gary

-- 
-- 
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: Mail from Vim Github Repository

2015-08-25 Thread Christian Brabandt
On Di, 25 Aug 2015, tux. wrote:

> BTW: Having my local hg repository set to Bitbucket and typing "hg
> pull" does *not* pull the newest tags, it's still at 7.4.826 for me :/

There was a small problem, that prevented the mirror to pull the latest 
patches, but I fixed that one or two hours ago.

Best,
Christian
-- 
Eine gute Rede ist eine Ansprache, die das Thema erschöpft, aber keineswegs
die Zuhörer.
-- Winston Spencer Churchill

-- 
-- 
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: Repository cleanup (Was: Preparations for moving to github)

2015-08-25 Thread Christian Brabandt
On Di, 25 Aug 2015, Christian Brabandt wrote:

> On Do, 20 Aug 2015, Bram Moolenaar wrote:
> 
> > I have done the "for real" update of the Vim repository.
> > I used the same sequence of commands as for the tryout, thus the result
> > should be the same.
> 
> Did the .gitignore file change between the old googlecode repository and 
> the new github repository? I get a modification here:
> 
> diff --git a/.gitignore b/.gitignore
[...]

I just commit the change. No need to change anything in the official 
repo.

Best,
Christian
-- 
Wie man sein Kind nicht nennen sollte: 
  Dick Tator   

-- 
-- 
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: Mail from Vim Github Repository

2015-08-25 Thread tux.
Yes, the newest patch is tagged on Bitbucket, but I don't get it :/

-- 
-- 
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: Mail from Vim Github Repository

2015-08-25 Thread Christian Brabandt
On Di, 25 Aug 2015, tux. wrote:

> Yes, the newest patch is tagged on Bitbucket, but I don't get it :/

Did you run hg pull -u?

BTW: What is this?
To: Christian Brabandt 

Best,
Christian
-- 
Der Religion ist nur das Heilige wahr,
der Philosophie nur das Wahre heilig.
-- Ludwig Feuerbach

-- 
-- 
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: Mail from Vim Github Repository

2015-08-25 Thread tux.
Christian Brabandt schrob am Dienstag, 25. August 2015 um 19:26 Zeit:

> Did you run hg pull -u?

Yes, but it did not change a thing. -- However, I (seem to) have found
my mistake: I had local changes, mostly leftovers from the "old"
repository. Thanks, I seem to have the right versions now.

> BTW: What is this?
> To: Christian Brabandt 

My mail client's default setting. :-)

Regards.

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

2015-08-25 Thread Bram Moolenaar

Patch 7.4.837
Problem:Compiler warning with MSVC compiler when using +sniff.
Solution:   Use Sleep() instead of _sleep(). (Tux)
Files:  src/if_sniff.c


*** ../vim-7.4.836/src/if_sniff.c   2012-06-20 19:56:09.0 +0200
--- src/if_sniff.c  2015-08-25 19:49:03.289172373 +0200
***
*** 655,661 
--- 655,665 
  else
  {
  #ifdef WIN32
+ # if (defined(_MSC_VER) && _MSC_VER >= 1400)
+ Sleep(2);
+ # else
_sleep(2);
+ # endif
if (!sniff_request_processed)
ProcessSniffRequests();
  #else
*** ../vim-7.4.836/src/version.c2015-08-25 16:48:56.072640146 +0200
--- src/version.c   2015-08-25 19:48:21.269605069 +0200
***
*** 743,744 
--- 743,746 
  {   /* Add new patch number below this line */
+ /**/
+ 837,
  /**/

-- 
It is illegal for anyone to give lighted cigars to dogs, cats, and other
domesticated animal kept as pets.
[real standing law in Illinois, United States of America]

 /// 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: [patch] Compiler warning for MSVC compilers with +sniff

2015-08-25 Thread Bram Moolenaar

Tux wrote:

> Seems to work.

Thanks.


-- 
Any sufficiently advanced technology is indistinguishable from magic.
Arthur C. Clarke
Any sufficiently advanced bug is indistinguishable from a feature.
Rich Kulawiec

 /// 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: Repository cleanup (Was: Preparations for moving to github)

2015-08-25 Thread Markus Heidelberg
Am Dienstag, 25. August 2015, 17:42:26 schrieb Christian Brabandt:
> 
> Did the .gitignore file change between the old googlecode repository and 
> the new github repository? I get a modification here:
> 
> diff --git a/.gitignore b/.gitignore
> --- a/.gitignore
> +++ b/.gitignore
> @@ -1,5 +1,3 @@
> -# This is .gitignore
> -
>  # Unixen: object and executable files.
>  *.o
>  src/vim

While rewriting history during Git repo cleanup I took the opportunity
to replace the .hgignore with .gitignore, so that even if you go back in
time you benefit from the ignore list.

I removed the HG specific "syntax: glob" and subsequent blank line
without adding this comment, which originates from the .gitignore in the
HG repo.

> I can commit it in the mirror or you can fix it in the original ;)

This wouldn't be a fix :)

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Patch 7.4.833

2015-08-25 Thread John Marriott



On 25-Aug-2015 11:40 PM, Bram Moolenaar wrote:
>
> Patch 7.4.833
> Problem:More side effects of ":set all&" are missing. (Björn Linse)
> Solution:   Call didset_options() and add didset_options2() to 
collect more

> side effects to take care of.  Still not everything...
> Files:  src/option.c
>
>
This patch fails to compile on Win64 (both gui and not) with FEAT_CRYPT 
undefined, like so:
gcc -c -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 
-DHAVE_PATHDEF -DFEAT_BIG -DFEAT_GUI_W32 -DFEAT_CLIPBOARD -
DFEAT_MBYTE -pipe -w -march=native -Wall -O3 -fomit-frame-pointer 
-freg-struct-return -s gui_w32.c -o gobjnative/gui_w32

.o
option.c: In function 'set_options_default':
option.c:3657:36: error: 'p_cm' undeclared (first use in this function)
&& options[i].var != (char_u *)&p_cm
^
option.c:3657:36: note: each undeclared identifier is reported only once 
for each function it appears in

option.c:3658:36: error: 'p_key' undeclared (first use in this function)
&& options[i].var != (char_u *)&p_key)))
^
Make_cyg_ming.mak:781: recipe for target 'gobjnative/option.o' failed
make: *** [gobjnative/option.o] Error 1
make: *** Waiting for unfinished jobs

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups "vim_dev" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Patch 7.4.835

2015-08-25 Thread Christ van Willegen
On Tue, Aug 25, 2015 at 4:31 PM, Bram Moolenaar  wrote:
> ***
> *** 5068,5086 
>   if (s1 == NULL || s2 == NULL)
> return FALSE;
>
> ! if (STRLEN(s1) != STRLEN(s2))
> !   return FAIL;
> !
> ! for (i = 0; s1[i] != NUL && s2[i] != NUL; i += MB_PTR2LEN(s1 + i))
>   {
> int c1 = PTR2CHAR(s1 + i);
> !   int c2 = PTR2CHAR(s2 + i);
>
> if ((p_fic ? MB_TOLOWER(c1) != MB_TOLOWER(c2) : c1 != c2)
> && (prev1 != '*' || prev2 != '*'))
> return FAIL;
> prev2 = prev1;
> prev1 = c1;
>   }
>   return TRUE;
>   }
> --- 5068,5086 
>   if (s1 == NULL || s2 == NULL)
> return FALSE;
>
> ! for (i = 0, j = 0; s1[i] != NUL;)
>   {
> int c1 = PTR2CHAR(s1 + i);
> !   int c2 = PTR2CHAR(s2 + j);
>
> if ((p_fic ? MB_TOLOWER(c1) != MB_TOLOWER(c2) : c1 != c2)
> && (prev1 != '*' || prev2 != '*'))
> return FAIL;
> prev2 = prev1;
> prev1 = c1;
> +
> + i += MB_PTR2LEN(s1 + i);
> + j += MB_PTR2LEN(s2 + j);
>   }
>   return TRUE;
>   }

Was the test for s2[j] != NUL left out intentionally, or does another
code path catch that one?

Christ van Willegen

-- 
-- 
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: Repository cleanup (Was: Preparations for moving to github)

2015-08-25 Thread Bram Moolenaar

Christian Brabandt wrote:

> On Do, 20 Aug 2015, Bram Moolenaar wrote:
> 
> > I have done the "for real" update of the Vim repository.
> > I used the same sequence of commands as for the tryout, thus the result
> > should be the same.
> 
> Did the .gitignore file change between the old googlecode repository and 
> the new github repository? I get a modification here:
> 
> diff --git a/.gitignore b/.gitignore
> --- a/.gitignore
> +++ b/.gitignore
> @@ -1,5 +1,3 @@
> -# This is .gitignore
> -
>  # Unixen: object and executable files.
>  *.o
>  src/vim
> 
> I can commit it in the mirror or you can fix it in the original ;)

That was changed by the git cleanup script that Markus created.

-- 
Citizens are not allowed to attend a movie house or theater nor ride in a
public streetcar within at least four hours after eating garlic.
[real standing law in Indiana, United States of America]

 /// 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: Patch 7.4.833

2015-08-25 Thread Bram Moolenaar

John Marriott wrote:

> On 25-Aug-2015 11:40 PM, Bram Moolenaar wrote:
>  >
>  > Patch 7.4.833
>  > Problem:More side effects of ":set all&" are missing. (Björn Linse)
>  > Solution:   Call didset_options() and add didset_options2() to collect more
>  > side effects to take care of.  Still not everything...
>  > Files:  src/option.c
>  >
>  >
> This patch fails to compile on Win64 (both gui and not) with FEAT_CRYPT 
> undefined, like so:
> gcc -c -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 
> -DHAVE_PATHDEF -DFEAT_BIG -DFEAT_GUI_W32 -DFEAT_CLIPBOARD -
> DFEAT_MBYTE -pipe -w -march=native -Wall -O3 -fomit-frame-pointer 
> -freg-struct-return -s gui_w32.c -o gobjnative/gui_w32
> .o
> option.c: In function 'set_options_default':
> option.c:3657:36: error: 'p_cm' undeclared (first use in this function)
>  && options[i].var != (char_u *)&p_cm
>  ^
> option.c:3657:36: note: each undeclared identifier is reported only once 
> for each function it appears in
> option.c:3658:36: error: 'p_key' undeclared (first use in this function)
>  && options[i].var != (char_u *)&p_key)))
>  ^
> Make_cyg_ming.mak:781: recipe for target 'gobjnative/option.o' failed
> make: *** [gobjnative/option.o] Error 1
> make: *** Waiting for unfinished jobs

Sorry, I'll add an #ifdef

-- 
Kisses may last for as much as, but no more than, five minutes.
[real standing law in Iowa, United States of America]

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

2015-08-25 Thread Bram Moolenaar

Patch 7.4.838 (after 7.4.833)
Problem:Can't compile without the crypt feature. (John Marriott)
Solution:   Add #ifdef.
Files:  src/option.c


*** ../vim-7.4.837/src/option.c 2015-08-25 15:39:51.459826645 +0200
--- src/option.c2015-08-25 21:25:19.909499949 +0200
***
*** 3654,3661 
if (!(options[i].flags & P_NODEFAULT)
&& (opt_flags == 0
|| (options[i].var != (char_u *)&p_enc
&& options[i].var != (char_u *)&p_cm
!   && options[i].var != (char_u *)&p_key)))
set_option_default(i, opt_flags, p_cp);
  
  #ifdef FEAT_WINDOWS
--- 3654,3664 
if (!(options[i].flags & P_NODEFAULT)
&& (opt_flags == 0
|| (options[i].var != (char_u *)&p_enc
+ #if defined(FEAT_CRYPT)
&& options[i].var != (char_u *)&p_cm
!   && options[i].var != (char_u *)&p_key
! #endif
!   )))
set_option_default(i, opt_flags, p_cp);
  
  #ifdef FEAT_WINDOWS
*** ../vim-7.4.837/src/version.c2015-08-25 19:49:46.724725068 +0200
--- src/version.c   2015-08-25 21:26:30.040783229 +0200
***
*** 743,744 
--- 743,746 
  {   /* Add new patch number below this line */
+ /**/
+ 838,
  /**/

-- 
It is illegal to rob a bank and then shoot at the bank teller with a water
pistol.
[real standing law in Louisana, United States of America]

 /// 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: Patch 7.4.835

2015-08-25 Thread Bram Moolenaar

Christ van Willegen wrote:

> On Tue, Aug 25, 2015 at 4:31 PM, Bram Moolenaar  wrote:
> > ***
> > *** 5068,5086 
> >   if (s1 == NULL || s2 == NULL)
> > return FALSE;
> >
> > ! if (STRLEN(s1) != STRLEN(s2))
> > !   return FAIL;
> > !
> > ! for (i = 0; s1[i] != NUL && s2[i] != NUL; i += MB_PTR2LEN(s1 + i))
> >   {
> > int c1 = PTR2CHAR(s1 + i);
> > !   int c2 = PTR2CHAR(s2 + i);
> >
> > if ((p_fic ? MB_TOLOWER(c1) != MB_TOLOWER(c2) : c1 != c2)
> > && (prev1 != '*' || prev2 != '*'))
> > return FAIL;
> > prev2 = prev1;
> > prev1 = c1;
> >   }
> >   return TRUE;
> >   }
> > --- 5068,5086 
> >   if (s1 == NULL || s2 == NULL)
> > return FALSE;
> >
> > ! for (i = 0, j = 0; s1[i] != NUL;)
> >   {
> > int c1 = PTR2CHAR(s1 + i);
> > !   int c2 = PTR2CHAR(s2 + j);
> >
> > if ((p_fic ? MB_TOLOWER(c1) != MB_TOLOWER(c2) : c1 != c2)
> > && (prev1 != '*' || prev2 != '*'))
> > return FAIL;
> > prev2 = prev1;
> > prev1 = c1;
> > +
> > + i += MB_PTR2LEN(s1 + i);
> > + j += MB_PTR2LEN(s2 + j);
> >   }
> >   return TRUE;
> >   }
> 
> Was the test for s2[j] != NUL left out intentionally, or does another
> code path catch that one?

There is a test for s1[i] != NUL.  If s2[j] then is NUL the characters
differ, c1 and c2 differ, and it gets to "return FAIL".

-- 
Biting someone with your natural teeth is "simple assault," while biting
someone with your false teeth is "aggravated assault."
[real standing law in Louisana, United States of America]

 /// 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: Patch 7.4.835

2015-08-25 Thread Dominique Pellé
Christ van Willegen wrote:

> On Tue, Aug 25, 2015 at 4:31 PM, Bram Moolenaar  wrote:
>> ***
>> *** 5068,5086 
>>   if (s1 == NULL || s2 == NULL)
>> return FALSE;
>>
>> ! if (STRLEN(s1) != STRLEN(s2))
>> !   return FAIL;
>> !
>> ! for (i = 0; s1[i] != NUL && s2[i] != NUL; i += MB_PTR2LEN(s1 + i))
>>   {
>> int c1 = PTR2CHAR(s1 + i);
>> !   int c2 = PTR2CHAR(s2 + i);
>>
>> if ((p_fic ? MB_TOLOWER(c1) != MB_TOLOWER(c2) : c1 != c2)
>> && (prev1 != '*' || prev2 != '*'))
>> return FAIL;
>> prev2 = prev1;
>> prev1 = c1;
>>   }
>>   return TRUE;
>>   }
>> --- 5068,5086 
>>   if (s1 == NULL || s2 == NULL)
>> return FALSE;
>>
>> ! for (i = 0, j = 0; s1[i] != NUL;)
>>   {
>> int c1 = PTR2CHAR(s1 + i);
>> !   int c2 = PTR2CHAR(s2 + j);
>>
>> if ((p_fic ? MB_TOLOWER(c1) != MB_TOLOWER(c2) : c1 != c2)
>> && (prev1 != '*' || prev2 != '*'))
>> return FAIL;
>> prev2 = prev1;
>> prev1 = c1;
>> +
>> + i += MB_PTR2LEN(s1 + i);
>> + j += MB_PTR2LEN(s2 + j);
>>   }
>>   return TRUE;
>>   }
>
> Was the test for s2[j] != NUL left out intentionally, or does another
> code path catch that one?


I assume that you're talking about line misc2.c:5071:

!5071 for (i = 0, j = 0; s1[i] != NUL;)
 5072 {
 5073 int c1 = PTR2CHAR(s1 + i);
 5074 int c2 = PTR2CHAR(s2 + j);
 5075
 5076 if ((p_fic ? MB_TOLOWER(c1) != MB_TOLOWER(c2) : c1 != c2)
 5077 && (prev1 != '*' || prev2 != '*'))
 5078 return FAIL;
 5079 prev2 = prev1;
 5080 prev1 = c1;
 5081
 5082 i += MB_PTR2LEN(s1 + i);
 5083 j += MB_PTR2LEN(s2 + j);
 5084 }
 5085 return TRUE;

At first I thought that testing for s2[j] != NUL was useless
at line 5071, since if s2[j] is NUL, then the test at line 5076
would be false and so function would return at line 5078.

But I now see 2 reasons why that may not be true:

- if s2 ends with "**" then (prev1 != '*' || prev2 != '*')
  at line 5077 will be false and the loop will access beyond
  of string for s2! (bug!)

- or if the is s1[i] contains an invalid utf8 sequence
  such as: 0xc0 0x80 for which PTR2CHAR(...) is  0.
  and s2[j] is NUL, then c1 and c2 will be equal and
  the loop will continue, hence also accessing beyond
  end of string s2 (bug!).

So it's buggy :-(

It's also odd that function returns TRUE, FALSE or FAIL.
That was not introduced by patch 7.4.835.
The return FAIL should be return FALSE at line 5078.

How about following patch?

Regards
Dominique

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/misc2.c b/src/misc2.c
index a4a65d6..379916b 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -5059,6 +5059,8 @@ ff_wc_equal(s1, s2)
 char_u	*s2;
 {
 int		i, j;
+int		c1 = NUL;
+int		c2 = NUL;
 int		prev1 = NUL;
 int		prev2 = NUL;
 
@@ -5068,21 +5070,21 @@ ff_wc_equal(s1, s2)
 if (s1 == NULL || s2 == NULL)
 	return FALSE;
 
-for (i = 0, j = 0; s1[i] != NUL;)
+for (i = 0, j = 0; s1[i] != NUL && s2[j] != NUL;)
 {
-	int c1 = PTR2CHAR(s1 + i);
-	int c2 = PTR2CHAR(s2 + j);
+	c1 = PTR2CHAR(s1 + i);
+	c2 = PTR2CHAR(s2 + j);
 
 	if ((p_fic ? MB_TOLOWER(c1) != MB_TOLOWER(c2) : c1 != c2)
 		&& (prev1 != '*' || prev2 != '*'))
-	return FAIL;
+	return FALSE;
 	prev2 = prev1;
 	prev1 = c1;
 
 i += MB_PTR2LEN(s1 + i);
 j += MB_PTR2LEN(s2 + j);
 }
-return TRUE;
+return c1 == c2;
 }
 #endif
 


Question regarding :normal

2015-08-25 Thread Quinn Strahl
A difference in behaviour between :g and :normal recently frustrated me, 
and I wonder if it's up for debate:

:g does a pass on matching lines and marks them before performing the 
operation; this allows it to be generally undeterred by operations that include 
addition/deletion of lines.

:normal does not do this, and as a result, it can get "thrown off" by 
such operations. For (a trivial) example, on the hypothetical file:

foo
bar
baz

Performing :1,3normal yyp would produce the following result:

foo
foo
foo
foo
bar
baz

Whereas the more intuitive result would be:

foo
foo
bar
bar
baz
baz

There does exist a workaround, in the form of :g/^/normal yyp -- simply 
using :g in a way guaranteed to match every line in the desired range -- but 
this is a bit of a compositional kludge.

Would it be feasible to add the marking behaviour of :g to :normal, or is that 
not worth implementing / a feature?

-- 
-- 
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: Question regarding :normal

2015-08-25 Thread Justin M. Keyes
On Tue, Aug 25, 2015 at 10:00 PM, Quinn Strahl  wrote:
> A difference in behaviour between :g and :normal recently frustrated 
> me, and I wonder if it's up for debate:
>
> :g does a pass on matching lines and marks them before performing the 
> operation; this allows it to be generally undeterred by operations that 
> include addition/deletion of lines.
>
> :normal does not do this, and as a result, it can get "thrown off" by 
> such operations. For (a trivial) example, on the hypothetical file:
>
> foo
> bar
> baz
>
> Performing :1,3normal yyp would produce the following result:
>
> foo
> foo
> foo
> foo
> bar
> baz
>
> Whereas the more intuitive result would be:
>
> foo
> foo
> bar
> bar
> baz
> baz
>
> There does exist a workaround, in the form of :g/^/normal yyp -- 
> simply using :g in a way guaranteed to match every line in the desired range 
> -- but this is a bit of a compositional kludge.
>
> Would it be feasible to add the marking behaviour of :g to :normal, or is 
> that not worth implementing / a feature?

Why do you want them to behave the same? They serve different
purposes. Or rather, :g serves a purpose, and :normal is behaving in
the typical way for a range command that performs edits/changes.


Justin M. Keyes

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