Re: Patch 7.4.759

2015-06-25 Fir de Conversatie 驼峰
在 2015年6月26日星期五 UTC+8上午12:28:05,Bram Moolenaar写道:
> Patch 7.4.759
> Problem:Building with Lua 5.3 doesn't work, symbols have changed.
> Solution:   Use the new names for the new version. (Felix Schnizlein)
> Files:  src/if_lua.c
> 
> 
> *** ../vim-7.4.758/src/if_lua.c   2015-02-17 16:28:51.365508352 +0100
> --- src/if_lua.c  2015-06-25 18:24:28.026834336 +0200
> ***
> *** 111,117 
> --- 111,122 
>   #define lua_tointeger dll_lua_tointeger
>   #define lua_call dll_lua_call
>   #define lua_pcall dll_lua_pcall
> + 
> + #elif LUA_VERSION_NUM <= 502
> + #define lua_replace dll_lua_replace
> + #define lua_remove dll_lua_remove
>   #else
> + #define lua_rotate dll_lua_rotate
>   #define lua_tonumberx dll_lua_tonumberx
>   #define lua_tointegerx dll_lua_tointegerx
>   #define lua_callk dll_lua_callk
> ***
> *** 124,131 
>   #define lua_gettop dll_lua_gettop
>   #define lua_settop dll_lua_settop
>   #define lua_pushvalue dll_lua_pushvalue
> ! #define lua_replace dll_lua_replace
> ! #define lua_remove dll_lua_remove
>   #define lua_isnumber dll_lua_isnumber
>   #define lua_isstring dll_lua_isstring
>   #define lua_type dll_lua_type
> --- 129,135 
>   #define lua_gettop dll_lua_gettop
>   #define lua_settop dll_lua_settop
>   #define lua_pushvalue dll_lua_pushvalue
> ! #define lua_copy dll_lua_copy
>   #define lua_isnumber dll_lua_isnumber
>   #define lua_isstring dll_lua_isstring
>   #define lua_type dll_lua_type
> ***
> *** 195,201 
> --- 199,210 
>   lua_Integer (*dll_lua_tointeger) (lua_State *L, int idx);
>   void (*dll_lua_call) (lua_State *L, int nargs, int nresults);
>   int (*dll_lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc);
> + #elif LUA_VERSION_NUM <= 502
> + void (*dll_lua_replace) (lua_State *L, int idx);
> + void (*dll_lua_remove) (lua_State *L, int idx);
>   #else
> + 
> + void  (*dll_lua_rotate) (lua_State *L, int idx, int n);
>   lua_Number (*dll_lua_tonumberx) (lua_State *L, int idx, int *isnum);
>   lua_Integer (*dll_lua_tointegerx) (lua_State *L, int idx, int *isnum);
>   void (*dll_lua_callk) (lua_State *L, int nargs, int nresults, int ctx,
> ***
> *** 204,217 
>   int ctx, lua_CFunction k);
>   void (*dll_lua_getglobal) (lua_State *L, const char *var);
>   void (*dll_lua_setglobal) (lua_State *L, const char *var);
>   #endif
>   const char *(*dll_lua_typename) (lua_State *L, int tp);
>   void   (*dll_lua_close) (lua_State *L);
>   int (*dll_lua_gettop) (lua_State *L);
>   void (*dll_lua_settop) (lua_State *L, int idx);
>   void (*dll_lua_pushvalue) (lua_State *L, int idx);
> - void (*dll_lua_replace) (lua_State *L, int idx);
> - void (*dll_lua_remove) (lua_State *L, int idx);
>   int (*dll_lua_isnumber) (lua_State *L, int idx);
>   int (*dll_lua_isstring) (lua_State *L, int idx);
>   int (*dll_lua_type) (lua_State *L, int idx);
> --- 213,225 
>   int ctx, lua_CFunction k);
>   void (*dll_lua_getglobal) (lua_State *L, const char *var);
>   void (*dll_lua_setglobal) (lua_State *L, const char *var);
> + void (*dll_lua_copy) (lua_State *L, int fromidx, int toidx);
>   #endif
>   const char *(*dll_lua_typename) (lua_State *L, int tp);
>   void   (*dll_lua_close) (lua_State *L);
>   int (*dll_lua_gettop) (lua_State *L);
>   void (*dll_lua_settop) (lua_State *L, int idx);
>   void (*dll_lua_pushvalue) (lua_State *L, int idx);
>   int (*dll_lua_isnumber) (lua_State *L, int idx);
>   int (*dll_lua_isstring) (lua_State *L, int idx);
>   int (*dll_lua_type) (lua_State *L, int idx);
> ***
> *** 288,294 
> --- 296,307 
>   {"lua_tointeger", (luaV_function) &dll_lua_tointeger},
>   {"lua_call", (luaV_function) &dll_lua_call},
>   {"lua_pcall", (luaV_function) &dll_lua_pcall},
> + #elif LUA_VERSION_NUM <= 502
> + {"lua_replace", (luaV_function) &dll_lua_replace},
> + {"lua_remove", (luaV_function) &dll_lua_remove},
>   #else
> + {"lua_rotate", (luaV_function) &dll_lua_rotate},
> + {"lua_copy", (luaV_function) &dll_lua_copy},
>   {"lua_tonumberx", (luaV_function) &dll_lua_tonumberx},
>   {"lua_tointegerx", (luaV_function) &dll_lua_tointegerx},
>   {"lua_callk", (luaV_function) &dll_lua_callk},
> ***
> *** 301,308 
>   {"lua_gettop", (luaV_function) &dll_lua_gettop},
>   {"lua_settop", (luaV_function) &dll_lua_settop},
>   {"lua_pushvalue", (luaV_function) &dll_lua_pushvalue},
> - {"lua_replace", (luaV_function) &dll_lua_replace},
> - {"lua_remove", (luaV_function) &dll_lua_remove},
>   {"lua_isnumber", (luaV_function) &dll_lua_isnumber},
>   {"lua_isstring", (luaV_function) &dll_lua_isstring},
>   {"lua_type", (luaV_function) &dll_lua_type},
> --- 314,319 
> *** ../vim-7.4.758/src/version.c  2015-06-25 18:20:30.437271806 +0200
> --- src/version.c 2015-06-25 18:25:17.978321826 +0200
> ***
> *** 743,744 
> --- 743,746 
>   {   /* Add new patch num

Re: Patch 7.4.759

2015-06-25 Fir de Conversatie KF Leong
On Friday, June 26, 2015 at 12:28:05 AM UTC+8, Bram Moolenaar wrote:
> Patch 7.4.759
> Problem:Building with Lua 5.3 doesn't work, symbols have changed.
> Solution:   Use the new names for the new version. (Felix Schnizlein)
> Files:  src/if_lua.c
> 
> 
> *** ../vim-7.4.758/src/if_lua.c   2015-02-17 16:28:51.365508352 +0100
> --- src/if_lua.c  2015-06-25 18:24:28.026834336 +0200
> ***
> *** 111,117 
> --- 111,122 
>   #define lua_tointeger dll_lua_tointeger
>   #define lua_call dll_lua_call
>   #define lua_pcall dll_lua_pcall
> + 
> + #elif LUA_VERSION_NUM <= 502
> + #define lua_replace dll_lua_replace
> + #define lua_remove dll_lua_remove
>   #else
> + #define lua_rotate dll_lua_rotate
>   #define lua_tonumberx dll_lua_tonumberx
>   #define lua_tointegerx dll_lua_tointegerx
>   #define lua_callk dll_lua_callk
> ***
> *** 124,131 
>   #define lua_gettop dll_lua_gettop
>   #define lua_settop dll_lua_settop
>   #define lua_pushvalue dll_lua_pushvalue
> ! #define lua_replace dll_lua_replace
> ! #define lua_remove dll_lua_remove
>   #define lua_isnumber dll_lua_isnumber
>   #define lua_isstring dll_lua_isstring
>   #define lua_type dll_lua_type
> --- 129,135 
>   #define lua_gettop dll_lua_gettop
>   #define lua_settop dll_lua_settop
>   #define lua_pushvalue dll_lua_pushvalue
> ! #define lua_copy dll_lua_copy
>   #define lua_isnumber dll_lua_isnumber
>   #define lua_isstring dll_lua_isstring
>   #define lua_type dll_lua_type
> ***
> *** 195,201 
> --- 199,210 
>   lua_Integer (*dll_lua_tointeger) (lua_State *L, int idx);
>   void (*dll_lua_call) (lua_State *L, int nargs, int nresults);
>   int (*dll_lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc);
> + #elif LUA_VERSION_NUM <= 502
> + void (*dll_lua_replace) (lua_State *L, int idx);
> + void (*dll_lua_remove) (lua_State *L, int idx);
>   #else
> + 
> + void  (*dll_lua_rotate) (lua_State *L, int idx, int n);
>   lua_Number (*dll_lua_tonumberx) (lua_State *L, int idx, int *isnum);
>   lua_Integer (*dll_lua_tointegerx) (lua_State *L, int idx, int *isnum);
>   void (*dll_lua_callk) (lua_State *L, int nargs, int nresults, int ctx,
> ***
> *** 204,217 
>   int ctx, lua_CFunction k);
>   void (*dll_lua_getglobal) (lua_State *L, const char *var);
>   void (*dll_lua_setglobal) (lua_State *L, const char *var);
>   #endif
>   const char *(*dll_lua_typename) (lua_State *L, int tp);
>   void   (*dll_lua_close) (lua_State *L);
>   int (*dll_lua_gettop) (lua_State *L);
>   void (*dll_lua_settop) (lua_State *L, int idx);
>   void (*dll_lua_pushvalue) (lua_State *L, int idx);
> - void (*dll_lua_replace) (lua_State *L, int idx);
> - void (*dll_lua_remove) (lua_State *L, int idx);
>   int (*dll_lua_isnumber) (lua_State *L, int idx);
>   int (*dll_lua_isstring) (lua_State *L, int idx);
>   int (*dll_lua_type) (lua_State *L, int idx);
> --- 213,225 
>   int ctx, lua_CFunction k);
>   void (*dll_lua_getglobal) (lua_State *L, const char *var);
>   void (*dll_lua_setglobal) (lua_State *L, const char *var);
> + void (*dll_lua_copy) (lua_State *L, int fromidx, int toidx);
>   #endif
>   const char *(*dll_lua_typename) (lua_State *L, int tp);
>   void   (*dll_lua_close) (lua_State *L);
>   int (*dll_lua_gettop) (lua_State *L);
>   void (*dll_lua_settop) (lua_State *L, int idx);
>   void (*dll_lua_pushvalue) (lua_State *L, int idx);
>   int (*dll_lua_isnumber) (lua_State *L, int idx);
>   int (*dll_lua_isstring) (lua_State *L, int idx);
>   int (*dll_lua_type) (lua_State *L, int idx);
> ***
> *** 288,294 
> --- 296,307 
>   {"lua_tointeger", (luaV_function) &dll_lua_tointeger},
>   {"lua_call", (luaV_function) &dll_lua_call},
>   {"lua_pcall", (luaV_function) &dll_lua_pcall},
> + #elif LUA_VERSION_NUM <= 502
> + {"lua_replace", (luaV_function) &dll_lua_replace},
> + {"lua_remove", (luaV_function) &dll_lua_remove},
>   #else
> + {"lua_rotate", (luaV_function) &dll_lua_rotate},
> + {"lua_copy", (luaV_function) &dll_lua_copy},
>   {"lua_tonumberx", (luaV_function) &dll_lua_tonumberx},
>   {"lua_tointegerx", (luaV_function) &dll_lua_tointegerx},
>   {"lua_callk", (luaV_function) &dll_lua_callk},
> ***
> *** 301,308 
>   {"lua_gettop", (luaV_function) &dll_lua_gettop},
>   {"lua_settop", (luaV_function) &dll_lua_settop},
>   {"lua_pushvalue", (luaV_function) &dll_lua_pushvalue},
> - {"lua_replace", (luaV_function) &dll_lua_replace},
> - {"lua_remove", (luaV_function) &dll_lua_remove},
>   {"lua_isnumber", (luaV_function) &dll_lua_isnumber},
>   {"lua_isstring", (luaV_function) &dll_lua_isstring},
>   {"lua_type", (luaV_function) &dll_lua_type},
> --- 314,319 
> *** ../vim-7.4.758/src/version.c  2015-06-25 18:20:30.437271806 +0200
> --- src/version.c 2015-06-25 18:25:17.978321826 +0200
> ***
> *** 743,744 
> --- 743,746 
>   {   /

Re: Patch 7.4.755

2015-06-25 Fir de Conversatie Ken Takata
Hi,

2015/6/26 Fri 7:29:52 UTC+9 h_east wrote:
> Thanks for include my patch!
> 
> But part of runtime/doc/eval.txt was missing.
> The following difference does not reflect.
> 
> > *** 5792,5806 
> > Text after the number is silently ignored.
> >   
> >   
> > ! strchars({expr})  *strchars()*
> > The result is a Number, which is the number of characters
> > !   String {expr} occupies.  Composing characters are counted
> > !   separately.
> > Also see |strlen()|, |strdisplaywidth()| and |strwidth()|.
> >   
> >   strdisplaywidth({expr}[, {col}])  *strdisplaywidth()*
> > The result is a Number, which is the number of display cells
> > !   String {expr} occupies on the screen.
> > When {col} is omitted zero is used.  Otherwise it is the
> > screen column where to start.  This matters for Tab
> > characters.
> > --- 5839,5855 
> > Text after the number is silently ignored.
> >   
> >   
> > ! strchars({expr} [, {skipcc}]) 
> > *strchars()*
> > The result is a Number, which is the number of characters
> > !   in String {expr}.
> > !   When {skipcc} is omitted or zero, composing characters are
> > !   counted separately.
> > !   When {skipcc} set to 1, Composing characters are ignored.
> > Also see |strlen()|, |strdisplaywidth()| and |strwidth()|.
> >   
> >   strdisplaywidth({expr}[, {col}])  *strdisplaywidth()*
> > The result is a Number, which is the number of display cells
> > !   String {expr} occupies on the screen when it starts a {col}.
> > When {col} is omitted zero is used.  Otherwise it is the
> > screen column where to start.  This matters for Tab
> > characters.
> > ***

How about mentioning backward compatibilites of the {skipcc} parameter?
E.g.

strchars({expr} [, {skipcc}])   *strchars()*
The result is a Number, which is the number of characters
in String {expr}.
When {skipcc} is omitted or zero, composing characters are
counted separately.
When {skipcc} set to 1, Composing characters are ignored.
Also see |strlen()|, |strdisplaywidth()| and |strwidth()|. 

{skipcc} is only available after 7.4.755.  For backward
compatibility, you can define a wrapper function: >

if has("patch-7.4.755")
function s:strchars(str, skipcc)
return strchars(a:str, a:skipcc)
endfunction
else
function s:strchars(str, skipcc)
if a:skipcc
return strlen(substitute(a:str, ".", "x", "g"))
else
return strchars(a:str)
endif
endfunction
endif
<


Regards,
Ken Takata

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

2015-06-25 Fir de Conversatie h_east
Hi Bram,

2015-6-25(Thu) 23:09:44 UTC+9 Bram Moolenaar:
> Patch 7.4.755
> Problem:It is not easy to count the number of characters.
> Solution:   Add the skipcc argument to strchars(). (Hirohito Higashi, Ken
> Takata)
> Files:  runtime/doc/eval.txt, src/eval.c, src/testdir/test_utf8.in,
> src/testdir/test_utf8.ok
> 
> 
> *** ../vim-7.4.754/runtime/doc/eval.txt   2015-03-20 17:36:38.618949214 
> +0100
> --- runtime/doc/eval.txt  2015-06-25 15:59:53.104434430 +0200
> ***
> *** 1984,1990 
>   sqrt( {expr})   Float   square root of {expr}
>   str2float( {expr})  Float   convert String to Float
>   str2nr( {expr} [, {base}])  Number  convert String to Number
> ! strchars( {expr})   Number  character length of the String {expr}
>   strdisplaywidth( {expr} [, {col}]) Number display length of the String 
> {expr}
>   strftime( {format}[, {time}])   String  time in specified format
>   stridx( {haystack}, {needle}[, {start}])
> --- 1985,1991 
>   sqrt( {expr})   Float   square root of {expr}
>   str2float( {expr})  Float   convert String to Float
>   str2nr( {expr} [, {base}])  Number  convert String to Number
> ! strchars( {expr} [, {skipcc}])  Number  character length of the String 
> {expr}
>   strdisplaywidth( {expr} [, {col}]) Number display length of the String 
> {expr}
>   strftime( {format}[, {time}])   String  time in specified format
>   stridx( {haystack}, {needle}[, {start}])
> ***
> *** 5792,5806 
>   Text after the number is silently ignored.
>   
>   
> ! strchars({expr})*strchars()*
>   The result is a Number, which is the number of characters
> ! String {expr} occupies.  Composing characters are counted
> ! separately.
>   Also see |strlen()|, |strdisplaywidth()| and |strwidth()|.
>   
>   strdisplaywidth({expr}[, {col}])*strdisplaywidth()*
>   The result is a Number, which is the number of display cells
> ! String {expr} occupies on the screen.
>   When {col} is omitted zero is used.  Otherwise it is the
>   screen column where to start.  This matters for Tab
>   characters.
> --- 5839,5855 
>   Text after the number is silently ignored.
>   
>   
> ! strchars({expr} [, {skipcc}])   
> *strchars()*
>   The result is a Number, which is the number of characters
> ! in String {expr}.
> ! When {skipcc} is omitted or zero, composing characters are
> ! counted separately.
> ! When {skipcc} set to 1, Composing characters are ignored.
>   Also see |strlen()|, |strdisplaywidth()| and |strwidth()|.
>   
>   strdisplaywidth({expr}[, {col}])*strdisplaywidth()*
>   The result is a Number, which is the number of display cells
> ! String {expr} occupies on the screen when it starts a {col}.
>   When {col} is omitted zero is used.  Otherwise it is the
>   screen column where to start.  This matters for Tab
>   characters.
> ***
> *** 5866,5880 
>   *strlen()*
>   strlen({expr})  The result is a Number, which is the length of the 
> String
>   {expr} in bytes.
> - If you want to count the number of multi-byte characters (not
> - counting composing characters) use something like this: >
> - 
> - :let len = strlen(substitute(str, ".", "x", "g"))
> - <
>   If the argument is a Number it is first converted to a String.
>   For other types an error is given.
> ! Also see |len()|, |strchars()|, |strdisplaywidth()| and
> ! |strwidth()|.
>   
>   strpart({src}, {start}[, {len}])*strpart()*
>   The result is a String, which is part of {src}, starting from
> --- 5915,5925 
>   *strlen()*
>   strlen({expr})  The result is a Number, which is the length of the 
> String
>   {expr} in bytes.
>   If the argument is a Number it is first converted to a String.
>   For other types an error is given.
> ! If you want to count the number of multi-byte characters use
> ! |strchars()|.
> ! Also see |len()|, |strdisplaywidth()| and |strwidth()|.
>   
>   strpart({src}, {start}[, {len}])*strpart()*
>   The result is a String, which is part of {src}, starting from
> *** ../vim-7.4.754/src/eval.c 2015-06-19 21:06:04.664521324 +0200
> --- src/eval.c2015-06-25 15:53:55.992189567 +0200
> ***
> *** 3810,3816 
>   /* (un)lock a Li

Re: [patch] Fix missing, unnecessary symbol lookups with lua >= 5.3

2015-06-25 Fir de Conversatie Pedro Ferrari
On Thursday, June 11, 2015 at 11:36:19 AM UTC-3, Felix S. wrote:
> Dear vim dev list,
> 
> With lua 5.3 symbols has changed. To make vim work with lua 5.3, I
> wrote a patch to remove unnecessary symbol lookups (namely lua_replace)
> and added new needed functions.
> 
> I briefly tested the patch with a few stupid lua commands and
> neocomplcache.
> 
> Regards
> 
> Felix

Thank you!!

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

2015-06-25 Fir de Conversatie Urtica dioica
2015年6月25日木曜日 12時53分53秒 UTC-6 Christian Brabandt:
> Thanks. I'll fix it.

Cool.

Here's another funny bug. I ^I's are all normal 8-space tabs:

a^I1
aa^I1
aa1
aa^I1
a^I1
--- $4j
a^I2
aa^I1
aa2
aa^I1
a^I2

Lines 2 and 4 visually align because of the tabs, but no incrementing occurs. 
Line 3 is not in the visual area, but has a number as the third character, so 
it gets incremented.

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

2015-06-25 Fir de Conversatie Christian Brabandt
Hi Ken!

On Do, 25 Jun 2015, Ken Takata wrote:

> Hi,
> 
> 2015/6/25 Thu 20:58:52 UTC+9 Bram Moolenaar wrote:
> > Patch 7.4.754
> > Problem:Using CTRL-A in Visual mode does not work well. (Gary Johnson)
> > Solution:   Make it increment all numbers in the Visual area. (Christian
> > Brabandt)
> > Files:  runtime/doc/change.txt, src/normal.c, src/ops.c,
> > src/proto/ops.pro, src/testdir/Make_amiga.mak,
> > src/testdir/Make_dos.mak, src/testdir/Make_ming.mak,
> > src/testdir/Make_os2.mak, src/testdir/Make_vms.mms,
> > src/testdir/Makefile, src/testdir/test_increment.in,
> > src/testdir/test_increment.ok
> 
> After this patch, CI on windows fails.
> https://ci.appveyor.com/project/k-takata/vim-ci/build/313#L1676

Thanks Ken, I'll fix it.


Best,
Christian
-- 
Wenn man eine Stadt wie Paris 92mal zusammensetzt, so kömmt eine Stadt wie 
Gotha heraus.
-- Johann Georg August Galletti

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

2015-06-25 Fir de Conversatie Christian Brabandt
Hi Urtica!

On Do, 25 Jun 2015, Urtica dioica wrote:
[many tests]

Thanks. I'll fix it.

Best,
Christian
-- 
Hallo Turnbeutelvergesser!

-- 
-- 
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] new optionset autocommand

2015-06-25 Fir de Conversatie Christian Brabandt
Hi Bram!

On Fr, 19 Jun 2015, Bram Moolenaar wrote:

> 
> Christian Brabandt wrote:
> 
> > here is a patch, that implements an OptionSet autocommand. This can be 
> > used, to execute certain actions when an option is set. The pattern is 
> > matched against the long option name, so one can react to specific 
> > options. E.g. Checking that the 'backupdir' directory exists and can be 
> > created if necessary. It therefore provides the new v:option_new, 
> > v:option_old and v:option_type so one can check the old and new value 
> > and one can also get the scope of the set command.
> > 
> > This still needs some work and I am also have to write some test for it, 
> > but I figured I ask, whether this feature would be interesting enough to 
> > be included, before I proceed with some more work on it.
> > 
> > This is also mentioned in the todo list
> > ,
> > | 7   Autocommand for when an option is changed.  Match buffer name or 
> > | option name?
> > `
> > 
> > Comments?
> 
> Although this can be useful, it can also cause lots of trouble.
> Perhaps a big warning in the documentation could be enough?
> It should at least mention ":noautocommand" to avoid triggering the
> autocommands when it's not wanted.

Done.

> Some options have a side effect, I suppose the autocommand would only be
> triggered after the side effect?

Yes and only, if not error occurred.

> And when I set several options with one :set command, will all the new
> values be set before the first autocommand is triggered, or will the
> second value be set after the first triggered?

The second.

Updated patch attached. Fixes some bugs, includes tests and has 
documentation updated. 

Best,
Christian
-- 
In Sachen Umweltschutz sind die meisten Regierungen kriminelle
Vereinigungen.
-- Oliver Hassencamp

-- 
-- 
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.
Add an autocommand when an option is set.

Includes test

# HG changeset patch
# Parent d80ec0e36fea8d583a79ff63000d89a2b5f3f380

diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -259,6 +259,7 @@ Nametriggered by ~
 |Syntax|   when the 'syntax' option has been set
 |EncodingChanged|  after the 'encoding' option has been changed
 |TermChanged|  after the value of 'term' has changed
+|OptionSet|after setting an option
 
Startup and exit
 |VimEnter| after doing all the startup stuff
@@ -742,6 +743,27 @@ MenuPopup  Just before showing the popu
o   Operator-pending
i   Insert
c   Command line
+   *OptionSet*
+OptionSet  After setting an option.  The pattern is
+   matched against the long option name.
+   The |v:option_old| variable indicates the
+   old option value, |v:option_new| variable
+   indicates the newly set value, the
+   |v:option_type| variable indicates whether
+   it's global or local scoped and ||
+   indicates what option has been set.
+
+   Is not triggered on startup and for the 'key'
+   option for obvious reasons.
+
+   Note: It's a bad idea, to reset an option
+   during this autocommand, since this will
+   probably break plugins. You can always use
+   |noa| to prevent triggering this autocommand.
+   Could be used, to check for existence of the
+   'backupdir' and 'undodir' options and create
+   directories, if they don't exist yet.
+
*QuickFixCmdPre*
 QuickFixCmdPre Before a quickfix command is run (|:make|,
|:lmake|, |:grep|, |:lgrep|, |:grepadd|,
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1527,6 +1527,15 @@ v:oldfiles   List of file names that is lo
than String this will cause trouble.
{only when compiled with the |

Re: Patch 7.4.754

2015-06-25 Fir de Conversatie Urtica dioica
Found another one. If the column we're adding to has a line that doesn't extend 
long enough, every line after that will be ignored.

Lines 1-2, 4-5 are indented. The middle line has no character in column 2. The 
middle line gets incremented despite not being in the visual area, while the 
lines below are ignored:

 1
 1
1
 1
 1
--- $G
 2
 2
2
 1
 1

It's also interesting how line visual works. It only applies to lines that 
start with a number:

1
--- >>V
1

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


Ctrl-X and negative numbers in visual mode

2015-06-25 Fir de Conversatie Marius Gedminas
Just built vim 7.5.754 to play with the new / in visual mode.
I observe something strange.  Given the following text in a buffer:

1. lalala

Pressing Ctrl-X twice while on the '1' changes it to '0' then '-1'.
However if I undo back to the original state, select the '1' in a visual
block with Ctrl-V, and then press Ctrl-X, gv, Ctrl-X, I get '0' and then
'1' again.  I would expect '0' and then '-1'.

The other experiment: yank the line and paste it 10 times:

1. lalala
1. lalala
1. lalala
1. lalala
1. lalala
1. lalala
1. lalala
1. lalala
1. lalala
1. lalala
1. lalala

Select a visual block to the end of the file (VG), press g Ctrl-X.  I get

1. lalala
0. lalala
18446744073709551615. lalala
18446744073709551614. lalala
18446744073709551613. lalala
18446744073709551612. lalala
18446744073709551611. lalala
18446744073709551610. lalala
18446744073709551609. lalala
18446744073709551608. lalala
18446744073709551607. lalala

I expected 1, 0, -1, -2, ...

Marius Gedminas
-- 
A: No.
Q: Should I include quotations after my reply?

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


signature.asc
Description: Digital signature


Re: Patch 7.4.757

2015-06-25 Fir de Conversatie Bram Moolenaar

Christ van Willegen wrote:

> On Thu, Jun 25, 2015 at 5:03 PM, Bram Moolenaar  wrote:
> > Patch 7.4.757
> > Problem:Cannot detect the background color of a terminal.
> > Solution:   Add T_RBG to request the background color if possible. (Lubomir
> > Rintel)
> > Files:  src/main.c, src/term.c, src/term.h, src/proto/term.pro
> > + #if defined(FEAT_TERMRESPONSE) || defined(PROTO)
> > + /*
> > +  * Check how the terminal treats ambiguous character width (UAX #11).
> > +  * First, we move the cursor to (1, 0) and print a test ambiguous 
> > character
> > +  * \u25bd (WHITE DOWN-POINTING TRIANGLE) and query current cursor 
> > position.
> > +  * If the terminal treats \u25bd as single width, the position is (1, 1),
> > +  * or if it is treated as double width, that will be (1, 2).
> > +  * This function has the side effect that changes cursor position, so
> > +  * it must be called immediately after entering termcap mode.
> > +  */
> > + void
> > + may_req_bg_color()
> > + {
> > + if (rbg_status == RBG_GET
> 
> That comment looks wrong for that function.

Right, somehow I missed that.

-- 
hundred-and-one symptoms of being an internet addict:
153. You find yourself staring at your "inbox" waiting for new e-mail
 to arrive.

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

2015-06-25 Fir de Conversatie Urtica dioica
I've only been playing with this for a few minutes, but there are lots of 
problems.

1. vg with :se nf=alpha doesn't do letters.

a
a
a
--- :se nf=alphaVGg
b
b
b

2. Minus signs are never added or removed.

0
--- V
1

Another:

-1
--- V3
-2

3. Even if multiple columns are selected, it acts on only one column. The 
column it selects can be unusual.

This makes sense:

0x9
0x9
0x9
--- 3$
0xa
0xa
0xa

This uses the same visual area, but with a different result:

0x9
0x9
0x9
--- $++
0x10
0x10
0x10

This increments a number that wasn't in the visual area:

0 0
0 0
0 0
--- $v++
0 1
0 1
0 1

4. If you dot repeat, you get an ordinary C-X/C-A.

0x0
0x0
--- $j10.
0x10
0x1a

Note that the cursor ends at the bottom-right, opposite of most visual mode 
commands. This makes useful dot repeats difficult.

5. Overflow.

1
1
1
--- VGg
0
18446744073709551615
18446744073709551614

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

2015-06-25 Fir de Conversatie Christ van Willegen
On Thu, Jun 25, 2015 at 5:03 PM, Bram Moolenaar  wrote:
> Patch 7.4.757
> Problem:Cannot detect the background color of a terminal.
> Solution:   Add T_RBG to request the background color if possible. (Lubomir
> Rintel)
> Files:  src/main.c, src/term.c, src/term.h, src/proto/term.pro
> + #if defined(FEAT_TERMRESPONSE) || defined(PROTO)
> + /*
> +  * Check how the terminal treats ambiguous character width (UAX #11).
> +  * First, we move the cursor to (1, 0) and print a test ambiguous character
> +  * \u25bd (WHITE DOWN-POINTING TRIANGLE) and query current cursor position.
> +  * If the terminal treats \u25bd as single width, the position is (1, 1),
> +  * or if it is treated as double width, that will be (1, 2).
> +  * This function has the side effect that changes cursor position, so
> +  * it must be called immediately after entering termcap mode.
> +  */
> + void
> + may_req_bg_color()
> + {
> + if (rbg_status == RBG_GET

That comment looks wrong for that function.

Christ van Willegen
-- 
09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0

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

2015-06-25 Fir de Conversatie Bram Moolenaar

Patch 7.4.761 (after 7.4.757)
Problem:The request-background termcode implementation is incomplete.
Solution:   Add the missing pieces.
Files:  src/option.c, src/term.c


*** ../vim-7.4.760/src/option.c 2015-06-20 15:29:57.202600053 +0200
--- src/option.c2015-06-25 19:16:40.602023280 +0200
***
*** 2953,2963 
  #ifdef FEAT_VERTSPLIT
  p_term("t_CV", T_CSV)
  #endif
- p_term("t_ut", T_UT)
  p_term("t_da", T_DA)
  p_term("t_db", T_DB)
  p_term("t_DL", T_CDL)
  p_term("t_dl", T_DL)
  p_term("t_fs", T_FS)
  p_term("t_IE", T_CIE)
  p_term("t_IS", T_CIS)
--- 2953,2963 
  #ifdef FEAT_VERTSPLIT
  p_term("t_CV", T_CSV)
  #endif
  p_term("t_da", T_DA)
  p_term("t_db", T_DB)
  p_term("t_DL", T_CDL)
  p_term("t_dl", T_DL)
+ p_term("t_EI", T_CEI)
  p_term("t_fs", T_FS)
  p_term("t_IE", T_CIE)
  p_term("t_IS", T_CIS)
***
*** 2971,2998 
  p_term("t_ms", T_MS)
  p_term("t_nd", T_ND)
  p_term("t_op", T_OP)
  p_term("t_RI", T_CRI)
  p_term("t_RV", T_CRV)
- p_term("t_u7", T_U7)
  p_term("t_Sb", T_CSB)
- p_term("t_Sf", T_CSF)
  p_term("t_se", T_SE)
  p_term("t_so", T_SO)
  p_term("t_sr", T_SR)
- p_term("t_ts", T_TS)
  p_term("t_te", T_TE)
  p_term("t_ti", T_TI)
  p_term("t_ue", T_UE)
  p_term("t_us", T_US)
  p_term("t_vb", T_VB)
  p_term("t_ve", T_VE)
  p_term("t_vi", T_VI)
  p_term("t_vs", T_VS)
  p_term("t_WP", T_CWP)
  p_term("t_WS", T_CWS)
- p_term("t_SI", T_CSI)
- p_term("t_EI", T_CEI)
- p_term("t_SR", T_CSR)
  p_term("t_xn", T_XN)
  p_term("t_xs", T_XS)
  p_term("t_ZH", T_CZH)
--- 2971,2999 
  p_term("t_ms", T_MS)
  p_term("t_nd", T_ND)
  p_term("t_op", T_OP)
+ p_term("t_RB", T_RBG)
  p_term("t_RI", T_CRI)
  p_term("t_RV", T_CRV)
  p_term("t_Sb", T_CSB)
  p_term("t_se", T_SE)
+ p_term("t_Sf", T_CSF)
+ p_term("t_SI", T_CSI)
  p_term("t_so", T_SO)
+ p_term("t_SR", T_CSR)
  p_term("t_sr", T_SR)
  p_term("t_te", T_TE)
  p_term("t_ti", T_TI)
+ p_term("t_ts", T_TS)
+ p_term("t_u7", T_U7)
  p_term("t_ue", T_UE)
  p_term("t_us", T_US)
+ p_term("t_ut", T_UT)
  p_term("t_vb", T_VB)
  p_term("t_ve", T_VE)
  p_term("t_vi", T_VI)
  p_term("t_vs", T_VS)
  p_term("t_WP", T_CWP)
  p_term("t_WS", T_CWS)
  p_term("t_xn", T_XN)
  p_term("t_xs", T_XS)
  p_term("t_ZH", T_CZH)
*** ../vim-7.4.760/src/term.c   2015-06-25 17:03:32.580666257 +0200
--- src/term.c  2015-06-25 19:12:02.025021491 +0200
***
*** 1622,1628 
{KS_TS, "ts"}, {KS_FS, "fs"},
{KS_CWP, "WP"}, {KS_CWS, "WS"},
{KS_CSI, "SI"}, {KS_CEI, "EI"},
!   {KS_U7, "u7"},
{(enum SpecialKey)0, NULL}
};
  
--- 1622,1628 
{KS_TS, "ts"}, {KS_FS, "fs"},
{KS_CWP, "WP"}, {KS_CWS, "WS"},
{KS_CSI, "SI"}, {KS_CEI, "EI"},
!   {KS_U7, "u7"}, {KS_RBG, "RB"},
{(enum SpecialKey)0, NULL}
};
  
*** ../vim-7.4.760/src/version.c2015-06-25 18:36:20.511463791 +0200
--- src/version.c   2015-06-25 19:13:01.972375858 +0200
***
*** 743,744 
--- 743,746 
  {   /* Add new patch number below this line */
+ /**/
+ 761,
  /**/

-- 
Although the scythe isn't pre-eminent among the weapons of war, anyone who
has been on the wrong end of, say, a peasants' revolt will know that in
skilled hands it is fearsome.
-- (Terry Pratchett, Mort)

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

2015-06-25 Fir de Conversatie Bram Moolenaar

Kent Sibilev wrote:

> On Thursday, June 25, 2015 at 12:20:57 PM UTC-4, Kent Sibilev wrote:
> > This patch crashes vim for me when I'm starting it from tmux:
> > 
> > $ lldb vim
> > (lldb) target create "vim"
> > Current executable set to 'vim' (x86_64).
> > (lldb) run
> > Process 16364 launched: '/usr/local/bin/vim' (x86_64)
> > Process 16364 stopped
> > * thread #1: tid = 0x4f71ea, 0x000100193d13 vim`may_req_bg_color + 99 
> > at term.c:3429, queue = 'com.apple.main-thread', stop reason = 
> > EXC_BAD_ACCESS (code=1, address=0x0)
> > frame #0: 0x000100193d13 vim`may_req_bg_color + 99 at term.c:3429
> >3426 && p_ek
> >3427 #  ifdef UNIX
> >3428 && isatty(1)
> > -> 3429 && isatty(read_cmd_fd)
> >3430 #  endif
> >3431 && *T_RBG != NUL
> >3432 && !option_was_set((char_u *)"bg"))
> > (lldb)
> > 
> > 
> > Kent.
> 
> This diff fixes the crash, but i'm not sure it is correct way to fix the 
> problem:
> 
> diff --git a/src/term.c b/src/term.c
> index 0d684e0..9dace0b 100644
> --- a/src/term.c
> +++ b/src/term.c
> @@ -3428,7 +3428,7 @@ may_req_bg_color()
> && isatty(1)
> && isatty(read_cmd_fd)
>  #  endif
> -   && *T_RBG != NUL
> +   && T_RBG != NUL && *T_RBG != NUL
> && !option_was_set((char_u *)"bg"))
>  {
> LOG_TR("Sending BG request");

Thanks for reporting this.  No, this is not the right solution.
An entry for T_RBG is missing in options.c.  I'll make a patch.

-- 
hundred-and-one symptoms of being an internet addict:
152. You find yourself falling for someone you've never seen or hardly
 know, but, boy can he/she TYPE!!

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

2015-06-25 Fir de Conversatie Kent Sibilev
On Thursday, June 25, 2015 at 12:20:57 PM UTC-4, Kent Sibilev wrote:
> This patch crashes vim for me when I'm starting it from tmux:
> 
> $ lldb vim
> (lldb) target create "vim"
> Current executable set to 'vim' (x86_64).
> (lldb) run
> Process 16364 launched: '/usr/local/bin/vim' (x86_64)
> Process 16364 stopped
> * thread #1: tid = 0x4f71ea, 0x000100193d13 vim`may_req_bg_color + 99 at 
> term.c:3429, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS 
> (code=1, address=0x0)
> frame #0: 0x000100193d13 vim`may_req_bg_color + 99 at term.c:3429
>3426 && p_ek
>3427 #  ifdef UNIX
>3428 && isatty(1)
> -> 3429 && isatty(read_cmd_fd)
>3430 #  endif
>3431 && *T_RBG != NUL
>3432 && !option_was_set((char_u *)"bg"))
> (lldb)
> 
> 
> Kent.

This diff fixes the crash, but i'm not sure it is correct way to fix the 
problem:

diff --git a/src/term.c b/src/term.c
index 0d684e0..9dace0b 100644
--- a/src/term.c
+++ b/src/term.c
@@ -3428,7 +3428,7 @@ may_req_bg_color()
&& isatty(1)
&& isatty(read_cmd_fd)
 #  endif
-   && *T_RBG != NUL
+   && T_RBG != NUL && *T_RBG != NUL
&& !option_was_set((char_u *)"bg"))
 {
LOG_TR("Sending BG request");

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

2015-06-25 Fir de Conversatie Bram Moolenaar

Patch 7.4.760
Problem:Spelling mistakes are not displayed after ":syn spell".
Solution:   Force a redraw after ":syn spell" command. (Christian Brabandt)
Files:  src/syntax.c


*** ../vim-7.4.759/src/syntax.c 2015-03-21 21:46:07.562423678 +0100
--- src/syntax.c2015-06-25 18:35:12.860164934 +0200
***
*** 3469,3475 
--- 3469,3481 
  else if (STRNICMP(arg, "default", 7) == 0 && next - arg == 7)
curwin->w_s->b_syn_spell = SYNSPL_DEFAULT;
  else
+ {
EMSG2(_("E390: Illegal argument: %s"), arg);
+   return;
+ }
+ 
+ /* assume spell checking changed, force a redraw */
+ redraw_win_later(curwin, NOT_VALID);
  }
  
  /*
*** ../vim-7.4.759/src/version.c2015-06-25 18:27:27.312991420 +0200
--- src/version.c   2015-06-25 18:31:07.810705103 +0200
***
*** 743,744 
--- 743,746 
  {   /* Add new patch number below this line */
+ /**/
+ 760,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
151. You find yourself engaged to someone you've never actually met,
 except through e-mail.

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

2015-06-25 Fir de Conversatie Bram Moolenaar

Patch 7.4.759
Problem:Building with Lua 5.3 doesn't work, symbols have changed.
Solution:   Use the new names for the new version. (Felix Schnizlein)
Files:  src/if_lua.c


*** ../vim-7.4.758/src/if_lua.c 2015-02-17 16:28:51.365508352 +0100
--- src/if_lua.c2015-06-25 18:24:28.026834336 +0200
***
*** 111,117 
--- 111,122 
  #define lua_tointeger dll_lua_tointeger
  #define lua_call dll_lua_call
  #define lua_pcall dll_lua_pcall
+ 
+ #elif LUA_VERSION_NUM <= 502
+ #define lua_replace dll_lua_replace
+ #define lua_remove dll_lua_remove
  #else
+ #define lua_rotate dll_lua_rotate
  #define lua_tonumberx dll_lua_tonumberx
  #define lua_tointegerx dll_lua_tointegerx
  #define lua_callk dll_lua_callk
***
*** 124,131 
  #define lua_gettop dll_lua_gettop
  #define lua_settop dll_lua_settop
  #define lua_pushvalue dll_lua_pushvalue
! #define lua_replace dll_lua_replace
! #define lua_remove dll_lua_remove
  #define lua_isnumber dll_lua_isnumber
  #define lua_isstring dll_lua_isstring
  #define lua_type dll_lua_type
--- 129,135 
  #define lua_gettop dll_lua_gettop
  #define lua_settop dll_lua_settop
  #define lua_pushvalue dll_lua_pushvalue
! #define lua_copy dll_lua_copy
  #define lua_isnumber dll_lua_isnumber
  #define lua_isstring dll_lua_isstring
  #define lua_type dll_lua_type
***
*** 195,201 
--- 199,210 
  lua_Integer (*dll_lua_tointeger) (lua_State *L, int idx);
  void (*dll_lua_call) (lua_State *L, int nargs, int nresults);
  int (*dll_lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc);
+ #elif LUA_VERSION_NUM <= 502
+ void (*dll_lua_replace) (lua_State *L, int idx);
+ void (*dll_lua_remove) (lua_State *L, int idx);
  #else
+ 
+ void  (*dll_lua_rotate) (lua_State *L, int idx, int n);
  lua_Number (*dll_lua_tonumberx) (lua_State *L, int idx, int *isnum);
  lua_Integer (*dll_lua_tointegerx) (lua_State *L, int idx, int *isnum);
  void (*dll_lua_callk) (lua_State *L, int nargs, int nresults, int ctx,
***
*** 204,217 
int ctx, lua_CFunction k);
  void (*dll_lua_getglobal) (lua_State *L, const char *var);
  void (*dll_lua_setglobal) (lua_State *L, const char *var);
  #endif
  const char *(*dll_lua_typename) (lua_State *L, int tp);
  void   (*dll_lua_close) (lua_State *L);
  int (*dll_lua_gettop) (lua_State *L);
  void (*dll_lua_settop) (lua_State *L, int idx);
  void (*dll_lua_pushvalue) (lua_State *L, int idx);
- void (*dll_lua_replace) (lua_State *L, int idx);
- void (*dll_lua_remove) (lua_State *L, int idx);
  int (*dll_lua_isnumber) (lua_State *L, int idx);
  int (*dll_lua_isstring) (lua_State *L, int idx);
  int (*dll_lua_type) (lua_State *L, int idx);
--- 213,225 
int ctx, lua_CFunction k);
  void (*dll_lua_getglobal) (lua_State *L, const char *var);
  void (*dll_lua_setglobal) (lua_State *L, const char *var);
+ void (*dll_lua_copy) (lua_State *L, int fromidx, int toidx);
  #endif
  const char *(*dll_lua_typename) (lua_State *L, int tp);
  void   (*dll_lua_close) (lua_State *L);
  int (*dll_lua_gettop) (lua_State *L);
  void (*dll_lua_settop) (lua_State *L, int idx);
  void (*dll_lua_pushvalue) (lua_State *L, int idx);
  int (*dll_lua_isnumber) (lua_State *L, int idx);
  int (*dll_lua_isstring) (lua_State *L, int idx);
  int (*dll_lua_type) (lua_State *L, int idx);
***
*** 288,294 
--- 296,307 
  {"lua_tointeger", (luaV_function) &dll_lua_tointeger},
  {"lua_call", (luaV_function) &dll_lua_call},
  {"lua_pcall", (luaV_function) &dll_lua_pcall},
+ #elif LUA_VERSION_NUM <= 502
+ {"lua_replace", (luaV_function) &dll_lua_replace},
+ {"lua_remove", (luaV_function) &dll_lua_remove},
  #else
+ {"lua_rotate", (luaV_function) &dll_lua_rotate},
+ {"lua_copy", (luaV_function) &dll_lua_copy},
  {"lua_tonumberx", (luaV_function) &dll_lua_tonumberx},
  {"lua_tointegerx", (luaV_function) &dll_lua_tointegerx},
  {"lua_callk", (luaV_function) &dll_lua_callk},
***
*** 301,308 
  {"lua_gettop", (luaV_function) &dll_lua_gettop},
  {"lua_settop", (luaV_function) &dll_lua_settop},
  {"lua_pushvalue", (luaV_function) &dll_lua_pushvalue},
- {"lua_replace", (luaV_function) &dll_lua_replace},
- {"lua_remove", (luaV_function) &dll_lua_remove},
  {"lua_isnumber", (luaV_function) &dll_lua_isnumber},
  {"lua_isstring", (luaV_function) &dll_lua_isstring},
  {"lua_type", (luaV_function) &dll_lua_type},
--- 314,319 
*** ../vim-7.4.758/src/version.c2015-06-25 18:20:30.437271806 +0200
--- src/version.c   2015-06-25 18:25:17.978321826 +0200
***
*** 743,744 
--- 743,746 
  {   /* Add new patch number below this line */
+ /**/
+ 759,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
150. You find yourself counting emoticons to get to sleep.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for featu

Patch 7.4.758

2015-06-25 Fir de Conversatie Bram Moolenaar

Patch 7.4.758
Problem:When 'conceallevel' is 1 and quitting the command-line window with
CTRL-C the first character ':' is erased.
Solution:   Reset 'conceallevel' in the command-line window. (Hirohito
Higashi)
Files:  src/ex_getln.c


*** ../vim-7.4.757/src/ex_getln.c   2015-04-03 17:06:21.744398370 +0200
--- src/ex_getln.c  2015-06-25 18:18:53.118270102 +0200
***
*** 6611,6616 
--- 6611,6620 
/* Don't execute autocommands while deleting the window. */
block_autocmds();
  # endif
+ # ifdef FEAT_CONCEAL
+   /* Avoid command-line window first character being concealed. */
+   curwin->w_p_cole = 0;
+ # endif
wp = curwin;
bp = curbuf;
win_goto(old_curwin);
*** ../vim-7.4.757/src/version.c2015-06-25 17:03:32.584666216 +0200
--- src/version.c   2015-06-25 18:17:36.035060772 +0200
***
*** 743,744 
--- 743,746 
  {   /* Add new patch number below this line */
+ /**/
+ 758,
  /**/

-- 
You are not really successful until someone claims he sat
beside you in school.

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

2015-06-25 Fir de Conversatie Kent Sibilev
This patch crashes vim for me when I'm starting it from tmux:

$ lldb vim
(lldb) target create "vim"
Current executable set to 'vim' (x86_64).
(lldb) run
Process 16364 launched: '/usr/local/bin/vim' (x86_64)
Process 16364 stopped
* thread #1: tid = 0x4f71ea, 0x000100193d13 vim`may_req_bg_color + 99 at 
term.c:3429, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS 
(code=1, address=0x0)
frame #0: 0x000100193d13 vim`may_req_bg_color + 99 at term.c:3429
   3426 && p_ek
   3427 #  ifdef UNIX
   3428 && isatty(1)
-> 3429 && isatty(read_cmd_fd)
   3430 #  endif
   3431 && *T_RBG != NUL
   3432 && !option_was_set((char_u *)"bg"))
(lldb)


Kent.

On Thursday, June 25, 2015 at 11:03:57 AM UTC-4, Bram Moolenaar wrote:
> Patch 7.4.757
> Problem:Cannot detect the background color of a terminal.
> Solution:   Add T_RBG to request the background color if possible. (Lubomir
> Rintel)
> Files:  src/main.c, src/term.c, src/term.h, src/proto/term.pro
> 
> 
> *** ../vim-7.4.756/src/main.c 2015-04-17 22:08:10.998772925 +0200
> --- src/main.c2015-06-25 17:01:47.917747345 +0200
> ***
> *** 837,844 
>   
>   starttermcap(); /* start termcap if not done by wait_return() */
>   TIME_MSG("start termcap");
> ! #if defined(FEAT_TERMRESPONSE) && defined(FEAT_MBYTE)
>   may_req_ambiguous_char_width();
>   #endif
>   
>   #ifdef FEAT_MOUSE
> --- 837,847 
>   
>   starttermcap(); /* start termcap if not done by wait_return() */
>   TIME_MSG("start termcap");
> ! #if defined(FEAT_TERMRESPONSE)
> ! # if defined(FEAT_MBYTE)
>   may_req_ambiguous_char_width();
> + # endif
> + may_req_bg_color();
>   #endif
>   
>   #ifdef FEAT_MOUSE
> *** ../vim-7.4.756/src/term.c 2015-03-31 18:30:09.139370916 +0200
> --- src/term.c2015-06-25 16:52:59.359131386 +0200
> ***
> *** 124,129 
> --- 124,134 
>   #  define U7_SENT   2   /* did send T_U7, waiting for answer */
>   #  define U7_GOT3   /* received T_U7 response */
>   static int u7_status = U7_GET;
> + /* Request background color report: */
> + #  define RBG_GET   1   /* send T_RBG when switched to RAW mode */
> + #  define RBG_SENT  2   /* did send T_RBG, waiting for answer */
> + #  define RBG_GOT   3   /* received T_RBG response */
> + static int rbg_status = RBG_GET;
>   # endif
>   
>   /*
> ***
> *** 949,954 
> --- 954,960 
>   {(int)KS_CWP,   IF_EB("\033[3;%d;%dt", ESC_STR "[3;%d;%dt")},
>   #  endif
>   {(int)KS_CRV,   IF_EB("\033[>c", ESC_STR "[>c")},
> + {(int)KS_RBG,   IF_EB("\033]11;?\007", ESC_STR "]11;?\007")},
>   {(int)KS_U7,IF_EB("\033[6n", ESC_STR "[6n")},
>   
>   {K_UP,  IF_EB("\033O*A", ESC_STR "O*A")},
> ***
> *** 1240,1245 
> --- 1246,1252 
>   #  endif
>   {(int)KS_CRV,   "[CRV]"},
>   {(int)KS_U7,"[U7]"},
> + {(int)KS_RBG,   "[RBG]"},
>   {K_UP,  "[KU]"},
>   {K_DOWN,"[KD]"},
>   {K_LEFT,"[KL]"},
> ***
> *** 3224,3230 
>* doesn't work in Cooked mode, an external program may get
>* them. */
>   if (tmode != TMODE_RAW && (crv_status == CRV_SENT
> !  || u7_status == U7_SENT))
>   (void)vpeekc_nomap();
>   check_for_codes_from_term();
>   }
> --- 3231,3238 
>* doesn't work in Cooked mode, an external program may get
>* them. */
>   if (tmode != TMODE_RAW && (crv_status == CRV_SENT
> !  || u7_status == U7_SENT
> !  || rbg_status == RBG_SENT))
>   (void)vpeekc_nomap();
>   check_for_codes_from_term();
>   }
> ***
> *** 3285,3292 
>   if (!gui.in_use && !gui.starting)
>   # endif
>   {
> ! /* May need to discard T_CRV or T_U7 response. */
> ! if (crv_status == CRV_SENT || u7_status == U7_SENT)
>   {
>   # ifdef UNIX
>   /* Give the terminal a chance to respond. */
> --- 3293,3301 
>   if (!gui.in_use && !gui.starting)
>   # endif
>   {
> ! /* May need to discard T_CRV, T_U7 or T_RBG response. */
> ! if (crv_status == CRV_SENT || u7_status == U7_SENT
> !  || rbg_status == RBG_SENT)
>   {
>   # ifdef UNIX
>   /* Give the terminal a chance to respond. */
> ***
> *** 3398,3403 
> --- 3407,3447 
>   }
>   # endif
>   
> + #if defined(FEAT_TERMRESPONSE) || defined(PROTO)
> + /*
> +  * Check how the terminal treats ambiguous character width (UAX #11).
> +  * First, we move the cursor to (1, 0) and print a test ambiguous character
> +  * \u25bd (WHITE DOWN-POINTING TRIANGLE) and que

Re: Patch 7.4.757

2015-06-25 Fir de Conversatie Bram Moolenaar

Note that I changed the original patch from Lubomir, but was unable to
test it on a terminal that returns the special escape sequence.
Lubomir, please check that it actually works.


-- 
hundred-and-one symptoms of being an internet addict:
149. You find your computer sexier than your girlfriend

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

2015-06-25 Fir de Conversatie Bram Moolenaar

Ken Takata wrote:

> 2015/6/25 Thu 20:58:52 UTC+9 Bram Moolenaar wrote:
> > Patch 7.4.754
> > Problem:Using CTRL-A in Visual mode does not work well. (Gary Johnson)
> > Solution:   Make it increment all numbers in the Visual area. (Christian
> > Brabandt)
> > Files:  runtime/doc/change.txt, src/normal.c, src/ops.c,
> > src/proto/ops.pro, src/testdir/Make_amiga.mak,
> > src/testdir/Make_dos.mak, src/testdir/Make_ming.mak,
> > src/testdir/Make_os2.mak, src/testdir/Make_vms.mms,
> > src/testdir/Makefile, src/testdir/test_increment.in,
> > src/testdir/test_increment.ok
> 
> After this patch, CI on windows fails.
> https://ci.appveyor.com/project/k-takata/vim-ci/build/313#L1676
> 
> 9,10c9,12
> < foobar
> < foobar-
> ---
> > foobar-11
> > foobar-9
> > 
> > 
> 23a26,29
> > 9
> > 19
> > 29
> > 39

It works fine on Linux, what could be different on MS-Windows?

-- 
hundred-and-one symptoms of being an internet addict:
148. You find it easier to dial-up the National Weather Service
 Weather/your_town/now.html than to simply look out the window.

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

2015-06-25 Fir de Conversatie Bram Moolenaar

Ben Fritz wrote:

> > + For decimals a leading negative sign is considered for incrementing/ 
> > + decrementing, for octal and hey values, it won't be considered.
> 
> Should be "for octal and hex values".
> 
> Also, probably it is useful to mention explicitly:
> 
> "To avoid considering the negative sign, visually select only the part
> of the number you wish to increment/decrement."

Thanks, I'll update the help.

-- 
hundred-and-one symptoms of being an internet addict:
147. You finally give up smoking...because it made the monitor dirty.

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

2015-06-25 Fir de Conversatie Ken Takata
Hi,

2015/6/25 Thu 20:58:52 UTC+9 Bram Moolenaar wrote:
> Patch 7.4.754
> Problem:Using CTRL-A in Visual mode does not work well. (Gary Johnson)
> Solution:   Make it increment all numbers in the Visual area. (Christian
> Brabandt)
> Files:  runtime/doc/change.txt, src/normal.c, src/ops.c,
> src/proto/ops.pro, src/testdir/Make_amiga.mak,
> src/testdir/Make_dos.mak, src/testdir/Make_ming.mak,
> src/testdir/Make_os2.mak, src/testdir/Make_vms.mms,
> src/testdir/Makefile, src/testdir/test_increment.in,
> src/testdir/test_increment.ok

After this patch, CI on windows fails.
https://ci.appveyor.com/project/k-takata/vim-ci/build/313#L1676

9,10c9,12
< foobar
< foobar-
---
> foobar-11
> foobar-9
> 
> 
23a26,29
> 9
> 19
> 29
> 39


Regards,
Ken Takata

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

2015-06-25 Fir de Conversatie Ben Fritz
> + For decimals a leading negative sign is considered for incrementing/ 
> + decrementing, for octal and hey values, it won't be considered.

Should be "for octal and hex values".

Also, probably it is useful to mention explicitly:

"To avoid considering the negative sign, visually select only the part of the 
number you wish to increment/decrement."

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

2015-06-25 Fir de Conversatie Bram Moolenaar

Patch 7.4.757
Problem:Cannot detect the background color of a terminal.
Solution:   Add T_RBG to request the background color if possible. (Lubomir
Rintel)
Files:  src/main.c, src/term.c, src/term.h, src/proto/term.pro


*** ../vim-7.4.756/src/main.c   2015-04-17 22:08:10.998772925 +0200
--- src/main.c  2015-06-25 17:01:47.917747345 +0200
***
*** 837,844 
  
  starttermcap();   /* start termcap if not done by wait_return() */
  TIME_MSG("start termcap");
! #if defined(FEAT_TERMRESPONSE) && defined(FEAT_MBYTE)
  may_req_ambiguous_char_width();
  #endif
  
  #ifdef FEAT_MOUSE
--- 837,847 
  
  starttermcap();   /* start termcap if not done by wait_return() */
  TIME_MSG("start termcap");
! #if defined(FEAT_TERMRESPONSE)
! # if defined(FEAT_MBYTE)
  may_req_ambiguous_char_width();
+ # endif
+ may_req_bg_color();
  #endif
  
  #ifdef FEAT_MOUSE
*** ../vim-7.4.756/src/term.c   2015-03-31 18:30:09.139370916 +0200
--- src/term.c  2015-06-25 16:52:59.359131386 +0200
***
*** 124,129 
--- 124,134 
  #  define U7_SENT 2   /* did send T_U7, waiting for answer */
  #  define U7_GOT  3   /* received T_U7 response */
  static int u7_status = U7_GET;
+ /* Request background color report: */
+ #  define RBG_GET 1   /* send T_RBG when switched to RAW mode */
+ #  define RBG_SENT2   /* did send T_RBG, waiting for answer */
+ #  define RBG_GOT 3   /* received T_RBG response */
+ static int rbg_status = RBG_GET;
  # endif
  
  /*
***
*** 949,954 
--- 954,960 
  {(int)KS_CWP, IF_EB("\033[3;%d;%dt", ESC_STR "[3;%d;%dt")},
  #  endif
  {(int)KS_CRV, IF_EB("\033[>c", ESC_STR "[>c")},
+ {(int)KS_RBG, IF_EB("\033]11;?\007", ESC_STR "]11;?\007")},
  {(int)KS_U7,  IF_EB("\033[6n", ESC_STR "[6n")},
  
  {K_UP,IF_EB("\033O*A", ESC_STR "O*A")},
***
*** 1240,1245 
--- 1246,1252 
  #  endif
  {(int)KS_CRV, "[CRV]"},
  {(int)KS_U7,  "[U7]"},
+ {(int)KS_RBG, "[RBG]"},
  {K_UP,"[KU]"},
  {K_DOWN,  "[KD]"},
  {K_LEFT,  "[KL]"},
***
*** 3224,3230 
 * doesn't work in Cooked mode, an external program may get
 * them. */
if (tmode != TMODE_RAW && (crv_status == CRV_SENT
!|| u7_status == U7_SENT))
(void)vpeekc_nomap();
check_for_codes_from_term();
}
--- 3231,3238 
 * doesn't work in Cooked mode, an external program may get
 * them. */
if (tmode != TMODE_RAW && (crv_status == CRV_SENT
!|| u7_status == U7_SENT
!|| rbg_status == RBG_SENT))
(void)vpeekc_nomap();
check_for_codes_from_term();
}
***
*** 3285,3292 
if (!gui.in_use && !gui.starting)
  # endif
{
!   /* May need to discard T_CRV or T_U7 response. */
!   if (crv_status == CRV_SENT || u7_status == U7_SENT)
{
  # ifdef UNIX
/* Give the terminal a chance to respond. */
--- 3293,3301 
if (!gui.in_use && !gui.starting)
  # endif
{
!   /* May need to discard T_CRV, T_U7 or T_RBG response. */
!   if (crv_status == CRV_SENT || u7_status == U7_SENT
!|| rbg_status == RBG_SENT)
{
  # ifdef UNIX
/* Give the terminal a chance to respond. */
***
*** 3398,3403 
--- 3407,3447 
  }
  # endif
  
+ #if defined(FEAT_TERMRESPONSE) || defined(PROTO)
+ /*
+  * Check how the terminal treats ambiguous character width (UAX #11).
+  * First, we move the cursor to (1, 0) and print a test ambiguous character
+  * \u25bd (WHITE DOWN-POINTING TRIANGLE) and query current cursor position.
+  * If the terminal treats \u25bd as single width, the position is (1, 1),
+  * or if it is treated as double width, that will be (1, 2).
+  * This function has the side effect that changes cursor position, so
+  * it must be called immediately after entering termcap mode.
+  */
+ void
+ may_req_bg_color()
+ {
+ if (rbg_status == RBG_GET
+   && cur_tmode == TMODE_RAW
+   && termcap_active
+   && p_ek
+ #  ifdef UNIX
+   && isatty(1)
+   && isatty(read_cmd_fd)
+ #  endif
+   && *T_RBG != NUL
+   && !option_was_set((char_u *)"bg"))
+ {
+   LOG_TR("Sending BG request");
+   out_str(T_RBG);
+   rbg_status = RBG_SENT;
+   /* check for the characters now, otherwise they might be eaten by
+* get_keystroke() */
+   out_flush();
+   (void)vpeekc_nomap();
+ }
+ }
+ # endif
+ 
  # ifdef DEBUG_TERMRESPONSE
  static void
  log_tr(

Patch 7.4.756

2015-06-25 Fir de Conversatie Bram Moolenaar

Patch 7.4.756
Problem:Can't use strawberry Perl 5.22 x64 on MS-Windows.
Solution:   Add new defines and #if. (Ken Takata)
Files:  src/Make_cyg_ming.mak, src/Make_mvc.mak, src/if_perl.xs


*** ../vim-7.4.755/src/Make_cyg_ming.mak2014-12-13 20:50:01.793994592 
+0100
--- src/Make_cyg_ming.mak   2015-06-25 16:11:38.321009757 +0200
***
*** 397,403 
  endif
  
  ifdef PERL
! CFLAGS += -I$(PERLLIBS) -DFEAT_PERL
  ifeq (yes, $(DYNAMIC_PERL))
  CFLAGS += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
  EXTRA_LIBS += -L$(PERLLIBS) -lperl$(PERL_VER)
--- 397,403 
  endif
  
  ifdef PERL
! CFLAGS += -I$(PERLLIBS) -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT 
-DPERL_IMPLICIT_SYS
  ifeq (yes, $(DYNAMIC_PERL))
  CFLAGS += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
  EXTRA_LIBS += -L$(PERLLIBS) -lperl$(PERL_VER)
*** ../vim-7.4.755/src/Make_mvc.mak 2015-05-06 11:33:37.168517956 +0200
--- src/Make_mvc.mak2015-06-25 16:11:38.325009715 +0200
***
*** 874,880 
  !endif
  !endif
  
! CFLAGS = $(CFLAGS) -DFEAT_PERL
  
  # Do we want to load Perl dynamically?
  !if "$(DYNAMIC_PERL)" == "yes"
--- 874,880 
  !endif
  !endif
  
! CFLAGS = $(CFLAGS) -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
  
  # Do we want to load Perl dynamically?
  !if "$(DYNAMIC_PERL)" == "yes"
*** ../vim-7.4.755/src/if_perl.xs   2014-06-12 16:03:24.268046589 +0200
--- src/if_perl.xs  2015-06-25 16:11:38.325009715 +0200
***
*** 197,206 
  # define Perl_stack_grow dll_Perl_stack_grow
  # define Perl_set_context dll_Perl_set_context
  # if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
! # define Perl_sv_2bool_flags dll_Perl_sv_2bool_flags
! # define Perl_xs_apiversion_bootcheck dll_Perl_xs_apiversion_bootcheck
  # else
! # define Perl_sv_2bool dll_Perl_sv_2bool
  # endif
  # define Perl_sv_2iv dll_Perl_sv_2iv
  # define Perl_sv_2mortal dll_Perl_sv_2mortal
--- 197,208 
  # define Perl_stack_grow dll_Perl_stack_grow
  # define Perl_set_context dll_Perl_set_context
  # if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
! #  define Perl_sv_2bool_flags dll_Perl_sv_2bool_flags
! #  if (PERL_REVISION == 5) && (PERL_VERSION < 22)
! #   define Perl_xs_apiversion_bootcheck dll_Perl_xs_apiversion_bootcheck
! #  endif
  # else
! #  define Perl_sv_2bool dll_Perl_sv_2bool
  # endif
  # define Perl_sv_2iv dll_Perl_sv_2iv
  # define Perl_sv_2mortal dll_Perl_sv_2mortal
***
*** 268,273 
--- 270,279 
  # define Perl_call_list dll_Perl_call_list
  # define Perl_Iscopestack_ix_ptr dll_Perl_Iscopestack_ix_ptr
  # define Perl_Iunitcheckav_ptr dll_Perl_Iunitcheckav_ptr
+ # if (PERL_REVISION == 5) && (PERL_VERSION >= 22)
+ #  define Perl_xs_handshake dll_Perl_xs_handshake
+ #  define Perl_xs_boot_epilog dll_Perl_xs_boot_epilog
+ # endif
  # if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
  #  ifdef USE_ITHREADS
  #   define PL_thr_key *dll_PL_thr_key
***
*** 299,305 
--- 305,315 
  static I32 (*Perl_dowantarray)(pTHX);
  static void (*Perl_free_tmps)(pTHX);
  static HV* (*Perl_gv_stashpv)(pTHX_ const char*, I32);
+ #if (PERL_REVISION == 5) && (PERL_VERSION >= 22)
+ static I32* (*Perl_markstack_grow)(pTHX);
+ #else
  static void (*Perl_markstack_grow)(pTHX);
+ #endif
  static MAGIC* (*Perl_mg_find)(pTHX_ SV*, int);
  static CV* (*Perl_newXS)(pTHX_ char*, XSUBADDR_t, char*);
  static SV* (*Perl_newSV)(pTHX_ STRLEN);
***
*** 321,327 
--- 331,339 
  static SV** (*Perl_set_context)(void*);
  #if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
  static bool (*Perl_sv_2bool_flags)(pTHX_ SV*, I32);
+ # if (PERL_REVISION == 5) && (PERL_VERSION < 22)
  static void (*Perl_xs_apiversion_bootcheck)(pTHX_ SV *module, const char 
*api_p, STRLEN api_len);
+ # endif
  #else
  static bool (*Perl_sv_2bool)(pTHX_ SV*);
  #endif
***
*** 394,399 
--- 406,415 
  static AV** (*Perl_Iunitcheckav_ptr)(register PerlInterpreter*);
  # endif
  #endif
+ #if (PERL_REVISION == 5) && (PERL_VERSION >= 22)
+ static I32 (*Perl_xs_handshake)(const U32, void *, const char *, ...);
+ static void (*Perl_xs_boot_epilog)(pTHX_ const U32);
+ #endif
  
  #if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
  # ifdef USE_ITHREADS
***
*** 453,459 
--- 469,477 
  {"Perl_set_context", (PERL_PROC*)&Perl_set_context},
  #if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
  {"Perl_sv_2bool_flags", (PERL_PROC*)&Perl_sv_2bool_flags},
+ # if (PERL_REVISION == 5) && (PERL_VERSION < 22)
  
{"Perl_xs_apiversion_bootcheck",(PERL_PROC*)&Perl_xs_apiversion_bootcheck},
+ # endif
  #else
  {"Perl_sv_2bool", (PERL_PROC*)&Perl_sv_2bool},
  #endif
***
*** 521,526 
--- 539,548 
  {"Perl_Iunitcheckav_ptr", (PERL_PROC*)&Perl_Iunitcheckav_ptr},
  # endif
  #endif
+ #if (PERL_REVISION == 5) && (PERL_VERSION >= 22)
+ {"Perl_xs_handshake", (PERL_PROC*)&Perl_xs_handshake},
+ {"Perl_xs_boot_epilog", (PERL_

Patch 7.4.755

2015-06-25 Fir de Conversatie Bram Moolenaar

Patch 7.4.755
Problem:It is not easy to count the number of characters.
Solution:   Add the skipcc argument to strchars(). (Hirohito Higashi, Ken
Takata)
Files:  runtime/doc/eval.txt, src/eval.c, src/testdir/test_utf8.in,
src/testdir/test_utf8.ok


*** ../vim-7.4.754/runtime/doc/eval.txt 2015-03-20 17:36:38.618949214 +0100
--- runtime/doc/eval.txt2015-06-25 15:59:53.104434430 +0200
***
*** 1984,1990 
  sqrt( {expr}) Float   square root of {expr}
  str2float( {expr})Float   convert String to Float
  str2nr( {expr} [, {base}])Number  convert String to Number
! strchars( {expr}) Number  character length of the String {expr}
  strdisplaywidth( {expr} [, {col}]) Number display length of the String {expr}
  strftime( {format}[, {time}]) String  time in specified format
  stridx( {haystack}, {needle}[, {start}])
--- 1985,1991 
  sqrt( {expr}) Float   square root of {expr}
  str2float( {expr})Float   convert String to Float
  str2nr( {expr} [, {base}])Number  convert String to Number
! strchars( {expr} [, {skipcc}])Number  character length of the String 
{expr}
  strdisplaywidth( {expr} [, {col}]) Number display length of the String {expr}
  strftime( {format}[, {time}]) String  time in specified format
  stridx( {haystack}, {needle}[, {start}])
***
*** 5792,5806 
Text after the number is silently ignored.
  
  
! strchars({expr})  *strchars()*
The result is a Number, which is the number of characters
!   String {expr} occupies.  Composing characters are counted
!   separately.
Also see |strlen()|, |strdisplaywidth()| and |strwidth()|.
  
  strdisplaywidth({expr}[, {col}])  *strdisplaywidth()*
The result is a Number, which is the number of display cells
!   String {expr} occupies on the screen.
When {col} is omitted zero is used.  Otherwise it is the
screen column where to start.  This matters for Tab
characters.
--- 5839,5855 
Text after the number is silently ignored.
  
  
! strchars({expr} [, {skipcc}]) *strchars()*
The result is a Number, which is the number of characters
!   in String {expr}.
!   When {skipcc} is omitted or zero, composing characters are
!   counted separately.
!   When {skipcc} set to 1, Composing characters are ignored.
Also see |strlen()|, |strdisplaywidth()| and |strwidth()|.
  
  strdisplaywidth({expr}[, {col}])  *strdisplaywidth()*
The result is a Number, which is the number of display cells
!   String {expr} occupies on the screen when it starts a {col}.
When {col} is omitted zero is used.  Otherwise it is the
screen column where to start.  This matters for Tab
characters.
***
*** 5866,5880 
*strlen()*
  strlen({expr})The result is a Number, which is the length of the 
String
{expr} in bytes.
-   If you want to count the number of multi-byte characters (not
-   counting composing characters) use something like this: >
- 
-   :let len = strlen(substitute(str, ".", "x", "g"))
- <
If the argument is a Number it is first converted to a String.
For other types an error is given.
!   Also see |len()|, |strchars()|, |strdisplaywidth()| and
!   |strwidth()|.
  
  strpart({src}, {start}[, {len}])  *strpart()*
The result is a String, which is part of {src}, starting from
--- 5915,5925 
*strlen()*
  strlen({expr})The result is a Number, which is the length of the 
String
{expr} in bytes.
If the argument is a Number it is first converted to a String.
For other types an error is given.
!   If you want to count the number of multi-byte characters use
!   |strchars()|.
!   Also see |len()|, |strdisplaywidth()| and |strwidth()|.
  
  strpart({src}, {start}[, {len}])  *strpart()*
The result is a String, which is part of {src}, starting from
*** ../vim-7.4.754/src/eval.c   2015-06-19 21:06:04.664521324 +0200
--- src/eval.c  2015-06-25 15:53:55.992189567 +0200
***
*** 3810,3816 
/* (un)lock a List item. */
item_lock(&lp->ll_li->li_tv, deep, lock);
  else
!   /* un(lock) a Dictionary item. */
item_lock(&lp->ll_di->di_tv, deep, lock);
  
  return ret;
--- 3810,

Re: [patch] Add "skip composing character flag" to strchars()

2015-06-25 Fir de Conversatie Bram Moolenaar

Hirohito Higashi wrote:
 
> Hi Bram and list,
> 
> I want to get the number of characters.
> strchars() is looks best, but composing characters are counted separately.
> So that I add "skip composing characters flag" to strchars().
> 
> strchars({expr} [, {skipcc}])   strchars()
> The result is a Number, which is the number of characters
> String {expr} occupies.
> When {skipcc} is omitted or zero, Composing characters are
> counted separately.
> When {skipcc} set to 1, Composing characters are skipped.
> Also see strlen(), strdisplaywidth() and strwidth().
> 
> Of course I know we can get the number of characters below.
> 
> :let len = strlen(substitute(str, ".", "x", "g"))
> 
> But it is not intuitive :-)
> 
> Can you include this patch?
> 
> PS
> This patch idea by Ken Takata. and many advice by Ken Takata.

Thanks.  I like it, I'll include the patch.

-- 
Fingers not found - Pound head on keyboard to continue.

 /// 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] Hit Enter twice after make

2015-06-25 Fir de Conversatie Carlos Pita
Hi Bram,

> As a compromise the error is shortened when the cursor moves.  When you
> jump to an error in the same line, then the full error is echoed, so
> that you can read it.

You're assuming there is a long error involved but this also happens
when the message is empty! The reported condition is a sufficient
condition. It only requires the current line to be the target line.
For example:

1) Write this simple 3-line python script:
#
#
1/0

2) let &l:errorformat='  File "%f"\, line %l%.%#' | let &l:makeprg='python %'

3a) Move the cursor to the first line and :make
  => Fine

3b) Move the cursor to the third line and :make
  => Double Hit Enter prompt

Notice the error is just empty because of the way errorformat was defined.

There is another situation when the Hit Enter prompt is shown twice
and yet it's also unrelated to long messages: when there are no valid
entries in the qf list. In the example above, replace `1/0` for
`print('hello')` and repeat the steps. Now both 3a and 3b end up
showing a double prompt, despite there is nowhere to jump to and no
valid error message to show.

This last point also illustrates something I've posted about
yesterday: the treatment of completely non-valid errors qf lists. IMO
they're best seen as ok output in their own than as a special case of
error output that happens to contain 0 errors by chance. In
particular: the || prefix is just noise in this case, and the current
error highlight (Search) makes no sense. To keep DRY I won't replicate
my full arguments here, though, but I would like to hear what do you
think about it (there).

Best regards
--
Carlos





>
> I don't think there is a better compromise.
>
> --
> I wish there was a knob on the TV to turn up the intelligence.
> There's a knob called "brightness", but it doesn't seem to work.
>
>  /// 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] Add "skip composing character flag" to strchars()

2015-06-25 Fir de Conversatie h_east
Hi Bram and list,

I want to get the number of characters.
strchars() is looks best, but composing characters are counted separately.
So that I add "skip composing characters flag" to strchars().

strchars({expr} [, {skipcc}])   strchars()
The result is a Number, which is the number of characters
String {expr} occupies.
When {skipcc} is omitted or zero, Composing characters are
counted separately.
When {skipcc} set to 1, Composing characters are skipped.
Also see strlen(), strdisplaywidth() and strwidth().

Of course I know we can get the number of characters below.

:let len = strlen(substitute(str, ".", "x", "g"))

But it is not intuitive :-)

Can you include this patch?

PS
This patch idea by Ken Takata. and many advice by Ken Takata.

Thanks
--
Best regards,
Hirohito Higashi (a.k.a h_east)

-- 
-- 
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/runtime/doc/eval.txt b/runtime/doc/eval.txt
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1985,7 +1985,7 @@
 sqrt( {expr})			Float	square root of {expr}
 str2float( {expr})		Float	convert String to Float
 str2nr( {expr} [, {base}])	Number	convert String to Number
-strchars( {expr})		Number	character length of the String {expr}
+strchars( {expr} [, {skipcc}])	Number	character length of the String {expr}
 strdisplaywidth( {expr} [, {col}]) Number display length of the String {expr}
 strftime( {format}[, {time}])	String	time in specified format
 stridx( {haystack}, {needle}[, {start}])
@@ -5839,10 +5839,12 @@
 		Text after the number is silently ignored.
 
 
-strchars({expr})	*strchars()*
+strchars({expr} [, {skipcc}])	*strchars()*
 		The result is a Number, which is the number of characters
-		String {expr} occupies.  Composing characters are counted
-		separately.
+		String {expr} occupies.
+		When {skipcc} is omitted or zero, Composing characters are
+		counted separately.
+		When {skipcc} set to 1, Composing characters are skipped.
 		Also see |strlen()|, |strdisplaywidth()| and |strwidth()|.
 
 strdisplaywidth({expr}[, {col}])			*strdisplaywidth()*
@@ -5916,6 +5918,8 @@
 		If you want to count the number of multi-byte characters (not
 		counting composing characters) use something like this: >
 
+			:let len = strchars(str, 1)
+<		Or: >
 			:let len = strlen(substitute(str, ".", "x", "g"))
 <
 		If the argument is a Number it is first converted to a String.
diff --git a/src/eval.c b/src/eval.c
--- a/src/eval.c
+++ b/src/eval.c
@@ -8309,7 +8309,7 @@
 {"str2float",	1, 1, f_str2float},
 #endif
 {"str2nr",		1, 2, f_str2nr},
-{"strchars",	1, 1, f_strchars},
+{"strchars",	1, 2, f_strchars},
 {"strdisplaywidth",	1, 2, f_strdisplaywidth},
 #ifdef HAVE_STRFTIME
 {"strftime",	1, 2, f_strftime},
@@ -18372,18 +18372,30 @@
 typval_T	*rettv;
 {
 char_u		*s = get_tv_string(&argvars[0]);
+int			skipcc = 0;
 #ifdef FEAT_MBYTE
 varnumber_T		len = 0;
-
-while (*s != NUL)
-{
-	mb_cptr2char_adv(&s);
-	++len;
-}
-rettv->vval.v_number = len;
+int			(*func_mb_ptr2char_adv)(char_u **pp);
+#endif
+
+if (argvars[1].v_type != VAR_UNKNOWN)
+	skipcc = get_tv_number_chk(&argvars[1], NULL);
+if (skipcc < 0 || skipcc > 1)
+	EMSG(_(e_invarg));
+else
+{
+#ifdef FEAT_MBYTE
+	func_mb_ptr2char_adv = skipcc ? mb_ptr2char_adv : mb_cptr2char_adv;
+	while (*s != NUL)
+	{
+	func_mb_ptr2char_adv(&s);
+	++len;
+	}
+	rettv->vval.v_number = len;
 #else
-rettv->vval.v_number = (varnumber_T)(STRLEN(s));
-#endif
+	rettv->vval.v_number = (varnumber_T)(STRLEN(s));
+#endif
+}
 }
 
 /*
diff --git a/src/testdir/test_utf8.in b/src/testdir/test_utf8.in
--- a/src/testdir/test_utf8.in
+++ b/src/testdir/test_utf8.in
@@ -11,6 +11,12 @@
 :
 :bwipeout!
 :$put=r
+:" Test for built-in function strchars()
+:for str in ["a", "あいa", "A\u20dd", "A\u20dd\u20dd", "\u20dd"]
+:	$put=strchars(str)
+:	$put=strchars(str, 0)
+:	$put=strchars(str, 1)
+:endfor
 :call garbagecollect(1)
 :/^start:/,$wq! test.out
 ENDTEST
diff --git a/src/testdir/test_utf8.ok b/src/testdir/test_utf8.ok
--- a/src/testdir/test_utf8.ok
+++ b/src/testdir/test_utf8.ok
@@ -2,3 +2,18 @@
 axaa
 xあああ
 bxbb
+1
+1
+1
+3
+3
+3
+2
+2
+1
+3
+3
+1
+1
+1
+1


Re: [patch] extend() does not change an item in a locked dictionary

2015-06-25 Fir de Conversatie Olaf Dabrunz
On 25-Jun-15, Bram Moolenaar wrote:
> 
> Olaf Dabrunz wrote:
> 
> > This needed more time and work on more realistic tests, and to create a
> > fix that addresses all issues.  Sorry for the delay.
> > 
> > Summary:
> > 
> > - Bug: locks can result in false error reports or missing error
> >   reports when the locks are not interpreted in the same way by all
> >   vim functions and commands.
> > 
> >   When this is fixed, locks
> >   
> > - can reliably be used to find mistakes
> > 
> > - do not terminate production runs (or test runs) because of
> >   unexpected false positives.
> > 
> > - Bug: on an attempt to change a locked item, extend() is left with
> >   an error and all previous changes are kept (exit-on-error).
> > 
> > - Bug: when the target dict is locked, extend() reports false errors
> >   for 'extend(d, {})' and 'extend({"a": 1}, {"a": 2}, "keep")'.
> > 
> > - New, less artificial tests show that a lock check loop adds less
> >   overhead than suggested by previous tests, esp. for common use
> >   cases.
> > 
> >   For the more common use cases, a separate lock test loop adds an
> >   overhead of
> > 
> > avg.:  17%  stddev: ± 16,   max.  40%.
> > 
> >   Across the whole range of use cases, the tests show an overhead of
> > 
> > avg.:  34%  stddev: ± 27,   max. 100%.
> > 
> >   These tests are still somewhat artificial.  The overhead shrinks
> >   beyond these values when larger item values (e.g. real-life
> >   strings) are used.
> > 
> > - Fix: all above bugs are fixed for extend() by using a lock check
> >   loop that is only used when the target dict has locks set.
> > 
> >   This implements all-or-nothing behavior at near-zero cost when no
> >   locks are used on the target dict.
> > 
> >   When locks are used on the target dict, the slowdown is as shown
> >   in above tests.
> > 
> > - Open issue: are lock check loops needed in other situations (e.g.
> >   for lists), and should a similar lock count optimization be used?
> 
> This is a long message...

My apologies.

I do not like long mails.  They take too much time to read, and to
answer.  Not good for a discussion.

After several attempts to make it shorter, this is the best I could do
while addressing all concerns.  Still could improve...  (I hope the
summary saves my karma...)

> This is a long message...  Your reasoning makes sense.

Thanks! :)

> This is a long message...  Your reasoning makes sense.  Anybody else has
> a problem with the proposed solution?
> 
> dv_ilocked is not an obvious name, perhaps dv_has_locks?

Much better!  :)  It's in the patch below.

(Seriously, why could I not come up with this...)

I could have gleaned it from this comment:

/* When d1 has locks, first check for lock breaks and overwrite errors.  */
if (d1->dv_has_locks || d1->dv_lock & (VAR_LOCKED | VAR_FIXED))

... but I didn't... sigh...

> The loop to check for locks is very similar to the loop doing the work.
> Consider using the same loop and run it twice, once to check and once to
> do the work.  Avoids that later only one of the two loops is modified.

Yes.

I tried before, but did not want to put so many 'if's into the loop, so
that the other error checks would not be done twice.

But 'if's do not really matter much, with branch prediction.  Also,
redoing the checks should not matter much, as cache fill is the bottle
neck.  It could still matter for small dicts though, as they may remain
in the cache.

So I put in some 'if's, so that lock checks and variable name checks
would not be done twice.  The change "error" checks are repeated though,
which is the most simple way to make sure these are reported in both
the cases with or without locks.  They are also the cheapest checks.


NOTE: Please use the patch below in this message.  The attached patch is
for review only, it is much more readable when whitespace is ignored.


---
 src/eval.c|  106 --
 src/structs.h |1 
 src/testdir/test55.in |   24 +++
 src/testdir/test55.ok |7 +++
 4 files changed, 101 insertions(+), 37 deletions(-)

Index: b/src/eval.c
===
--- a/src/eval.c2015-06-21 15:43:04.278647940 +0200
+++ b/src/eval.c2015-06-25 13:45:17.753217769 +0200
@@ -3810,8 +3810,11 @@ do_lock_var(lp, name_end, deep, lock)
/* (un)lock a List item. */
item_lock(&lp->ll_li->li_tv, deep, lock);
 else
+{
/* un(lock) a Dictionary item. */
item_lock(&lp->ll_di->di_tv, deep, lock);
+   lp->ll_dict->dv_has_locks += lock ? 1 : -1;
+}
 
 return ret;
 }
@@ -3879,6 +3882,7 @@ item_lock(tv, deep, lock)
{
--todo;
item_lock(&HI2DI(hi)->di_tv, deep - 1, lock);
+  

Patch 7.4.754

2015-06-25 Fir de Conversatie Bram Moolenaar

Patch 7.4.754
Problem:Using CTRL-A in Visual mode does not work well. (Gary Johnson)
Solution:   Make it increment all numbers in the Visual area. (Christian
Brabandt)
Files:  runtime/doc/change.txt, src/normal.c, src/ops.c,
src/proto/ops.pro, src/testdir/Make_amiga.mak,
src/testdir/Make_dos.mak, src/testdir/Make_ming.mak,
src/testdir/Make_os2.mak, src/testdir/Make_vms.mms,
src/testdir/Makefile, src/testdir/test_increment.in,
src/testdir/test_increment.ok


*** ../vim-7.4.753/runtime/doc/change.txt   2015-01-27 18:43:42.134535513 
+0100
--- runtime/doc/change.txt  2015-06-25 13:55:43.686428819 +0200
***
*** 156,161 
--- 156,164 
  The 'B' and 'M' flags in 'formatoptions' change the behavior for inserting
  spaces before and after a multi-byte character |fo-table|.
  
+ The '[ mark is set at the end of the first line that was joined, '] at the end
+ of the resulting line.
+ 
  
  ==
  2. Delete and insert  *delete-insert* *replacing*
***
*** 376,385 
--- 379,421 
  CTRL-AAdd [count] to the number or alphabetic 
character at
or after the cursor.  {not in Vi}
  
+   *v_CTRL-A*
+ {Visual}CTRL-AAdd [count] to the number or alphabetic 
character in
+   the highlighted text.  {not in Vi}
+ 
+   *v_g_CTRL-A*
+ {Visual}g CTRL-A  Add [count] to the number or alphabetic character in
+   the highlighted text. If several lines are
+   highlighted, each one will be incremented by an
+   additional [count] (so effectively creating a
+   [count] incrementing sequence).  {not in Vi}
+   For Example, if you have this list of numbers:
+   1. ~
+   1. ~
+   1. ~
+   1. ~
+   Move to the second "1." and Visually select three
+   lines, pressing g CTRL-A results in:
+   1. ~
+   2. ~
+   3. ~
+   4. ~
+ 
*CTRL-X*
  CTRL-XSubtract [count] from the number or alphabetic
character at or after the cursor.  {not in Vi}
  
+   *v_CTRL-X*
+ {Visual}CTRL-XSubtract [count] from the number or alphabetic
+   character in the highlighted text.  {not in Vi}
+ 
+   *v_g_CTRL-X*
+ {Visual}g CTRL-X  Subtract [count] from the number or alphabetic
+   character in the highlighted text. If several lines
+   are highlighted, each value will be decremented by an
+   additional [count] (so effectively creating a [count]
+   decrementing sequence).  {not in Vi}
+ 
  The CTRL-A and CTRL-X commands work for (signed) decimal numbers, unsigned
  octal and hexadecimal numbers and alphabetic characters.  This depends on the
  'nrformats' option.
***
*** 396,401 
--- 432,440 
under or after the cursor.  This is useful to make lists with an alphabetic
index.
  
+ For decimals a leading negative sign is considered for incrementing/
+ decrementing, for octal and hey values, it won't be considered.
+ 
  For numbers with leading zeros (including all octal and hexadecimal numbers),
  Vim preserves the number of characters in the number when possible.  CTRL-A on
  "0077" results in "0100", CTRL-X on "0x100" results in "0x0ff".
*** ../vim-7.4.753/src/normal.c 2015-06-25 13:30:41.206095684 +0200
--- src/normal.c2015-06-25 13:42:06.342924954 +0200
***
*** 4201,4209 
  nv_addsub(cap)
  cmdarg_T  *cap;
  {
! if (!checkclearopq(cap->oap)
!   && do_addsub((int)cap->cmdchar, cap->count1) == OK)
prep_redo_cmd(cap);
  }
  
  /*
--- 4201,4217 
  nv_addsub(cap)
  cmdarg_T  *cap;
  {
! int visual = VIsual_active;
! if (cap->oap->op_type == OP_NOP
!   && do_addsub((int)cap->cmdchar, cap->count1, cap->arg) == OK)
prep_redo_cmd(cap);
+ else
+   clearopbeep(cap->oap);
+ if (visual)
+ {
+   VIsual_active = FALSE;
+   redraw_later(CLEAR);
+ }
  }
  
  /*
***
*** 7841,7854 
  
  switch (cap->nchar)
  {
  #ifdef MEM_PROFILE
  /*
   * "g^A": dump log of used memory.
   */
! case Ctrl_A:
!   vim_mem_profile_dump();
!   

Re: Issue 377 in vim: gvim keeps creating ~/.gnome2/Vim, ignores XDG

2015-06-25 Fir de Conversatie vim


Comment #1 on issue 377 by john.b.l...@gmail.com: gvim keeps creating  
~/.gnome2/Vim, ignores XDG

https://code.google.com/p/vim/issues/detail?id=377

IIUC this behaviour is not in vim code, so cannot be fixed in vim.

It's in the gnome 2 libraries, which were superseded by Gnome 3 about 5  
years ago.  Gnome 3 uses GTK+ 3, which was a rewrite, so revising gvim to  
use gnome 3 would not be easy, and there seems to be nothing gained (and  
some features to lose) by doing it.  Opinions may vary.


Regards, John Little

--
You received this message because this project is configured to send all  
issue notifications to this address.

You may adjust your notification preferences at:
https://code.google.com/hosting/settings

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

2015-06-25 Fir de Conversatie Bram Moolenaar

Patch 7.4.753
Problem:Appending in Visual mode with 'linebreak' set does not work
properly.  Also when 'selection' is "exclusive". (Ingo Karkat)
Solution:   Recalculate virtual columns. (Christian Brabandt)
Files:  src/normal.c, src/testdir/test_listlbr.in,
src/testdir/test_listlbr.ok, src/testdir/test_listlbr_utf8.in,
src/testdir/test_listlbr_utf8.ok


*** ../vim-7.4.752/src/normal.c 2015-06-10 12:16:41.926648740 +0200
--- src/normal.c2015-06-25 12:47:07.989550746 +0200
***
*** 174,179 
--- 174,180 
  #ifdef FEAT_AUTOCMD
  static void   nv_cursorhold __ARGS((cmdarg_T *cap));
  #endif
+ static void   get_op_vcol __ARGS((oparg_T *oap, colnr_T col, int initial));
  
  static char *e_noident = N_("E349: No identifier under cursor");
  
***
*** 1418,1423 
--- 1419,1426 
  {
  #ifdef FEAT_LINEBREAK
/* Avoid a problem with unwanted linebreaks in block mode. */
+   if (curwin->w_p_lbr)
+   curwin->w_valid &= ~VALID_VIRTCOL;
curwin->w_p_lbr = FALSE;
  #endif
oap->is_VIsual = VIsual_active;
***
*** 1631,1691 
  
if (VIsual_active || redo_VIsual_busy)
{
!   if (VIsual_mode == Ctrl_V)  /* block mode */
!   {
!   colnr_T start, end;
! 
!   oap->block_mode = TRUE;
! 
!   getvvcol(curwin, &(oap->start),
! &oap->start_vcol, NULL, &oap->end_vcol);
!   if (!redo_VIsual_busy)
!   {
!   getvvcol(curwin, &(oap->end), &start, NULL, &end);
! 
!   if (start < oap->start_vcol)
!   oap->start_vcol = start;
!   if (end > oap->end_vcol)
!   {
!   if (*p_sel == 'e' && start >= 1
!   && start - 1 >= oap->end_vcol)
!   oap->end_vcol = start - 1;
!   else
!   oap->end_vcol = end;
!   }
!   }
! 
!   /* if '$' was used, get oap->end_vcol from longest line */
!   if (curwin->w_curswant == MAXCOL)
!   {
!   curwin->w_cursor.col = MAXCOL;
!   oap->end_vcol = 0;
!   for (curwin->w_cursor.lnum = oap->start.lnum;
!   curwin->w_cursor.lnum <= oap->end.lnum;
! ++curwin->w_cursor.lnum)
!   {
!   getvvcol(curwin, &curwin->w_cursor, NULL, NULL, &end);
!   if (end > oap->end_vcol)
!   oap->end_vcol = end;
!   }
!   }
!   else if (redo_VIsual_busy)
!   oap->end_vcol = oap->start_vcol + redo_VIsual_vcol - 1;
!   /*
!* Correct oap->end.col and oap->start.col to be the
!* upper-left and lower-right corner of the block area.
!*
!* (Actually, this does convert column positions into character
!* positions)
!*/
!   curwin->w_cursor.lnum = oap->end.lnum;
!   coladvance(oap->end_vcol);
!   oap->end = curwin->w_cursor;
! 
!   curwin->w_cursor = oap->start;
!   coladvance(oap->start_vcol);
!   oap->start = curwin->w_cursor;
!   }
  
if (!redo_VIsual_busy && !gui_yank)
{
--- 1634,1640 
  
if (VIsual_active || redo_VIsual_busy)
{
!   get_op_vcol(oap, redo_VIsual_vcol, TRUE);
  
if (!redo_VIsual_busy && !gui_yank)
{
***
*** 1982,1988 
  #ifdef FEAT_LINEBREAK
/* Restore linebreak, so that when the user edits it looks as
 * before. */
!   curwin->w_p_lbr = lbr_saved;
  #endif
/* Reset finish_op now, don't want it set inside edit(). */
finish_op = FALSE;
--- 1931,1941 
  #ifdef FEAT_LINEBREAK
/* Restore linebreak, so that when the user edits it looks as
 * before. */
!   if (curwin->w_p_lbr != lbr_saved)
!   {
!   curwin->w_p_lbr = lbr_saved;
!   get_op_vcol(oap, redo_VIsual_mode, FALSE);
!   }
  #endif
/* Reset finish_op now, don't want it set inside edit(). */
finish_op = FALSE;
***
*** 2082,2088 
  #ifdef FEAT_LINEBREAK
/* Restore linebreak, so that when the user edits it looks as
 * before. */
!   curwin->w_p_lbr = lbr_saved;
  #endif
op_insert(oap, cap->count1);
  #ifdef FEAT_LINEBREAK
--- 2035,2045 
  #ifdef FEAT_LINEBREAK
/* Restore linebreak, so that when the user edits it looks

Re: [patch] extend() does not change an item in a locked dictionary

2015-06-25 Fir de Conversatie Bram Moolenaar

Olaf Dabrunz wrote:

> This needed more time and work on more realistic tests, and to create a
> fix that addresses all issues.  Sorry for the delay.
> 
> Summary:
> 
> - Bug: locks can result in false error reports or missing error
>   reports when the locks are not interpreted in the same way by all
>   vim functions and commands.
> 
>   When this is fixed, locks
>   
> - can reliably be used to find mistakes
> 
> - do not terminate production runs (or test runs) because of
>   unexpected false positives.
> 
> - Bug: on an attempt to change a locked item, extend() is left with
>   an error and all previous changes are kept (exit-on-error).
> 
> - Bug: when the target dict is locked, extend() reports false errors
>   for 'extend(d, {})' and 'extend({"a": 1}, {"a": 2}, "keep")'.
> 
> - New, less artificial tests show that a lock check loop adds less
>   overhead than suggested by previous tests, esp. for common use
>   cases.
> 
>   For the more common use cases, a separate lock test loop adds an
>   overhead of
> 
> avg.:  17%  stddev: ± 16,   max.  40%.
> 
>   Across the whole range of use cases, the tests show an overhead of
> 
> avg.:  34%  stddev: ± 27,   max. 100%.
> 
>   These tests are still somewhat artificial.  The overhead shrinks
>   beyond these values when larger item values (e.g. real-life
>   strings) are used.
> 
> - Fix: all above bugs are fixed for extend() by using a lock check
>   loop that is only used when the target dict has locks set.
> 
>   This implements all-or-nothing behavior at near-zero cost when no
>   locks are used on the target dict.
> 
>   When locks are used on the target dict, the slowdown is as shown
>   in above tests.
> 
> - Open issue: are lock check loops needed in other situations (e.g.
>   for lists), and should a similar lock count optimization be used?

This is a long message...  Your reasoning makes sense.  Anybody else has
a problem with the proposed solution?

dv_ilocked is not an obvious name, perhaps dv_has_locks?

The loop to check for locks is very similar to the loop doing the work.
Consider using the same loop and run it twice, once to check and once to
do the work.  Avoids that later only one of the two loops is modified.


-- 
hundred-and-one symptoms of being an internet addict:
142. You dream about creating the world's greatest web site.

 /// 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] Hit Enter twice after make

2015-06-25 Fir de Conversatie Bram Moolenaar

Carlos Pita wrote:

> The fact that the hit enter prompt is shown twice sometimes after
> :make when an error is found by quickfix was asked a number of times
> in the user list and in stackoverflow, but AFAIK it was just
> workarounded by making make silent or cmdheight larger. Now I've found
> a specific situation when the problem seem to be clearly reproducible:
> when the cursor was already on the line containing the first qf valid
> error immediately before running the make command (that is, the curaor
> was already on the line where make will automatically jump). In this
> case the qf error message is echoed as usual, except that the editor
> hasn't been redrawn yet and the hit enter prompt is presented again.

What happens here is that when you jump to a quickfix entry it normally
echoes the error.  Errors are often long and cause the hit-enter prompt.
As a compromise the error is shortened when the cursor moves.  When you
jump to an error in the same line, then the full error is echoed, so
that you can read it.

I don't think there is a better compromise.

-- 
I wish there was a knob on the TV to turn up the intelligence.
There's a knob called "brightness", but it doesn't seem to work. 

 /// 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: NFA regex engine bug

2015-06-25 Fir de Conversatie Axel Bender
Unless this is a principal question, a solution working with re=2 is

%s/\(^\d\+\)\(.*\)\n\1.*$/\1\2/

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