Re: Possible bug with search command invoked with foldd

2010-03-17 Fir de Conversatie Jean Johner
On Mar 16, 9:53 pm, Lech Lorens lech.lor...@gmail.com wrote:
 2,3. Bram Moolenaar is the author of Vim, its maintainer and the person
 who reviews the patches and makes the final decision what goes in and
 what does not. Only Bram can answer these questions.

OK.
Please, Bram, do consider including the above wonderful patch into one
of your official patches.
No urgence however.

Best regards

Jean Johner

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


Re: Caught E38 Null argument

2010-03-17 Fir de Conversatie Bram Moolenaar

Lech Lorens wrote:

 On 14-Mar-2010 Dominique Pellé dominique.pe...@gmail.com wrote:
  
  So the position of the cursor is wrong. I think
  curwin-w_cursor.lnum is 0 because it's set
  in popupmnu.c:643 to 0:
  
  643 curwin-w_cursor.lnum = 0;
  
  If I replace this line with...
  
  643 curwin-w_cursor.lnum = 1;
  
  ... then E38 no longer happens, but I have no idea
  whether this fix is correct!
  
  $ hg diff popupmnu.c
  diff -r aab202d244b6 src/popupmnu.c
  --- a/src/popupmnu.cWed Mar 10 17:16:12 2010 +0100
  +++ b/src/popupmnu.cSun Mar 14 10:50:53 2010 +0100
  @@ -640,7 +640,7 @@
  
  curbuf-b_changed = 0;
  curbuf-b_p_ma = FALSE;
  -   curwin-w_cursor.lnum = 0;
  +   curwin-w_cursor.lnum = 1;
  curwin-w_cursor.col = 0;
  
  if (curwin != curwin_save  win_valid(curwin_save))
 
 Your modification fixes more than just this problem. Accidentally, I was
 recently investigating a problem with scrolling the preview window when
 the pop-up menu is visible. This can be reproduced as follows:
 - build C tags for Vim sources,
 - open ex_docmd.c in Gvim, go to line 1689,
 - set 'cot' to menu,preview, set 'number',
 - insert the following line:
   if (ea.
 - without leaving the insert mode invoke omnicompletion by pressing C-o,
 - move the mouse pointer so that it hovers over the preview window and
   use the mouse scroll wheel to first scroll the window's contents up
   (by rotating the scroll wheel DOWN).
 
 At this point the preview window will have scrolled by 1 line in the
 opposite direction than intended and will show line number 0, containing
 a copy of line 1. What is more, if you scroll the mouse wheel up, you
 will be able to make the window display lines with negative numbers.
 
 Your patch prevents Gvim from behaving this way. My modifications fix
 the problem too but they do not fix the problem reported by Dasn.
 However, I am still attaching a patch for Bram to consider whether it is
 worthwhile to include the changes just for the sake of safety.
 
 The patch also includes a change to fold.c - I removed a redundant
 check.

I'll include that.  And thanks for checking Dominique's patch.

-- 
CRONE:  Who sent you?
ARTHUR: The Knights Who Say Ni!
CRONE:  Aaaagh!  (she looks around in rear) No!  We have no shrubberies here.
 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/ \\\
\\\download, build and distribute -- http://www.A-A-P.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


Patch 7.2.395

2010-03-17 Fir de Conversatie Bram Moolenaar

Patch 7.2.395
Problem:In help CTRL=] on g?g? escapes the ?, causing it to fail. (Tony
Mechelynck)
Solution:   Don't escape ? for a help command. (Sergey Khorev)
Files:  src/normal.c


*** ../vim-7.2.394/src/normal.c 2010-01-19 15:23:38.0 +0100
--- src/normal.c2010-03-13 13:04:46.0 +0100
***
*** 5526,5536 
break;
  
default:
if (curbuf-b_help)
STRCPY(buf, he! );
else
{
-   tag_cmd = TRUE;
if (g_cmd)
STRCPY(buf, tj );
else
--- 5526,5536 
break;
  
default:
+   tag_cmd = TRUE;
if (curbuf-b_help)
STRCPY(buf, he! );
else
{
if (g_cmd)
STRCPY(buf, tj );
else
*** ../vim-7.2.394/src/version.c2010-03-10 17:14:07.0 +0100
--- src/version.c   2010-03-17 13:05:11.0 +0100
***
*** 683,684 
--- 683,686 
  {   /* Add new patch number below this line */
+ /**/
+ 395,
  /**/

-- 
There are three kinds of people: Those who can count  those who can't.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.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


bug: Vim trys to set color -1

2010-03-17 Fir de Conversatie graywh
I found a bug where Vim tries to set foreground/background color -1.
I noticed the issue when running Vim inside Tmux and
using :CSApproxSnapshot.  Tmux doesn't handle the escape sequences
(\E[3-1m and \E[4-1m) the same as Xterm does.  Godlygeek seems to
think Vim is trying to reset the colors back to the terminal default.
Anyway, I'm hoping someone else can help fix this or make sense of the
problem.

--
Will Gray

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


Re: typo in doc

2010-03-17 Fir de Conversatie Bram Moolenaar

Yasuhiro Matsumoto wrote:

 I found typo in doc.
 
 diff -r aab202d244b6 runtime/doc/insert.txt
 --- a/runtime/doc/insert.txt  Wed Mar 10 17:16:12 2010 +0100
 +++ b/runtime/doc/insert.txt  Wed Mar 17 01:40:29 2010 +0900
 @@ -639,6 +639,7 @@
 return \Tab
  else
 return \C-N
 +endif
   endfunction
   inoremap Tab C-R=CleverTab()CR

Thanks!

-- 
There can't be a crisis today, my schedule is already full.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.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


Re: patch for strong encryption in vim, resending patch for vim7* dev branch.

2010-03-17 Fir de Conversatie Bram Moolenaar

Mohsin wrote:

 Resending patch for current vim 72* dev branch (from cvs).
 --
  Added functionality for encrypting files with blowfish and sha2.
  Blowfish is from http://www.schneier.com/blowfish.html
 
  Older vim encrypted files with VimCrypt~1 header will still be
  readable by newer vim,
  but newly written files will have VimCrypt~2 in the header.
 
  Algorithm: key=sha2(password), blowfish in Outputfeedback mode,
  with random 64bit init vector, so same file produces a completely
  different output, every time it is saved.
 
 Changes:
 
 Minor changes to fileio.c misc2.c, and 4 new files blowfish.c
 blowfish.h sha2.c sha2.h
 Patch is based on  vim DEV branch as of  2010-03-15

Thanks.

I would very much like feedback on this patch.  Any platform where this
causes problems, such as compiler warnings?


-- 
Proofread carefully to see if you any words out.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.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


Patch 7.2.396

2010-03-17 Fir de Conversatie Bram Moolenaar

Patch 7.2.396
Problem:Get E38 errors. (Dasn)
Solution:   Set cursor to line 1 instead of 0. (Dominique Pelle)
Files:  src/popupmnu.c


*** ../vim-7.2.395/src/popupmnu.c   2010-01-19 18:05:05.0 +0100
--- src/popupmnu.c  2010-03-17 12:59:01.0 +0100
***
*** 640,646 
  
curbuf-b_changed = 0;
curbuf-b_p_ma = FALSE;
!   curwin-w_cursor.lnum = 0;
curwin-w_cursor.col = 0;
  
if (curwin != curwin_save  win_valid(curwin_save))
--- 640,646 
  
curbuf-b_changed = 0;
curbuf-b_p_ma = FALSE;
!   curwin-w_cursor.lnum = 1;
curwin-w_cursor.col = 0;
  
if (curwin != curwin_save  win_valid(curwin_save))
*** ../vim-7.2.395/src/version.c2010-03-17 13:07:01.0 +0100
--- src/version.c   2010-03-17 14:47:30.0 +0100
***
*** 683,684 
--- 683,686 
  {   /* Add new patch number below this line */
+ /**/
+ 396,
  /**/

-- 
There are 10 kinds of people: Those who understand binary and those who don't.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.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


Re: bug: Vim trys to set color -1

2010-03-17 Fir de Conversatie Matt Wozniski
On Wed, Mar 17, 2010 at 9:51 AM, graywh gra...@gmail.com wrote:
 I found a bug where Vim tries to set foreground/background color -1.
 I noticed the issue when running Vim inside Tmux and
 using :CSApproxSnapshot.  Tmux doesn't handle the escape sequences
 (\E[3-1m and \E[4-1m) the same as Xterm does.  Godlygeek seems to
 think Vim is trying to reset the colors back to the terminal default.
 Anyway, I'm hoping someone else can help fix this or make sense of the
 problem.

This problem can be  reproduced without CSApprox by just doing

:hi Normal ctermbg=NONE

or

:hi Normal ctermfg=NONE

These commands result in a call to term_fg_color or term_bg_color from
syntax.c with an argument of  -1.  I'm not sure what exactly the fix
should be, though.  Maybe this?  The below seems to work from quick
tests, using ^[[39m and ^[[49m as the color-reset for xterm-alikes.

~Matt

--- src/term.c.orig 2010-03-17 11:33:36.289769000 -0400
+++ src/term.c  2010-03-17 11:35:31.71950 -0400
@@ -2756,7 +2756,8 @@
 /* Special handling of 16 colors, because termcap can't handle it */
 /* Also accept \e[3%dm for TERMINFO, it is sometimes used */
 /* Also accept CSI instead of Esc[ */
-if (n = 8  t_colors = 16
+/* Also handle -1 specially as a reset to default */
+if (((n = 8  t_colors = 16) || n == -1)
   ((s[0] == ESC  s[1] == '[') || (s[0] == CSI  (i = 1) == 1))
   s[i] != NUL
   (STRCMP(s + i + 1, %p1%dm) == 0
@@ -2770,9 +2771,9 @@
%s%s%%dm,
 #endif
i == 2 ? IF_EB(\033[, ESC_STR [) : \233,
-   s[i] == '3' ? (n = 16 ? 38;5; : 9)
-   : (n = 16 ? 48;5; : 10));
-   OUT_STR(tgoto(buf, 0, n = 16 ? n : n - 8));
+   s[i] == '3' ? (n == -1 ? 3 : n = 16 ? 38;5; : 9)
+   : (n == -1 ? 4 : n = 16 ? 48;5; : 10));
+   OUT_STR(tgoto(buf, 0, n == -1 ? 9 : n = 16 ? n : n - 8));
 }
 else
OUT_STR(tgoto((char *)s, 0, n));

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


Re: patch for strong encryption in vim, resending patch for vim7* dev branch.

2010-03-17 Fir de Conversatie Mosh
On Wed, Mar 17, 2010 at 8:24 AM, Bram Moolenaar b...@moolenaar.net wrote:

 Mohsin wrote:

 Resending patch for current vim 72* dev branch (from cvs).
 --
  Added functionality for encrypting files with blowfish and sha2.
  Blowfish is from http://www.schneier.com/blowfish.html

  Older vim encrypted files with VimCrypt~1 header will still be
  readable by newer vim,
  but newly written files will have VimCrypt~2 in the header.

  Algorithm: key=sha2(password), blowfish in Outputfeedback mode,
  with random 64bit init vector, so same file produces a completely
  different output, every time it is saved.

 Changes:

 Minor changes to fileio.c misc2.c, and 4 new files blowfish.c
 blowfish.h sha2.c sha2.h
 Patch is based on  vim DEV branch as of  2010-03-15

 Thanks.

 I would very much like feedback on this patch.  Any platform where this
 causes problems, such as compiler warnings?

This has been tested these on windows 32bits, linux 32bits,
and solaris 32 bits (big endian).

Windows XP 32 bit - MS Visual studio compiler 5.0 IDE,
no compiler warnings at warning level 3.

I can rerun ms-vc++ with warning level 4 sometime.

Also the the encrypted files are cross platform (as expected).

There are some unused functions and comments that you can
remove/edit as you wish.

---

thanks,
mohsin.



 --
 Proofread carefully to see if you any words out.

  /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
 \\\        download, build and distribute -- http://www.A-A-P.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


Patch 7.2.397

2010-03-17 Fir de Conversatie Bram Moolenaar

Patch 7.2.397
Problem:Redundant check for w_lines_valid.
Solution:   Remove the if.  (Lech Lorens)
Files:  src/fold.c


*** ../vim-7.2.396/src/fold.c   2010-02-24 14:34:10.0 +0100
--- src/fold.c  2010-03-17 13:03:00.0 +0100
***
*** 1053,1067 
  {
  int   i;
  
! if (win-w_lines_valid  0)
!   for (i = 0; i  win-w_lines_valid; ++i)
!   if (win-w_lines[i].wl_valid)
!   {
!   if (lnum  win-w_lines[i].wl_lnum)
!   return -1;
!   if (lnum = win-w_lines[i].wl_lastlnum)
!   return i;
!   }
  return -1;
  }
  
--- 1053,1066 
  {
  int   i;
  
! for (i = 0; i  win-w_lines_valid; ++i)
!   if (win-w_lines[i].wl_valid)
!   {
!   if (lnum  win-w_lines[i].wl_lnum)
!   return -1;
!   if (lnum = win-w_lines[i].wl_lastlnum)
!   return i;
!   }
  return -1;
  }
  
*** ../vim-7.2.396/src/version.c2010-03-17 14:47:56.0 +0100
--- src/version.c   2010-03-17 16:43:34.0 +0100
***
*** 683,684 
--- 683,686 
  {   /* Add new patch number below this line */
+ /**/
+ 397,
  /**/

-- 
Did you ever stop to think...  and forget to start again?
  -- Steven Wright

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.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


Patch 7.2.398

2010-03-17 Fir de Conversatie Bram Moolenaar

Patch 7.2.398
Problem:When moving windows the cursor ends up in the wrong line.
Solution:   Set the window width and height properly. (Lech Lorens)
Files:  src/window.c


*** ../vim-7.2.397/src/window.c 2010-01-27 20:26:41.0 +0100
--- src/window.c2010-03-17 16:40:06.0 +0100
***
*** 991,1018 
wp-w_p_scr = curwin-w_p_scr;
if (need_status)
{
!   --oldwin-w_height;
oldwin-w_status_height = need_status;
}
if (flags  (WSP_TOP | WSP_BOT))
{
/* set height and row of new window to full height */
wp-w_winrow = tabline_height();
!   wp-w_height = curfrp-fr_height - (p_ls  0);
wp-w_status_height = (p_ls  0);
}
else
{
/* height and row of new window is same as current window */
wp-w_winrow = oldwin-w_winrow;
!   wp-w_height = oldwin-w_height;
wp-w_status_height = oldwin-w_status_height;
}
frp-fr_height = curfrp-fr_height;
  
/* new_size of the current window goes to the new window, use
 * one column for the vertical separator */
!   wp-w_width = new_size;
if (before)
wp-w_vsep_width = 1;
else
--- 991,1018 
wp-w_p_scr = curwin-w_p_scr;
if (need_status)
{
!   win_new_height(oldwin, oldwin-w_height - 1);
oldwin-w_status_height = need_status;
}
if (flags  (WSP_TOP | WSP_BOT))
{
/* set height and row of new window to full height */
wp-w_winrow = tabline_height();
!   win_new_height(wp, curfrp-fr_height - (p_ls  0));
wp-w_status_height = (p_ls  0);
}
else
{
/* height and row of new window is same as current window */
wp-w_winrow = oldwin-w_winrow;
!   win_new_height(wp, oldwin-w_height);
wp-w_status_height = oldwin-w_status_height;
}
frp-fr_height = curfrp-fr_height;
  
/* new_size of the current window goes to the new window, use
 * one column for the vertical separator */
!   win_new_width(wp, new_size);
if (before)
wp-w_vsep_width = 1;
else
***
*** 1049,1061 
if (flags  (WSP_TOP | WSP_BOT))
{
wp-w_wincol = 0;
!   wp-w_width = Columns;
wp-w_vsep_width = 0;
}
else
{
wp-w_wincol = oldwin-w_wincol;
!   wp-w_width = oldwin-w_width;
wp-w_vsep_width = oldwin-w_vsep_width;
}
frp-fr_width = curfrp-fr_width;
--- 1049,1061 
if (flags  (WSP_TOP | WSP_BOT))
{
wp-w_wincol = 0;
!   win_new_width(wp, Columns);
wp-w_vsep_width = 0;
}
else
{
wp-w_wincol = oldwin-w_wincol;
!   win_new_width(wp, oldwin-w_width);
wp-w_vsep_width = oldwin-w_vsep_width;
}
frp-fr_width = curfrp-fr_width;
***
*** ,1117 
  }
  
  /*
!  * make the new window the current window and redraw
   */
  if (do_equal || dir != 0)
win_equal(wp, TRUE,
--- ,1117 
  }
  
  /*
!  * equalize the window sizes.
   */
  if (do_equal || dir != 0)
win_equal(wp, TRUE,
***
*** 1143,1148 
--- 1143,1152 
if (size != 0)
p_wh = size;
  }
+ 
+ /*
+  * make the new window the current window
+  */
  win_enter(wp, FALSE);
  #ifdef FEAT_VERTSPLIT
  if (flags  WSP_VERT)
*** ../vim-7.2.397/src/version.c2010-03-17 16:45:04.0 +0100
--- src/version.c   2010-03-17 16:53:51.0 +0100
***
*** 683,684 
--- 683,686 
  {   /* Add new patch number below this line */
+ /**/
+ 398,
  /**/

-- 
It's not hard to meet expenses, they're everywhere.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.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


Patch 7.2.399 (extra)

2010-03-17 Fir de Conversatie Bram Moolenaar

Patch 7.2.399 (extra, after 7.2.388)
Problem:Cannot compile on MingW.
Solution:   Move ifneq to separate line. (Vlad Sandrini, Dominique Pelle)
Files:  src/Make_ming.mak


*** ../vim-7.2.398/src/Make_ming.mak2010-03-10 13:19:28.0 +0100
--- src/Make_ming.mak   2010-03-17 17:23:31.0 +0100
***
*** 215,226 
  ifndef RUBY_PLATFORM
  ifeq ($(RUBY_VER), 16)
  RUBY_PLATFORM = i586-mswin32
! else ifneq (X$(wildcard, $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/i386-mingw32), X)
  RUBY_PLATFORM = i386-mingw32
  else
  RUBY_PLATFORM = i386-mswin32
  endif
  endif
  
  ifndef RUBY_INSTALL_NAME
  ifeq ($(RUBY_VER), 16)
--- 215,228 
  ifndef RUBY_PLATFORM
  ifeq ($(RUBY_VER), 16)
  RUBY_PLATFORM = i586-mswin32
! else
! ifneq ($(wildcard $(RUBY)/lib/ruby/$(RUBY_VER_LONG)/i386-mingw32),)
  RUBY_PLATFORM = i386-mingw32
  else
  RUBY_PLATFORM = i386-mswin32
  endif
  endif
+ endif
  
  ifndef RUBY_INSTALL_NAME
  ifeq ($(RUBY_VER), 16)
*** ../vim-7.2.398/src/version.c2010-03-17 16:54:51.0 +0100
--- src/version.c   2010-03-17 17:23:40.0 +0100
***
*** 683,684 
--- 683,686 
  {   /* Add new patch number below this line */
+ /**/
+ 399,
  /**/

-- 
Life is a gift, living is an art.   (Bram Moolenaar)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.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


Patch 7.2.400

2010-03-17 Fir de Conversatie Bram Moolenaar

Patch 7.2.400 (after 7.2.387)
Problem:Dynamic Ruby is not initialised properly for version 1.9.1.
Ruby cannot create strings from NULL.
Solution:   Cleanup #ifdefs.  Handle NULL like an empty string.  Add
ruby_init_stack. (Sergey Khorev)
Files:  src/if_ruby.c


*** ../vim-7.2.399/src/if_ruby.c2010-03-10 12:46:38.0 +0100
--- src/if_ruby.c   2010-03-17 17:37:53.0 +0100
***
*** 53,58 
--- 53,63 
  # undef _WIN32_WINNT
  #endif
  
+ #if (defined(RUBY_VERSION)  RUBY_VERSION = 19) \
+ || (defined(DYNAMIC_RUBY_VER)  DYNAMIC_RUBY_VER = 19)
+ # define RUBY19_OR_LATER 1
+ #endif
+ 
  #if defined(DYNAMIC_RUBY_VER)  DYNAMIC_RUBY_VER = 19
  /* Ruby 1.9 defines a number of static functions which use rb_num2long and
   * rb_int2big */
***
*** 61,67 
  #endif
  
  #include ruby.h
! #if defined(RUBY_VERSION)  RUBY_VERSION = 19
  # include ruby/encoding.h
  #endif
  
--- 66,72 
  #endif
  
  #include ruby.h
! #ifdef RUBY19_OR_LATER
  # include ruby/encoding.h
  #endif
  
***
*** 172,179 
  # define rb_ary_new   dll_rb_ary_new
  # define rb_ary_push  dll_rb_ary_push
  #endif
! #if defined(RUBY_VERSION)  RUBY_VERSION = 19 \
! || defined(DYNAMIC_RUBY_VER)  DYNAMIC_RUBY_VER = 19
  # define rb_errinfo   dll_rb_errinfo
  #else
  # define ruby_errinfo (*dll_ruby_errinfo)
--- 177,183 
  # define rb_ary_new   dll_rb_ary_new
  # define rb_ary_push  dll_rb_ary_push
  #endif
! #ifdef RUBY19_OR_LATER
  # define rb_errinfo   dll_rb_errinfo
  #else
  # define ruby_errinfo (*dll_ruby_errinfo)
***
*** 185,196 
  # define rb_w32_snprintf  dll_rb_w32_snprintf
  #endif
  
! #if defined(RUBY_VERSION)  RUBY_VERSION = 19
  # define ruby_script  dll_ruby_script
  # define rb_enc_find_indexdll_rb_enc_find_index
  # define rb_enc_find  dll_rb_enc_find
  # define rb_enc_str_new   dll_rb_enc_str_new
  # define rb_sprintf   dll_rb_sprintf
  #endif
  
  /*
--- 189,201 
  # define rb_w32_snprintf  dll_rb_w32_snprintf
  #endif
  
! #ifdef RUBY19_OR_LATER
  # define ruby_script  dll_ruby_script
  # define rb_enc_find_indexdll_rb_enc_find_index
  # define rb_enc_find  dll_rb_enc_find
  # define rb_enc_str_new   dll_rb_enc_str_new
  # define rb_sprintf   dll_rb_sprintf
+ # define ruby_init_stack  dll_ruby_init_stack
  #endif
  
  /*
***
*** 240,247 
  static VALUE (*dll_rb_str_concat) (VALUE, VALUE);
  static VALUE (*dll_rb_str_new) (const char*, long);
  static VALUE (*dll_rb_str_new2) (const char*);
! #if defined(RUBY_VERSION)  RUBY_VERSION = 19 \
! || defined(DYNAMIC_RUBY_VER)  DYNAMIC_RUBY_VER = 19
  static VALUE (*dll_rb_errinfo) (void);
  #else
  static VALUE *dll_ruby_errinfo;
--- 245,251 
  static VALUE (*dll_rb_str_concat) (VALUE, VALUE);
  static VALUE (*dll_rb_str_new) (const char*, long);
  static VALUE (*dll_rb_str_new2) (const char*);
! #ifdef RUBY19_OR_LATER
  static VALUE (*dll_rb_errinfo) (void);
  #else
  static VALUE *dll_ruby_errinfo;
***
*** 255,276 
  static VALUE (*dll_rb_ary_new) (void);
  static VALUE (*dll_rb_ary_push) (VALUE, VALUE);
  #endif
! #if defined(DYNAMIC_RUBY_VER)  DYNAMIC_RUBY_VER = 19
  static VALUE (*dll_rb_int2big)(SIGNED_VALUE);
  #endif
  #if defined(DYNAMIC_RUBY_VER)  DYNAMIC_RUBY_VER = 18
  static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...);
  #endif
  
! #if defined(RUBY_VERSION)  RUBY_VERSION = 19
  static void (*dll_ruby_script) (const char*);
  static int (*dll_rb_enc_find_index) (const char*);
  static rb_encoding* (*dll_rb_enc_find) (const char*);
  static VALUE (*dll_rb_enc_str_new) (const char*, long, rb_encoding*);
  static VALUE (*dll_rb_sprintf) (const char*, ...);
  #endif
  
! #if defined(DYNAMIC_RUBY_VER)  DYNAMIC_RUBY_VER = 19
  static SIGNED_VALUE rb_num2long_stub(VALUE x)
  {
  return dll_rb_num2long(x);
--- 259,281 
  static VALUE (*dll_rb_ary_new) (void);
  static VALUE (*dll_rb_ary_push) (VALUE, VALUE);
  #endif
! #ifdef RUBY19_OR_LATER
  static VALUE (*dll_rb_int2big)(SIGNED_VALUE);
  #endif
  #if defined(DYNAMIC_RUBY_VER)  DYNAMIC_RUBY_VER = 18
  static int (*dll_rb_w32_snprintf)(char*, size_t, const char*, ...);
  #endif
  
! #ifdef RUBY19_OR_LATER
  static void (*dll_ruby_script) (const char*);
  static int (*dll_rb_enc_find_index) (const char*);
  static rb_encoding* (*dll_rb_enc_find) (const char*);
  static VALUE (*dll_rb_enc_str_new) (const char*, long, rb_encoding*);
  static VALUE (*dll_rb_sprintf) (const char*, ...);
+ static void (*ruby_init_stack)(VALUE*);
  #endif
  
! #ifdef RUBY19_OR_LATER
  static SIGNED_VALUE rb_num2long_stub(VALUE x)
  {
  

Patch 7.2.401

2010-03-17 Fir de Conversatie Bram Moolenaar

Patch 7.2.401
Problem::e dirTab with 'wildmode' set to list doesn't highlight
directory names with a space. (Alexandre Provencio)
Solution:   Remove the backslash before checking if the name is a directory.
(Dominique Pelle)
Files:  src/ex_getln.c


*** ../vim-7.2.400/src/ex_getln.c   2010-03-02 17:23:10.0 +0100
--- src/ex_getln.c  2010-03-17 19:00:54.0 +0100
***
*** 3948,3955 
  || xp-xp_context == EXPAND_SHELLCMD
  || xp-xp_context == EXPAND_BUFFERS)
{
!   /* highlight directories */
!   j = (mch_isdir(files_found[k]));
if (showtail)
p = L_SHOWFILE(k);
else
--- 3948,3959 
  || xp-xp_context == EXPAND_SHELLCMD
  || xp-xp_context == EXPAND_BUFFERS)
{
!   char_u  *halved_slash;
! 
!   /* highlight directories */
!   halved_slash = backslash_halve_save(files_found[k]);
!   j = mch_isdir(halved_slash);
!   vim_free(halved_slash);
if (showtail)
p = L_SHOWFILE(k);
else
*** ../vim-7.2.400/src/version.c2010-03-17 18:15:17.0 +0100
--- src/version.c   2010-03-17 19:12:22.0 +0100
***
*** 683,684 
--- 683,686 
  {   /* Add new patch number below this line */
+ /**/
+ 401,
  /**/

-- 
Two cows are standing together in a field.  One asks the other:
So what do you think about this Mad Cow Disease?
The other replies: That doesn't concern me. I'm a helicopter.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.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


Patch 7.2.402

2010-03-17 Fir de Conversatie Bram Moolenaar

Patch 7.2.402
Problem:This gives a #705 error: let X = function('haslocaldir')
let X = function('getcwd')
Solution:   Don't give E705 when the name is found in the hashtab. (Sergey
Khorev)
Files:  src/eval.c


*** ../vim-7.2.401/src/eval.c   2010-03-10 13:43:22.0 +0100
--- src/eval.c  2010-03-17 19:35:01.0 +0100
***
*** 19103,19108 
--- 19103,19116 
  hashtab_T *ht;
  char_u*p;
  
+ ht = find_var_ht(name, varname);
+ if (ht == NULL || *varname == NUL)
+ {
+   EMSG2(_(e_illvar), name);
+   return;
+ }
+ v = find_var_in_ht(ht, varname, TRUE);
+ 
  if (tv-v_type == VAR_FUNC)
  {
if (!(vim_strchr((char_u *)wbs, name[0]) != NULL  name[1] == ':')
***
*** 19112,19118 
EMSG2(_(E704: Funcref variable name must start with a capital: 
%s), name);
return;
}
!   if (function_exists(name))
{
EMSG2(_(E705: Variable name conflicts with existing function: %s),
name);
--- 19120,19129 
EMSG2(_(E704: Funcref variable name must start with a capital: 
%s), name);
return;
}
!   /* Don't allow hiding a function.  When v is not NULL we migth be
!* assigning another function to the same var, the type is checked
!* below. */
!   if (v == NULL  function_exists(name))
{
EMSG2(_(E705: Variable name conflicts with existing function: %s),
name);
***
*** 19120,19133 
}
  }
  
- ht = find_var_ht(name, varname);
- if (ht == NULL || *varname == NUL)
- {
-   EMSG2(_(e_illvar), name);
-   return;
- }
- 
- v = find_var_in_ht(ht, varname, TRUE);
  if (v != NULL)
  {
/* existing variable, need to clear the value */
--- 19131,19136 
*** ../vim-7.2.401/src/version.c2010-03-17 19:13:19.0 +0100
--- src/version.c   2010-03-17 19:36:09.0 +0100
***
*** 683,684 
--- 683,686 
  {   /* Add new patch number below this line */
+ /**/
+ 402,
  /**/

-- 
Michael: There is no such thing as a dump question.
Bernard: Sure there is.  For example what is a core dump?

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\download, build and distribute -- http://www.A-A-P.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


Re: Patch 7.2.400

2010-03-17 Fir de Conversatie Tony Mechelynck

On 17/03/10 18:15, Bram Moolenaar wrote:


Patch 7.2.400 (after 7.2.387)
Problem:Dynamic Ruby is not initialised properly for version 1.9.1.
Ruby cannot create strings from NULL.
Solution:   Cleanup #ifdefs.  Handle NULL like an empty string.  Add
ruby_init_stack. (Sergey Khorev)
Files:  src/if_ruby.c


After this patch, I get a warning (probably harmless) as follows:

if_ruby.c: In function ‘vim_to_ruby’:
if_ruby.c:726: warning: pointer type mismatch in conditional expression

The relevant hunk is the following:


***
*** 720,775 

   if (tv-v_type == VAR_STRING)
   {
! result = rb_str_new2((char *)tv-vval.v_string);
   }
   else if (tv-v_type == VAR_NUMBER)

[...]

--- 722,778 

   if (tv-v_type == VAR_STRING)
   {
!   result = rb_str_new2((char *)(tv-vval.v_string == NULL
!  ?  : tv-vval.v_string));
   }
   else if (tv-v_type == VAR_NUMBER)

[...]


Best regards,
Tony.
--
If you wish to live wisely, ignore sayings -- including this one.

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