Re: How to execute a command like sort by job?

2016-09-01 Fir de Conversatie thinca
2016-09-01 21:04 GMT+09:00 Bram Moolenaar :
>
> Thinca wrote:
>
>> :help channel-close says:
>>
>> Once done with the channel, disconnect it like this: >
>> call ch_close(channel)
>> When a socket is used this will close the socket for both directions.  When
>> pipes are used (stdin/stdout/stderr) they are all closed.  This might not be
>> what you want!  Stopping the job with job_stop() might be better.
>>
>> It seems there is no way to close only stdin.
>> How to execute a command that waits the end of input, like sort?
>
> Good point.  I wonder why nobody mentioned it before.
>
> We should also close the pipe/socket when reading from a buffer is done,
> for a command like:
>
> let job = job_start('sort', {'in_io': 'buffer', 'in_name': 'sortin', 
> 'out_io': 'buffer', 'out_name': 'sortout'})
>
> --
> An actual excerpt from a classified section of a city newspaper:
> "Illiterate?  Write today for free help!"
>
>  /// 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///

Thank you for response.
And I saw and tried 7.4.2298.  This is great. Thanks!

Best regards,

--
thinca 

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


How to execute a command like sort by job?

2016-08-31 Fir de Conversatie thinca
Hi Bram and list,

:help channel-close says:

Once done with the channel, disconnect it like this: >
call ch_close(channel)
When a socket is used this will close the socket for both directions.  When
pipes are used (stdin/stdout/stderr) they are all closed.  This might not be
what you want!  Stopping the job with job_stop() might be better.

It seems there is no way to close only stdin.
How to execute a command that waits the end of input, like sort?

Best regards,

--
thinca 

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


Timer can not stop in its callback

2016-08-31 Fir de Conversatie thinca
Hi Bram,

Timer can not stop in its callback.

```
let t = timer_start(1000, { timer -> timer_stop(timer) }, {'repeat': -1})
```

This timer doesn't stop. timer_pause() doesn't also work in callback.
We can stop this timer from the outside of callback: call timer_stop(t)

I think this is bug and should be fixed before Vim 8.0.

Regards,

--
thinca 

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

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


Re: Vim 8 pre-announcement

2016-08-17 Fir de Conversatie thinca
Hi Bram,

2016-08-17 1:43 GMT+09:00 Bram Moolenaar :
>
> Hello Vim users,
>
> Work on Vim 8.0 is coming close to an end.  I hope version 8.0 can be
> released in about two weeks.
>
> This is a last chance to modify new features in a way that is not
> backwards compatible.  Once 8.0 is out we can't make changes that would
> break plugins.
>
> An overview of new features can be found in:
> https://github.com/vim/vim/blob/master/runtime/doc/version8.txt
> A version with links (but a day older):
> http://vimhelp.appspot.com/version8.txt.html
>
> Please review the new features, try them out and report what should be
> changed on the vim-dev maillist.  Of course you should also report bugs
> you find.
>
> Happy Vimming!
>
>
> PS. If you are interested in meeting Vim users: Vimfest is happening in
> Berlin Sept. 16-18.  http://vimfest.org
>
>
> --
> How To Keep A Healthy Level Of Insanity:
> 9. As often as possible, skip rather than walk.
>
>  /// 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.

:help job-term says:

*job-term*
"term": "open"Start a terminal and connect the job
stdin/stdout/stderr to it.
NOTE: Not implemented yet!

This is not implemented yet.  Is this not implemented in Vim 8.0?

Thanks,
thinca

-- 
-- 
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: [security issue] job_start/ch_open/timer_start is enabled on restricted/secure mode

2016-04-21 Fir de Conversatie thinca
Hi,

Thank you for the patch (I'm reporter of this).
I think check_restricted() is unnecessary for timer.
But I follow Bram's judge :)
2016/04/22 11:10 "mattn" :

> diff --git a/src/eval.c b/src/eval.c
> index 3542b77..0045967 100644
> --- a/src/eval.c
> +++ b/src/eval.c
> @@ -10406,6 +10406,8 @@ f_ch_logfile(typval_T *argvars, typval_T *rettv
> UNUSED)
>  f_ch_open(typval_T *argvars, typval_T *rettv)
>  {
>  rettv->v_type = VAR_CHANNEL;
> +if (check_restricted() || check_secure())
> +   return;
>  rettv->vval.v_channel = channel_open_func(argvars);
>  }
>
> @@ -15076,6 +15078,8 @@ f_job_setoptions(typval_T *argvars, typval_T
> *rettv UNUSED)
>  f_job_start(typval_T *argvars, typval_T *rettv)
>  {
>  rettv->v_type = VAR_JOB;
> +if (check_restricted() || check_secure())
> +   return;
>  rettv->vval.v_job = job_start(argvars);
>  }
>
> @@ -20681,6 +20685,8 @@ f_timer_start(typval_T *argvars, typval_T *rettv)
>  char_u  *callback;
>  dict_T  *dict;
>
> +if (check_restricted() || check_secure())
> +   return;
>  if (argvars[2].v_type != VAR_UNKNOWN)
>  {
> if (argvars[2].v_type != VAR_DICT
>
> --
> --
> 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.
>

-- 
-- 
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] has('patch-7.4.1') doesn't work well

2016-03-26 Fir de Conversatie thinca
Hi

I found a bug around has-patch

echo has('patch-7.4.001')
" => 1
echo has('patch-7.4.01')
" => 1
echo has('patch-7.4.1')
" => 0

I wrote a patch.  Please check.

diff --git a/src/eval.c b/src/eval.c
index 06f3585..b229aef 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -13837,7 +13837,7 @@ f_has(typval_T *argvars, typval_T *rettv)
if (STRNICMP(name, "patch", 5) == 0)
{
if (name[5] == '-'
-   && STRLEN(name) > 11
+   && STRLEN(name) >= 11
&& vim_isdigit(name[6])
&& vim_isdigit(name[8])
&& vim_isdigit(name[10]))


--
thinca 

-- 
-- 
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] Possible memory leak with partial

2016-03-22 Fir de Conversatie thinca
Thank you for the patch!

I found a SEGV pattern with this patch.

" test.vim
let obj = {}
function! obj.func() abort
endfunction
let obj.func = obj.func
unlet obj
call garbagecollect()


vim -u test.vim -i NONE -N


#0  0x74afd6e7 in raise () from /lib64/libc.so.6
#1  0x74afeaba in abort () from /lib64/libc.so.6
#2  0x74b3c1e0 in __libc_message () from /lib64/libc.so.6
#3  0x74b4169e in malloc_printerr () from /lib64/libc.so.6
#4  0x74b41e8b in _int_free () from /lib64/libc.so.6
#5  0x005366e0 in vim_free (x=0xca47c0) at misc2.c:1695
#6  0x0047f57d in dict_free (d=0xca47c0, recurse=0) at eval.c:7284
#7  0x0047ef0c in free_unref_items (copyID=2) at eval.c:7001
#8  0x0047ee0c in garbage_collect () at eval.c:6949
#9  0x004f4c05 in vgetc () at getchar.c:1574
#10 0x004f51e6 in safe_vgetc () at getchar.c:1801
#11 0x0054759a in normal_cmd (oap=0x7fffdb30, toplevel=1)
at normal.c:627
#12 0x0068bf34 in main_loop (cmdwin=0, noexmode=0) at main.c:1353
#13 0x0068b84b in main (argc=7, argv=0x7fffde48) at main.c:1045


--
thinca 

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

2016-03-19 Fir de Conversatie thinca
2016-03-20 1:43 GMT+09:00 thinca :
> 2016-03-17 18:45 GMT+09:00 Bram Moolenaar :
>>
>> Lilydjwg wrote:
>>
>>> On Wed, Mar 16, 2016 at 03:43:06PM +0100, Bram Moolenaar wrote:
>>> >
>>> > Kent Sibilev wrote:
>>> >
>>> > > On Tuesday, March 15, 2016 at 2:33:55 PM UTC-4, Bram Moolenaar wrote:
>>> > > > Patch 7.4.1577
>>> > > > Problem:Cannot pass "dict.Myfunc" around as a partial.
>>> > > > Solution:   Create a partial when expected.
>>> > > > Files:  src/eval.c, src/testdir/test_partial.vim
>>> > > >
>>> > >
>>> > > This change doesn't allow functions like this:
>>> > >
>>> > > function! s:cache_clear(...) dict
>>> > >
>>> > > function! rails#cache_clear(...)
>>> > >
>>> > > to be defined at the same time. Any particular reason for this, cause
>>> > > this change breaks vim-rails plugin.
>>> >
>>> > The patch should not change anything about what functions you can
>>> > define.
>>> >
>>> > What is the error?  Can you make a small example that fails?
>>>
>>> I get these:
>>>
>>> 处理 function 30_import[11]..30__import[20]..30__build_module 
>>> 时发生错误:
>>> 第   14 行:
>>> E924: can't have both a "self" dict and a partial: 30_load
>>> Mark: Invalid value type for g:mwPalettes[maximum]
>>>
>>> At least two plugins are broken.
>>>
>>> One of them is the mark.vim plugin, which does this:
>>>
>>> elseif type(g:mwPalettes[g:mwDefaultHighlightingPalette]) == 
>>> type(function('tr'))
>>>
>>> The left side evaluates to a function ref. The result is 10, not 2.
>>>
>>> The other is from an old version of neocomplete, 
>>> autoload/vital/_b6a796b.vim. You can view it here:
>>> https://github.com/lilydjwg/dotvim/blob/master/autoload/vital/_b6a796b.vim#L144
>>>
>>> There are a lot of similar error messages from neocomplete too (both the
>>> version I'm using and the latest version on GitHub).
>>
>> Please try the latest patch, hopefully this is fixed now.
>
> This is not fixed in Vim 7.4.1603.
>
> I think funcref and partial are same thing in Vim script, so
> type({partial}) should return 2.
>
> diff --git a/src/eval.c b/src/eval.c
> index a2288f9..69969fe 100644
> --- a/src/eval.c
> +++ b/src/eval.c
> @@ -20398,6 +20398,7 @@ f_type(typval_T *argvars, typval_T *rettv)
>  {
> case VAR_NUMBER: n = 0; break;
> case VAR_STRING: n = 1; break;
> +   case VAR_PARTIAL:
> case VAR_FUNC:   n = 2; break;
> case VAR_LIST:   n = 3; break;
> case VAR_DICT:   n = 4; break;
> @@ -20411,7 +20412,6 @@ f_type(typval_T *argvars, typval_T *rettv)
>  break;
> case VAR_JOB: n = 8; break;
> case VAR_CHANNEL: n = 9; break;
> -   case VAR_PARTIAL: n = 10; break;
> case VAR_UNKNOWN:
>  EMSG2(_(e_intern2), "f_type(UNKNOWN)");
>  n = -1;
>
>
> Or, a funcref in a dictionary must not be converted to a partial for
> compatibility.

I thought once again to this problem.
I often use the idiom as below:


let s:base = {}
function! s:base.method()
  " ...
endfunction

let instance = copy(s:base)

function IsInstance(instance)
  " Check the instance has a same method as the base
  return s:base.method == a:instance.method
endfunction


This doesn't work when a method is converted to a partial automatically.
This patch(7.4.1577) breaks backward compatibility.

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

2016-03-19 Fir de Conversatie thinca
2016-03-17 18:45 GMT+09:00 Bram Moolenaar :
>
> Lilydjwg wrote:
>
>> On Wed, Mar 16, 2016 at 03:43:06PM +0100, Bram Moolenaar wrote:
>> >
>> > Kent Sibilev wrote:
>> >
>> > > On Tuesday, March 15, 2016 at 2:33:55 PM UTC-4, Bram Moolenaar wrote:
>> > > > Patch 7.4.1577
>> > > > Problem:Cannot pass "dict.Myfunc" around as a partial.
>> > > > Solution:   Create a partial when expected.
>> > > > Files:  src/eval.c, src/testdir/test_partial.vim
>> > > >
>> > >
>> > > This change doesn't allow functions like this:
>> > >
>> > > function! s:cache_clear(...) dict
>> > >
>> > > function! rails#cache_clear(...)
>> > >
>> > > to be defined at the same time. Any particular reason for this, cause
>> > > this change breaks vim-rails plugin.
>> >
>> > The patch should not change anything about what functions you can
>> > define.
>> >
>> > What is the error?  Can you make a small example that fails?
>>
>> I get these:
>>
>> 处理 function 30_import[11]..30__import[20]..30__build_module 
>> 时发生错误:
>> 第   14 行:
>> E924: can't have both a "self" dict and a partial: 30_load
>> Mark: Invalid value type for g:mwPalettes[maximum]
>>
>> At least two plugins are broken.
>>
>> One of them is the mark.vim plugin, which does this:
>>
>> elseif type(g:mwPalettes[g:mwDefaultHighlightingPalette]) == 
>> type(function('tr'))
>>
>> The left side evaluates to a function ref. The result is 10, not 2.
>>
>> The other is from an old version of neocomplete, 
>> autoload/vital/_b6a796b.vim. You can view it here:
>> https://github.com/lilydjwg/dotvim/blob/master/autoload/vital/_b6a796b.vim#L144
>>
>> There are a lot of similar error messages from neocomplete too (both the
>> version I'm using and the latest version on GitHub).
>
> Please try the latest patch, hopefully this is fixed now.

This is not fixed in Vim 7.4.1603.

I think funcref and partial are same thing in Vim script, so
type({partial}) should return 2.

diff --git a/src/eval.c b/src/eval.c
index a2288f9..69969fe 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -20398,6 +20398,7 @@ f_type(typval_T *argvars, typval_T *rettv)
 {
case VAR_NUMBER: n = 0; break;
case VAR_STRING: n = 1; break;
+   case VAR_PARTIAL:
case VAR_FUNC:   n = 2; break;
case VAR_LIST:   n = 3; break;
case VAR_DICT:   n = 4; break;
@@ -20411,7 +20412,6 @@ f_type(typval_T *argvars, typval_T *rettv)
 break;
case VAR_JOB: n = 8; break;
case VAR_CHANNEL: n = 9; break;
-   case VAR_PARTIAL: n = 10; break;
case VAR_UNKNOWN:
 EMSG2(_(e_intern2), "f_type(UNKNOWN)");
 n = -1;


Or, a funcref in a dictionary must not be converted to a partial for
compatibility.

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

2016-03-12 Fir de Conversatie thinca
Hi,

Help says "[where]" but code comment and commit comment say "[what]".
Which is right?
--
thinca 


2016-03-13 6:47 GMT+09:00 Bram Moolenaar :
>
> Patch 7.4.1553
> Problem:":runtime" does not use 'packpath'.
> Solution:   Add "what" argument.
> Files:  src/ex_cmds2.c, src/vim.h, runtime/doc/repeat.txt,
> src/testdir/test_packadd.vim
>
>
> *** ../vim-7.4.1552/src/ex_cmds2.c  2016-03-12 22:11:34.239300280 +0100
> --- src/ex_cmds2.c  2016-03-12 22:42:18.755994876 +0100
> ***
> *** 2901,2912 
>   #endif
>
>   /*
> !  * ":runtime {name}"
>*/
>   void
>   ex_runtime(exarg_T *eap)
>   {
> ! source_runtime(eap->arg, eap->forceit ? DIP_ALL : 0);
>   }
>
>   static void
> --- 2901,2938 
>   #endif
>
>   /*
> !  * ":runtime [what] {name}"
>*/
>   void
>   ex_runtime(exarg_T *eap)
>   {
> ! char_u  *arg = eap->arg;
> ! char_u  *p = skiptowhite(arg);
> ! int   len = (int)(p - arg);
> ! int   flags = eap->forceit ? DIP_ALL : 0;
> !
> ! if (STRNCMP(arg, "START", len) == 0)
> ! {
> !   flags += DIP_START + DIP_NORTP;
> !   arg = skipwhite(arg + len);
> ! }
> ! else if (STRNCMP(arg, "OPT", len) == 0)
> ! {
> !   flags += DIP_OPT + DIP_NORTP;
> !   arg = skipwhite(arg + len);
> ! }
> ! else if (STRNCMP(arg, "PACK", len) == 0)
> ! {
> !   flags += DIP_START + DIP_OPT + DIP_NORTP;
> !   arg = skipwhite(arg + len);
> ! }
> ! else if (STRNCMP(arg, "ALL", len) == 0)
> ! {
> !   flags += DIP_START + DIP_OPT;
> !   arg = skipwhite(arg + len);
> ! }
> !
> ! source_runtime(arg, flags);
>   }
>
>   static void
> ***
> *** 3067,3081 
>   void  (*callback)(char_u *fname, void *ck),
>   void  *cookie)
>   {
> ! int   done;
>   char_u*s;
>   int   len;
>   char  *start_dir = "pack/*/start/*/%s";
>   char  *opt_dir = "pack/*/opt/*/%s";
>
> ! done = do_in_path(p_rtp, name, flags, callback, cookie);
>
> ! if (done == FAIL && (flags & DIP_START))
>   {
> len = STRLEN(start_dir) + STRLEN(name);
> s = alloc(len);
> --- 3093,3108 
>   void  (*callback)(char_u *fname, void *ck),
>   void  *cookie)
>   {
> ! int   done = FAIL;
>   char_u*s;
>   int   len;
>   char  *start_dir = "pack/*/start/*/%s";
>   char  *opt_dir = "pack/*/opt/*/%s";
>
> ! if ((flags & DIP_NORTP) == 0)
> !   done = do_in_path(p_rtp, name, flags, callback, cookie);
>
> ! if ((done == FAIL || (flags & DIP_ALL)) && (flags & DIP_START))
>   {
> len = STRLEN(start_dir) + STRLEN(name);
> s = alloc(len);
> ***
> *** 3086,3092 
> vim_free(s);
>   }
>
> ! if (done == FAIL && (flags & DIP_OPT))
>   {
> len = STRLEN(opt_dir) + STRLEN(name);
> s = alloc(len);
> --- 3113,3119 
> vim_free(s);
>   }
>
> ! if ((done == FAIL || (flags & DIP_ALL)) && (flags & DIP_OPT))
>   {
> len = STRLEN(opt_dir) + STRLEN(name);
> s = alloc(len);
> *** ../vim-7.4.1552/src/vim.h   2016-03-12 22:11:34.247300195 +0100
> --- src/vim.h   2016-03-12 22:27:03.381577532 +0100
> ***
> *** 2294,2298 
> --- 2294,2299 
>   #define DIP_ERR   0x04/* give an error message when none 
> found. */
>   #define DIP_START   0x08  /* also use "start" directory in 'packpath' */
>   #define DIP_OPT   0x10/* also use "opt" directory in 
> 'packpath' */
> + #define DIP_NORTP   0x20  /* do not use 'runtimepath' */
>
>   #endif /* VIM__H */
> *** ../vim-7.4.1552/runtime/doc/repeat.txt  2016-03-09 22:18:52.166442971 
> +0100
> --- runtime/doc/repeat.txt  2016-03-12 22:20:49.305494588 +0100
> ***
> *** 175,184 
> {not in Vi}
>
> *:ru* *:runtime*
> ! :ru[ntime][!] {file} ..
> Read Ex commands from {file} in each directory given
> !   by 'runtimepath'.  There is no error for non-existing
> !   files.  Exampl

[patch] feedkeys('', 'x') doesn't work

2016-03-10 Fir de Conversatie thinca
Hi Bram and list,

:help feedkeys() says,

'x' Execute commands until typeahead is empty.  This is
similar to using ":normal!".  You can call feedkeys()
several times without 'x' and then one time with 'x'
(possibly with an empty {string}) to execute all the
typeahead.

> possibly with an empty {string}

But feedkeys('', 'x') doesn't work.

I wrote a patch which fix this. I also added test.
Please check the gist below.

https://gist.github.com/thinca/c3215460ebca3043529c

--
thinca 

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

2016-01-04 Fir de Conversatie thinca
> How about this:
>
> bin If included, numbers starting with "0b" or "0B" will be
> considered to be binary.  Example: Using CTRL-X on
> "0b1000" results in "0x0111".

It looks pretty good except for typo.


--
thinca 

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

2016-01-03 Fir de Conversatie thinca
Hi Bram,

The description of "bin" is not added to :help 'nrformats'

Regards,
--
thinca 


2016-01-03 1:56 GMT+09:00 Bram Moolenaar :
>
> Patch 7.4.1027
> Problem:No support for binary numbers.
> Solution:   Add "bin" to nrformats. (Jason Schulz)
> Files:  runtime/doc/change.txt, runtime/doc/eval.txt,
> runtime/doc/version7.txt, src/charset.c, src/eval.c,
> src/ex_cmds.c, src/ex_getln.c, src/misc2.c, src/ops.c,
> src/option.c, src/proto/charset.pro, src/spell.c,
> src/testdir/test57.in, src/testdir/test57.ok,
> src/testdir/test58.in, src/testdir/test58.ok,
> src/testdir/test_increment.in, src/testdir/test_increment.ok,
> src/vim.h
>
>
>
> *** ../vim-7.4.1026/runtime/doc/change.txt  2015-06-25 13:57:20.025431155 
> +0200
> --- runtime/doc/change.txt  2016-01-02 16:43:24.925363296 +0100
> ***
> *** 416,424 
> 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.
>   - When 'nrformats' includes "octal", Vim considers numbers starting with a 
> '0'
> to be octal, unless the number includes a '8' or '9'.  Other numbers are
> decimal and may have a preceding minus sign.
> --- 416,429 
> additional [count] (so effectively creating a [count]
> decrementing sequence).  {not in Vi}
>
> ! The CTRL-A and CTRL-X commands can work for:
> ! - signed and unsigned decimal numbers
> ! - unsigned binary, octal and hexadecimal numbers
> ! - alphabetic characters
> !
> ! This depends on the 'nrformats' option:
> ! - When 'nrformats' includes "bin", Vim assumes numbers starting with '0b' or
> !   '0B' are binary.
>   - When 'nrformats' includes "octal", Vim considers numbers starting with a 
> '0'
> to be octal, unless the number includes a '8' or '9'.  Other numbers are
> decimal and may have a preceding minus sign.
> ***
> *** 433,439 
> 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
> --- 438,445 
> index.
>
>   For decimals a leading negative sign is considered for incrementing/
> ! decrementing, for binary, octal and hex values, it won't be considered.  To
> ! ignore the sign Visually select the number before using CTRL-A or CTRL-X.
>
>   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
> ***
> *** 446,451 
> --- 452,461 
>   Note that when 'nrformats' includes "octal", decimal numbers with leading
>   zeros cause mistakes, because they can be confused with octal numbers.
>
> + Note similarly, when 'nrformats' includes "bin", binary numbers with a 
> leading
> + '0x' or '0X' can be interpreted as hexadecimal rather than binary since '0b'
> + are valid hexadecimal digits.
> +
>   The CTRL-A command is very useful in a macro.  Example: Use the following
>   steps to make a numbered list.
>
> ***
> *** 1703,1709 
>   found here: |sort()|, |uniq()|.
>
> *:sor* *:sort*
> ! :[range]sor[t][!] [i][u][r][n][x][o] [/{pattern}/]
> Sort lines in [range].  When no range is given all
> lines are sorted.
>
> --- 1745,1751 
>   found here: |sort()|, |uniq()|.
>
> *:sor* *:sort*
> ! :[range]sor[t][!] [i][u][r][n][x][o][b] [/{pattern}/]
> Sort lines in [range].  When no range is given all
> lines are sorted.
>
> ***
> *** 1723,1728 
> --- 1765,1773 
> With [o] sorting is done on the first octal number in
> the line (after or inside a {pattern} match).
>
> +   W

[patch] v:errors is not initialized

2015-12-02 Fir de Conversatie thinca
diff --git a/src/eval.c b/src/eval.c
index a2a9986..d890d39 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -900,6 +900,7 @@ eval_init()
 set_vim_var_nr(VV_SEARCHFORWARD, 1L);
 set_vim_var_nr(VV_HLSEARCH, 1L);
 set_vim_var_dict(VV_COMPLETED_ITEM, dict_alloc());
+set_vim_var_list(VV_ERRORS, list_alloc());
 set_reg_var(0);  /* default for v:register is not 0 but '"' */


--
thinca 

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

2015-12-01 Fir de Conversatie thinca
> Rename the functions to match Vim function style.

The actual function name doesn't change.
--
thinca 


2015-12-01 5:38 GMT+09:00 Bram Moolenaar :
>
> Patch 7.4.945 (after 7.4.944)
> Problem:New style testing is incomplete.
> Solution:   Add the runtest script to the list of distributed files.
> Add the new functions to the function overview.
> Rename the functions to match Vim function style.
> Move undolevels testing into a new style test script.
> Files:  Filelist, runtime/doc/usr_41.txt, runtime/doc/eval.txt,
> src/testdir/test_assert.vim, src/testdir/Makefile,
> src/testdir/test_undolevels.vim, src/testdir/test100.in,
> src/testdir/test100.ok
>
>
> *** ../vim-7.4.944/Filelist 2015-11-02 12:50:49.752534446 +0100
> --- Filelist2015-11-29 17:36:43.198130329 +0100
> ***
> *** 87,92 
> --- 87,93 
> src/testdir/README.txt \
> src/testdir/*.in \
> src/testdir/sautest/autoload/*.vim \
> +   src/testdir/runtest.vim \
> src/testdir/test[0-9]*.ok \
> src/testdir/test[0-9]*a.ok \
> src/testdir/test_[a-z]*.ok \
> *** ../vim-7.4.944/runtime/doc/usr_41.txt   2014-06-17 17:48:21.768628007 
> +0200
> --- runtime/doc/usr_41.txt  2015-11-30 20:43:14.879729497 +0100
> ***
> *** 884,889 
> --- 888,898 
> maparg()get rhs of a mapping
> wildmenumode()  check if the wildmode is active
>
> + Testing:  *test-functions*
> +   assert_equal()  assert that two expressions values are equal
> +   assert_false()  assert that an expression is false
> +   assert_true()   assert that an expression is true
> +
>   Various:  *various-functions*
> mode()  get current editing mode
> visualmode()last visual mode used
> *** ../vim-7.4.944/runtime/doc/eval.txt 2015-11-29 17:34:30.455580245 +0100
> --- runtime/doc/eval.txt2015-11-30 20:42:59.263900121 +0100
> ***
> *** 1380,1386 
>   < "errmsg" also works, for backwards compatibility.
>
> *v:errors* *errors-variable*
> ! v:errors  Errors found by assert functions, such as |assertTrue()|.
> This is a list of strings.
> The assert functions append an item when an assert fails.
> To remove old results make it empty: >
> --- 1380,1386 
>   < "errmsg" also works, for backwards compatibility.
>
> *v:errors* *errors-variable*
> ! v:errors  Errors found by assert functions, such as |assert_true()|.
> This is a list of strings.
> The assert functions append an item when an assert fails.
> To remove old results make it empty: >
> ***
> *** 1740,1752 
>   append( {lnum}, {list})   Number  append lines {list} below 
> line {lnum}
>   argc()Number  number of files in the 
> argument list
>   argidx()  Number  current index in the argument list
> ! arglistid( [{winnr}, [ {tabnr}]])
> Number  argument list id
>   argv( {nr})   String  {nr} entry of the argument list
>   argv( )   Listthe argument list
> ! assertEqual( {exp}, {act})noneassert that {exp} equals {act}
> ! assertFalse( {actual})noneassert that {actual} is false
> ! assertTrue( {actual}) noneassert that {actual} is true
>   asin( {expr}) Float   arc sine of {expr}
>   atan( {expr}) Float   arc tangent of {expr}
>   atan2( {expr}, {expr})Float   arc tangent of {expr1} / 
> {expr2}
> --- 1742,1754 
>   append( {lnum}, {list})   Number  append lines {list} below 
> line {lnum}
>   argc()Number  number of files in the 
> argument list
>   argidx()  Number  current index in the argument list
> ! arglistid( [{winnr} [, {tabnr}]])
> Number  argument list id
>   argv( {nr})   String  {nr} entry of the argument list
>   argv( )   Listthe argument list
> ! assert_equal( {exp}, {act} [, {msg}]) noneassert that {exp} equals {act}
> ! assert_false( {actual} [, {msg}]) noneasser

Re: [patch] Get window local cwd by getcwd()

2015-11-15 Fir de Conversatie thinca
> Can you tell me your real name (assuming thinca is an alias)?

I am already credited as thinca (7.3.788).

-- 
-- 
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] Get window local cwd by getcwd()

2015-11-15 Fir de Conversatie thinca
Hi Bram and list,

I want to get the window local cwd(set by :lcd).
So I wrote a patch.

https://gist.github.com/thinca/9e705a090a56649e7160

And Hirohito Higashi (a.k.a h_east) wrote a test (Thanks!)

https://gist.github.com/h-east/6019b1c8b3a84a67d547

Regards,
--
thinca 

-- 
-- 
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] parsing :command

2015-11-07 Fir de Conversatie thinca
command! -bar F call F()

See :help :command-bar

Regards,

--
thinca 

-- 
-- 
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] :qcuit can take exit code

2014-10-11 Fir de Conversatie thinca
Sorry, I was mistaken in the title and the text of mail.

s/:qcuit/:cquit/
--
thinca 


2014-10-12 14:30 GMT+09:00 thinca :
> Hi, list
>
> :qcuit can quit Vim with exit code 1.  But the exit code cannot change.
> I wrote a patch in which :cquit takes [code] argument.
> Please check.
>
> https://gist.github.com/thinca/5cfc8390d691b8fc5639
>
> Thanks.
>
> --
> thinca 

-- 
-- 
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] :qcuit can take exit code

2014-10-11 Fir de Conversatie thinca
Hi, list

:qcuit can quit Vim with exit code 1.  But the exit code cannot change.
I wrote a patch in which :cquit takes [code] argument.
Please check.

https://gist.github.com/thinca/5cfc8390d691b8fc5639

Thanks.

--
thinca 

-- 
-- 
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: function dict['/foo']() fails

2013-08-04 Fir de Conversatie thinca
hi Bram, please response

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




Re: function dict['/foo']() fails

2013-07-08 Fir de Conversatie thinca
Resend: My post was removed from google groups...

--
This item was removed from todo list.

https://code.google.com/p/vim/source/diff?spec=svnad6996a23e3e63c5495cbb0d4c1447aed068b8c5&old=ceb5f21cda796051585afc665de66c8007f32064&r=ad6996a23e3e63c5495cbb0d4c1447aed068b8c5&format=unidiff&path=%2Fruntime%2Fdoc%2Ftodo.txt

Why?
--
thinca 


2013/7/9 thinca :
> This item was removed from todo list.
>
> https://code.google.com/p/vim/source/diff?spec=svnad6996a23e3e63c5495cbb0d4c1447aed068b8c5&old=ceb5f21cda796051585afc665de66c8007f32064&r=ad6996a23e3e63c5495cbb0d4c1447aed068b8c5&format=unidiff&path=%2Fruntime%2Fdoc%2Ftodo.txt
>
> Why?

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




Re: function dict['/foo']() fails

2013-07-08 Fir de Conversatie thinca
This item was removed from todo list.

https://code.google.com/p/vim/source/diff?spec=svnad6996a23e3e63c5495cbb0d4c1447aed068b8c5&old=ceb5f21cda796051585afc665de66c8007f32064&r=ad6996a23e3e63c5495cbb0d4c1447aed068b8c5&format=unidiff&path=%2Fruntime%2Fdoc%2Ftodo.txt

Why?

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




Re: function dict['/foo']() fails

2013-06-19 Fir de Conversatie thinca
2013/6/18 Bram Moolenaar :
> I do not like the idea of accessing functions with arbitrary names.
>
> I would rather also disallow:
>
>   let dict['/foo'] = function('tr')
>
> Would that break any plugin?

I also use this syntax.

This syntax is useful, for example,

Sinatra like framework:
function! s:get['/']()
  return 'hello'
endfunction
function! s:get['/user/:name'](name)
  return 'hello ' . a:name
endfunction

Another example: Rspec style testing framework:
function! s:it['should be true']()
  call s:assert(1 + 1 == 2)
endfunction

Please rethink.

--
thinca 

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




function dict['/foo']() fails

2013-06-17 Fir de Conversatie thinca
Hi list.

Please see the following code.
--
let dict = {}

function dict['/foo']()
endfunction
" => E475: Invalid argument: /foo

function dict['foo']()
endfunction
" OK.

let dict['/foo'] = function('tr')
function! dict['/foo']()
endfunction
" Overwrite is OK

call dict['/foo']()  " OK.
--

I also expect ":function dict['/foo']()" to be ok.
I write a patch and test for this.

https://gist.github.com/thinca/5797391

However, I am not confident for this patch.
Please check it.

Regards.
--
thinca 

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




Re: backtick should not be matched to wildignore.

2012-07-08 Fir de Conversatie thinca
2012/7/7 Bram Moolenaar :

> This does not appear to be the right solution.  It also affects a
> command like  ":n foo*"  even though that should obey 'wildignore'.

Backtick can avoid any special characters, including wildcard.
Thus, there is no reason for applying 'wildignore'.
":n foo*" does not relate on this discussion.  This is not escaped by backtick.


> Your example is about passing a literal string.  But it might as well be
> an expression that returns a list of file names.  Again, 'wildignore'
> should apply then.

A list of file names is not a wildcard.

  :args `=['a.txt', 'b.bak', 'c.txt']`

This should be equal to:

  :args a.txt b.bak c.txt

Not the following.

  :args a.txt c.txt


> Why would the user want to use backticks instead?

For example, I want to open a new file "file[a].txt".

  :e file[a].txt

This is often successful.  But, if file "filea.txt" exists, Vim opens it.
I try to avoid it by escape.

  :e file\[a].txt

However, this doesn't work well on MS Windows.  "\" is treated as a
directory separator.
Like this, the escape by "\" does not work.  fnameescape() is useless.
I try escape according to advice of ":help wildcard".

  :e file\[[]a].txt

But, this also doesn't work.  I don't know the reason.
Additionally, this way is too complex.
So, I use backtick to avoid this problem.

  :e `='file[a].txt'`

This works well.


Thanks.

--
thinca 

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


:help! makes E478

2012-04-01 Fir de Conversatie thinca
Hi list.

The document of ":help!" says:

> :h[elp]! [subject]  Like ":help", but in non-English help files prefer to
> find a tag in a file with the same language as the
> current file.  See |help-translated|.

[subject] is omitable.  But, ":help!" makes E478.
I think ":help!" should open help.txt with the same language as the
current file.

I wrote a patch for this.

--
diff -r 2cfb68fa26cd src/ex_cmds.c
--- a/src/ex_cmds.c Wed Mar 28 20:51:51 2012 +0200
+++ b/src/ex_cmds.c Sun Apr 01 19:37:13 2012 +0900
@@ -5546,12 +5546,6 @@
}
arg = eap->arg;

-   if (eap->forceit && *arg == NUL)
-   {
-   EMSG(_("E478: Don't panic!"));
-   return;
-   }
-
if (eap->skip)  /* not executing commands */
return;
 }
--


Otherwise, the document should be fixed.

--
diff -r 2cfb68fa26cd runtime/doc/helphelp.txt
--- a/runtime/doc/helphelp.txt  Wed Mar 28 20:51:51 2012 +0200
+++ b/runtime/doc/helphelp.txt  Sun Apr 01 19:39:06 2012 +0900
@@ -92,7 +92,7 @@
:help soonly
 <  {not in Vi}

-:h[elp]! [subject] Like ":help", but in non-English help files prefer to
+:h[elp]! {subject} Like ":help", but in non-English help files prefer to
find a tag in a file with the same language as the
current file.  See |help-translated|.
--


Furthermore, as another proposal, :help behaves like this only when current
buffer is a help buffer.

--
diff -r 2cfb68fa26cd src/ex_cmds.c
--- a/src/ex_cmds.c Wed Mar 28 20:51:51 2012 +0200
+++ b/src/ex_cmds.c Sun Apr 01 19:41:19 2012 +0900
@@ -5546,7 +5546,7 @@
}
arg = eap->arg;

-   if (eap->forceit && *arg == NUL)
+   if (eap->forceit && *arg == NUL && !curbuf->b_help)
{
EMSG(_("E478: Don't panic!"));
return;
--


Which do you like?

--
thinca 

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


Re: Patch for :tabrecently which go to previous recently tab page

2012-01-30 Fir de Conversatie thinca
Sorry, wrong the URL.

https://github.com/thinca/vim-tabrecent
2012/01/31 12:27 "thinca" :

> I wrote a plugin of the similar purpose before.
>
> https://githib.com/thinca/vim-tabrecent
>
> This provides :TabRecent command.
> This can return also to a two or more previous tab.
>

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


Re: Patch for :tabrecently which go to previous recently tab page

2012-01-30 Fir de Conversatie thinca
I wrote a plugin of the similar purpose before.

https://githib.com/thinca/vim-tabrecent

This provides :TabRecent command.
This can return also to a two or more previous tab.

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


[patch] verbose message is truncated strangely

2012-01-17 Fir de Conversatie thinca
hi Bram,

I found a strange behavior in verbose message.
There is a Vim script:
-
function! F()
  return range(13)
endfunction

12verbose call F()
-

This outputs the following. (encoding=utf-8)

-
calling function F
function F returning [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11..., 1, 2,
3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
-

The same parts are repeated.

I wrote a patch for this problem.
Please check and include it.

https://gist.github.com/1625181

diff -r 881236484ca9 src/message.c
--- a/src/message.c Wed Feb 09 11:00:26 2011 +0900
+++ b/src/message.c Tue Jan 17 15:08:09 2012 +0900
@@ -252,6 +252,12 @@
 inti;
 intn;

+if (vim_strsize(s) < room)
+{
+   STRMOVE(buf, s);
+   return;
+}
+
 room -= 3;
 half = room / 2;
 len = 0;

--
thinca 

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