Re: if_mzsch warnings

2016-02-27 Fir de Conversatie Yukihiro Nakadaira
On Sun, Feb 28, 2016 at 11:28 AM, tux. <z...@tuxproject.de> wrote:

> Random warning of the day:
>
> > if_mzsch.c
> > if_mzsch.c(551) : warning C4273:
> 'scheme_external_get_thread_local_variables': Inkonsistente DLL-Bindung.
> >c:\users\hp\desktop\racket-x86\racket\include\schthread.h(450):
> Siehe vorherige Definition von 'scheme_external_get_thread_local_variables'
>

This warning is expected and it is mostly harmless.  I couldn't find a way
to clean it

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: Test_exit_callback fail on Windows CUI

2016-02-25 Fir de Conversatie Yukihiro Nakadaira
On Thu, Feb 25, 2016 at 5:56 AM, Bram Moolenaar <b...@moolenaar.net> wrote:

>
> Yukihiro Nakadaira wrote:
>
> > > > On Wed, Feb 24, 2016 at 8:11 PM, mattn <mattn...@gmail.com> wrote:
> > > >
> > > > > I'm thinking "kill" is not matter for this test because this test
> > > should
> > > > > be checking of exit.
> > > > >
> > > > > diff --git a/src/testdir/test_channel.vim
> > > b/src/testdir/test_channel.vim
> > > > > index 69922b1..e74e54c 100644
> > > > > --- a/src/testdir/test_channel.vim
> > > > > +++ b/src/testdir/test_channel.vim
> > > > > @@ -483,6 +483,7 @@ func Test_exit_callback()
> > > > >if has('job')
> > > > >  call s:run_server('s:test_exit_callback')
> > > > >
> > > > > +call job_stop(s:exit_job, "kill")
> > > > >  " the job may take a little while to exit
> > > > >  sleep 50m
> > > > >
> > > >
> > > > In CUI Vim, job_stop(job, "hup") doesn't work because AttachConsole()
> > > fails.
> > > > The following patch might fix it.  Job process is created in same
> > > console.
> > > > I'm not sure if it doesn't causes another problem.
> > >
> > > There is a todo item to make it possible to start a terminal for the
> job
> > > to run in.  This is especially useful if the job produces some output
> > > and perhaps even prompts for input.  We don't want that to get mixed up
> > > with the Vim display.
> > >
> > > So hopefully we can make both work.  This would require the job to be
> > > started with a socket, so its stdin/stdout go to the terminal.
> > >
> >
> > I see.  So "kill" is a simple solution.
>
> I'm wondering, if this test fails because the job didn't finish yet,
> don't we have the same problem with every other test, since they all
> start the server?
>
> It seems that the default behavior for mch_stop_job() is being too
> gentle.  And it only has "kill" and everything else.  And that means
> sending CTRL_C_EVENT or CTRL_BREAK_EVENT.
>
> Perhaps we should make the default behave like "kill" and only have
> "hup" and "int" send an event?  The default is actually supposed to be
> the same as "term", which for MS-Windows probably is the same as "kill".
>

I agree with you to make "kill" default.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: Test_exit_callback fail on Windows CUI

2016-02-24 Fir de Conversatie Yukihiro Nakadaira
On Wed, Feb 24, 2016 at 11:54 PM, Bram Moolenaar <b...@moolenaar.net> wrote:

>
> Yukihiro Nakadaira wrote:
>
> > On Wed, Feb 24, 2016 at 8:11 PM, mattn <mattn...@gmail.com> wrote:
> >
> > > I'm thinking "kill" is not matter for this test because this test
> should
> > > be checking of exit.
> > >
> > > diff --git a/src/testdir/test_channel.vim
> b/src/testdir/test_channel.vim
> > > index 69922b1..e74e54c 100644
> > > --- a/src/testdir/test_channel.vim
> > > +++ b/src/testdir/test_channel.vim
> > > @@ -483,6 +483,7 @@ func Test_exit_callback()
> > >if has('job')
> > >  call s:run_server('s:test_exit_callback')
> > >
> > > +call job_stop(s:exit_job, "kill")
> > >  " the job may take a little while to exit
> > >  sleep 50m
> > >
> >
> > In CUI Vim, job_stop(job, "hup") doesn't work because AttachConsole()
> fails.
> > The following patch might fix it.  Job process is created in same
> console.
> > I'm not sure if it doesn't causes another problem.
>
> There is a todo item to make it possible to start a terminal for the job
> to run in.  This is especially useful if the job produces some output
> and perhaps even prompts for input.  We don't want that to get mixed up
> with the Vim display.
>
> So hopefully we can make both work.  This would require the job to be
> started with a socket, so its stdin/stdout go to the terminal.
>

I see.  So "kill" is a simple solution.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: Test_exit_callback fail on Windows CUI

2016-02-24 Fir de Conversatie Yukihiro Nakadaira
On Wed, Feb 24, 2016 at 8:11 PM, mattn <mattn...@gmail.com> wrote:

> I'm thinking "kill" is not matter for this test because this test should
> be checking of exit.
>
> diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
> index 69922b1..e74e54c 100644
> --- a/src/testdir/test_channel.vim
> +++ b/src/testdir/test_channel.vim
> @@ -483,6 +483,7 @@ func Test_exit_callback()
>if has('job')
>  call s:run_server('s:test_exit_callback')
>
> +call job_stop(s:exit_job, "kill")
>  " the job may take a little while to exit
>  sleep 50m
>

In CUI Vim, job_stop(job, "hup") doesn't work because AttachConsole() fails.
The following patch might fix it.  Job process is created in same console.
I'm
not sure if it doesn't causes another problem.

diff --git a/src/os_win32.c b/src/os_win32.c
index e93e6d0..5c45ff2 100644
--- a/src/os_win32.c
+++ b/src/os_win32.c
@@ -5071,8 +5071,7 @@ mch_start_job(char *cmd, job_T *job, jobopt_T
*options)
 if (!vim_create_process(cmd, TRUE,
  CREATE_SUSPENDED |
  CREATE_DEFAULT_ERROR_MODE |
- CREATE_NEW_PROCESS_GROUP |
- CREATE_NEW_CONSOLE,
+ CREATE_NEW_PROCESS_GROUP,
  , ))
 {
  CloseHandle(jo);
@@ -5152,13 +5151,17 @@ mch_stop_job(job_T *job, char_u *how)
  return TerminateProcess(job->jv_proc_info.hProcess, 0) ? OK : FAIL;
 }

+#ifdef FEAT_GUI_W32
 if (!AttachConsole(job->jv_proc_info.dwProcessId))
  return FAIL;
+#endif
 ret = GenerateConsoleCtrlEvent(
  ctrl_c ? CTRL_C_EVENT : CTRL_BREAK_EVENT,
  job->jv_proc_info.dwProcessId)
  ? OK : FAIL;
+#ifdef FEAT_GUI_W32
 FreeConsole();
+#endif
 return ret;
 }


-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: test_channel.vim fails with Win32 CUI Vim

2016-02-22 Fir de Conversatie Yukihiro Nakadaira
On Mon, Feb 22, 2016 at 9:27 PM, Bram Moolenaar <b...@moolenaar.net> wrote:

>
> Yukihiro Nakadaira wrote:
>
> > > > test_channel.vim fails with Win32 CUI Vim.
> > > >
> > > > What the following patch fix is
> > > > 1. Vim sleep 5 msec even when timeout=0.
> > > > 2. channel_handle_events() closes channel when there is no input.
> > > > 3. ":sleep" command does not read channel (I am not sure where is the
> > > right
> > > >place to call channel_handle_events()).
> > >
> > > Thanks!
> > >
> > > For Unix checking for events happens in mch_breakcheck().  And any
> other
> > > place where RealWaitForChar() is called.
> > >
> > > I hesitate to add channel_handle_events() in mch_breakcheck, it might
> be
> > > too slow.  Perhaps it's better to put it inside
> parse_queued_messages().
> > > That sort of makes sense.  And we can remove the other calls to
> > > channel_handle_events() since parse_queued_messages() is called there
> > > already.  They were actually in the wrong order.
> > >
> > > Let me make that change.  Please check if it works.
> >
> > It works fine.
> >
> >
> > > Did you look at the problem that ch_read() doesn't timeout for Win32?
> > > It's disabled in the test for now.
> > >
> >
> > To implement timeout, we need to use select() instead of
> WSAAsyncSelect().
> > Patch is attached.  With this patch, Vim checks channel each 100
> > milliseconds while waiting window message.
>
> Hmm, this completely removes the asynchronous handling of messages.
> That is strange, I thought we needed that.
>
> Can't we have both asynchronous handling as soon as a message arrives,
> and another way to wait for something to arrive in ch_read()?
> I suppose that instead of using select() we would use pPeekMessage() and
> loop with a short sleep in channel_wait(), like we do for pipes.
>

I tried loop with PeekMessage() but I could not figure out how to implement
it
when there is multiple channel.

I also tried recv() with MSG_PEEK, but it did not work.

I think my patch is not so different because WM_NETBEANS is handled only
when
we call GetMessage().  Maybe we also need to call channel_handle_events() in
gui_mch_update() to make it same with current behavior.

Perhaps we can use Overlapped I/O to wait both channel and message without
delay.

Channel polling in the message loop is also required for pipe.  Because
WSAAsyncSelect() can not handle pipe.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


test_channel.vim fails with Win32 CUI Vim

2016-02-21 Fir de Conversatie Yukihiro Nakadaira
test_channel.vim fails with Win32 CUI Vim.

What the following patch fix is
1. Vim sleep 5 msec even when timeout=0.
2. channel_handle_events() closes channel when there is no input.
3. ":sleep" command does not read channel (I am not sure where is the right
   place to call channel_handle_events()).

diff --git a/src/channel.c b/src/channel.c
index aa478f1..84356c9 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -1582,7 +1582,7 @@ channel_wait(channel_T *channel, sock_T fd, int
timeout)
  && nread > 0)
   return OK;
  diff = deadline - GetTickCount();
- if (diff < 0)
+ if (diff <= 0)
   break;
  /* Wait for 5 msec.
   * TODO: increase the sleep time when looping more often */
@@ -1887,11 +1887,7 @@ channel_handle_events(void)
 {
 channel_T *channel;
 int  part;
-static int loop = 0;
-
-/* Skip heavily polling */
-if (loop++ % 2)
- return;
+sock_T fd;

 for (channel = first_channel; channel != NULL; channel =
channel->ch_next)
 {
@@ -1907,7 +1903,11 @@ channel_handle_events(void)
  part = PART_SOCK;
 #   endif
 #  endif
- channel_read(channel, part, "channel_handle_events");
+ {
+ fd = channel->ch_part[part].ch_fd;
+ if (fd != INVALID_FD && channel_wait(channel, fd, 0) == OK)
+  channel_read(channel, part, "channel_handle_events");
+ }
 }
 }
 # endif
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 1321b7f..5b4c6ed 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -8904,6 +8904,9 @@ do_sleep(long msec)
 {
  ui_delay(msec - done > 1000L ? 1000L : msec - done, TRUE);
  ui_breakcheck();
+#ifdef FEAT_CHANNEL
+ channel_handle_events();
+#endif
 #ifdef MESSAGE_QUEUE
  /* Process the netbeans and clientserver messages that may have been
   * received in the call to ui_breakcheck() when the GUI is in use. This


-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


Crash with channel

2016-02-15 Fir de Conversatie Yukihiro Nakadaira
Steps to reproduce:
  :" 1
  :echo ch_open("noserver")

  :" 2
  :let c = ch_open("noserver")
  :let d = c


There is no NULL check for fail channel.
And two typos in message.

diff --git a/src/channel.c b/src/channel.c
index d5d7ffb..003c933 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -634,7 +634,7 @@ channel_open(char *hostname, int port_in, int waittime,
void (*close_cb)(void))
  {
   /* Get here when the server can't be found. */
   ch_error(NULL, "Cannot connect to port after retry\n");
-  PERROR(_("E899: Cannot connect to port after retry2"));
+  PERROR(_("E899: Cannot connect to port after retry"));
   sock_close(sd);
   channel_free(channel);
   return NULL;
@@ -1220,7 +1220,7 @@ channel_status(channel_T *channel)
 void
 channel_close(channel_T *channel)
 {
-ch_log(channel, "Closing channel");
+ch_log(channel, "Closing channel\n");

 #ifdef FEAT_GUI
 channel_gui_unregister(channel);
diff --git a/src/eval.c b/src/eval.c
index a90dd0b..e071085 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -21828,7 +21828,10 @@ get_tv_string_buf_chk(typval_T *varp, char_u *buf)
   channel_T *channel = varp->vval.v_channel;
   char  *status = channel_status(channel);

-  vim_snprintf((char *)buf, NUMBUFLEN,
+  if (channel == NULL)
+  vim_snprintf((char *)buf, NUMBUFLEN, "channel %s", status);
+  else
+  vim_snprintf((char *)buf, NUMBUFLEN,
  "channel %d %s", channel->ch_id, status);
   return buf;
  }
@@ -22466,8 +22469,13 @@ copy_tv(typval_T *from, typval_T *to)
 #endif
  case VAR_CHANNEL:
 #ifdef FEAT_CHANNEL
- to->vval.v_channel = from->vval.v_channel;
- ++to->vval.v_channel->ch_refcount;
+ if (from->vval.v_channel == NULL)
+  to->vval.v_channel = NULL;
+ else
+ {
+  to->vval.v_channel = from->vval.v_channel;
+  ++to->vval.v_channel->ch_refcount;
+ }
  break;
 #endif
  case VAR_STRING:


-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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

2016-02-13 Fir de Conversatie Yukihiro Nakadaira
On Sat, Feb 13, 2016 at 5:36 AM, Christian Brabandt <cbli...@256bit.org>
wrote:

> Hi Bram!
>
> On Fr, 12 Feb 2016, Bram Moolenaar wrote:
>
> >
> > Patch 7.4.1306
> > Problem:Job control doesn't work well on MS-Windows.
> > Solution:   Various fixes. (Ken Takata, Ozaki Kiichi , Yukihiro
> Nakadaira,
> > Yasuhiro Matsumoto)
> > Files:  src/Make_mvc.mak, src/eval.c, src/os_unix.c, src/os_win32.c,
> > src/proto/os_unix.pro, src/proto/os_win32.pro, src/structs.h
>
> This patch breaks appveyor (I assume the test_channel test)
> https://ci.appveyor.com/project/chrisbra/vim/build/602
>

Crash is caused by WM_NETBEANS message issued by WSAAsyncSelect().


let h = job_start('py testdir/test_channel.py')
let port = []
sleep 1
let port = readfile('Xportnr')
call delete('Xportnr')
let c = ch_open('localhost:' . port[0])

echo ch_sendexpr(c, 'hello!')
" => request(hello!)
" <= response(got it) (Raise WM_NETBEANS and it remains in message
queue)

call job_stop(h)
" Remote socket is closed.

":sleep 1
" Catch WM_NETBEANS.  But socket is already closed.
" E896: read from channel: A non-blocking socket operation could not be
completed immediately.

for i in range(1000)
  try
throw "err"
  catch
" When WM_NETBEANS is catched in ex_catch(), it breaks memory.
"   ex_catch():
"   1585 caught = vim_regexec_nl(,
current_exception->value,
"   1586 (colnr_T)0);
" gui_mch_update() is executed in vim_regexec_nl().  And error is
thrown.
"   read_channel():
"   1262 PERROR(_("E896: read from channel"));
" And current_exception is free()ed.
"   cause_errthrow():
"   228 discard_current_exception();
" And the freed memory is used later.
  endtry
endfor


-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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

2016-02-13 Fir de Conversatie Yukihiro Nakadaira
On Sat, Feb 13, 2016 at 8:20 PM, Yukihiro Nakadaira <
yukihiro.nakada...@gmail.com> wrote:

> On Sat, Feb 13, 2016 at 5:36 AM, Christian Brabandt <cbli...@256bit.org>
> wrote:
>
>> Hi Bram!
>>
>> On Fr, 12 Feb 2016, Bram Moolenaar wrote:
>>
>> >
>> > Patch 7.4.1306
>> > Problem:Job control doesn't work well on MS-Windows.
>> > Solution:   Various fixes. (Ken Takata, Ozaki Kiichi , Yukihiro
>> Nakadaira,
>> > Yasuhiro Matsumoto)
>> > Files:  src/Make_mvc.mak, src/eval.c, src/os_unix.c, src/os_win32.c,
>> > src/proto/os_unix.pro, src/proto/os_win32.pro,
>> src/structs.h
>>
>> This patch breaks appveyor (I assume the test_channel test)
>> https://ci.appveyor.com/project/chrisbra/vim/build/602
>>
>
> Crash is caused by WM_NETBEANS message issued by WSAAsyncSelect().
>
>
> let h = job_start('py testdir/test_channel.py')
> let port = []
> sleep 1
> let port = readfile('Xportnr')
> call delete('Xportnr')
> let c = ch_open('localhost:' . port[0])
>
> echo ch_sendexpr(c, 'hello!')
> " => request(hello!)
> " <= response(got it) (Raise WM_NETBEANS and it remains in message
> queue)
>
> call job_stop(h)
> " Remote socket is closed.
>
> ":sleep 1
> " Catch WM_NETBEANS.  But socket is already closed.
> " E896: read from channel: A non-blocking socket operation could not be
> completed immediately.
>
> for i in range(1000)
>   try
> throw "err"
>   catch
> " When WM_NETBEANS is catched in ex_catch(), it breaks memory.
> "   ex_catch():
> "   1585 caught = vim_regexec_nl(,
> current_exception->value,
> "   1586 (colnr_T)0);
> " gui_mch_update() is executed in vim_regexec_nl().  And error is
> thrown.
> "   read_channel():
> "   1262 PERROR(_("E896: read from channel"));
> " And current_exception is free()ed.
> "   cause_errthrow():
> "   228 discard_current_exception();
> " And the freed memory is used later.
>   endtry
> endfor
>


Maybe this patch fix this problem.
Error is still shown.  But it might implies script or server bug.

diff --git a/src/gui_w48.c b/src/gui_w48.c
index 7789ef2..f2d2091 100644
--- a/src/gui_w48.c
+++ b/src/gui_w48.c
@@ -1783,7 +1783,14 @@ process_message(void)
  int channel_idx = channel_socket2idx((sock_T)msg.wParam);

  if (channel_idx >= 0)
+{
+ int suppress_errthrow_save;
+
+ suppress_errthrow_save = suppress_errthrow;
+ suppress_errthrow = TRUE;
  channel_read(channel_idx);
+ suppress_errthrow = suppress_errthrow_save;
+}
  return;
 }
 #endif





-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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

2016-02-13 Fir de Conversatie Yukihiro Nakadaira
On Sun, Feb 14, 2016 at 2:31 AM, Bram Moolenaar <b...@moolenaar.net> wrote:

>
> Yukihiro Nakadaira wrote:
>
> > On Sat, Feb 13, 2016 at 8:20 PM, Yukihiro Nakadaira <
> > yukihiro.nakada...@gmail.com> wrote:
> >
> > > On Sat, Feb 13, 2016 at 5:36 AM, Christian Brabandt <
> cbli...@256bit.org>
> > > wrote:
> > >
> > >> Hi Bram!
> > >>
> > >> On Fr, 12 Feb 2016, Bram Moolenaar wrote:
> > >>
> > >> >
> > >> > Patch 7.4.1306
> > >> > Problem:Job control doesn't work well on MS-Windows.
> > >> > Solution:   Various fixes. (Ken Takata, Ozaki Kiichi , Yukihiro
> > >> Nakadaira,
> > >> > Yasuhiro Matsumoto)
> > >> > Files:  src/Make_mvc.mak, src/eval.c, src/os_unix.c,
> src/os_win32.c,
> > >> > src/proto/os_unix.pro, src/proto/os_win32.pro,
> > >> src/structs.h
> > >>
> > >> This patch breaks appveyor (I assume the test_channel test)
> > >> https://ci.appveyor.com/project/chrisbra/vim/build/602
> > >>
> > >
> > > Crash is caused by WM_NETBEANS message issued by WSAAsyncSelect().
> > >
> > >
> > > let h = job_start('py testdir/test_channel.py')
> > > let port = []
> > > sleep 1
> > > let port = readfile('Xportnr')
> > > call delete('Xportnr')
> > > let c = ch_open('localhost:' . port[0])
> > >
> > > echo ch_sendexpr(c, 'hello!')
> > > " => request(hello!)
> > > " <= response(got it) (Raise WM_NETBEANS and it remains in message
> > > queue)
> > >
> > > call job_stop(h)
> > > " Remote socket is closed.
> > >
> > > ":sleep 1
> > > " Catch WM_NETBEANS.  But socket is already closed.
> > > " E896: read from channel: A non-blocking socket operation could not be
> > > completed immediately.
> > >
> > > for i in range(1000)
> > >   try
> > > throw "err"
> > >   catch
> > > " When WM_NETBEANS is catched in ex_catch(), it breaks memory.
> > > "   ex_catch():
> > > "   1585 caught = vim_regexec_nl(,
> > > current_exception->value,
> > > "   1586 (colnr_T)0);
> > > " gui_mch_update() is executed in vim_regexec_nl().  And error is
> > > thrown.
> > > "   read_channel():
> > > "   1262 PERROR(_("E896: read from channel"));
> > > " And current_exception is free()ed.
> > > "   cause_errthrow():
> > > "   228 discard_current_exception();
> > > " And the freed memory is used later.
> > >   endtry
> > > endfor
> > >
> >
> >
> > Maybe this patch fix this problem.
> > Error is still shown.  But it might implies script or server bug.
> >
> > diff --git a/src/gui_w48.c b/src/gui_w48.c
> > index 7789ef2..f2d2091 100644
> > --- a/src/gui_w48.c
> > +++ b/src/gui_w48.c
> > @@ -1783,7 +1783,14 @@ process_message(void)
> >   int channel_idx = channel_socket2idx((sock_T)msg.wParam);
> >
> >   if (channel_idx >= 0)
> > +{
> > + int suppress_errthrow_save;
> > +
> > + suppress_errthrow_save = suppress_errthrow;
> > + suppress_errthrow = TRUE;
> >   channel_read(channel_idx);
> > + suppress_errthrow = suppress_errthrow_save;
> > +}
> >   return;
> >  }
> >  #endif
>
> Thanks for the explanation.  Doing this low-level exception stuff here
> doesn't seem right.  Perhaps this works:
>
> if (channel_idx >= 0)
> {
> /* Disable error messages, they can mess up the display and
> throw
>  * an exception. */
> ++emsg_off;
> channel_read(channel_idx, FALSE, "process_message");
> --emsg_off;
> }
>
> I'll try it out.  Now that the log is implement that can be used to find
> communication errors, instead of displaying them.  That can happen at
> any time and interrupt what the user was doing.
>
> Hmm, I can't seem to reproduce the problem anymore.  The changes I made
> to support pipes may have fixed the problem as a side effect.
>
> You mention "freed memory is used later", is there another problem that
> should be fixed?
>

No, there isn't.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


www.vim.org "Thanks to..."

2016-01-29 Fir de Conversatie Yukihiro Nakadaira
At bottom of http://www.vim.org/

"Thanks to:   VPS en Nubevps: Servidor Virtual Cloud   |   Website
Monitoring Provided by UptimePal   |   Taylor Hill at Fame Bible   |   Do
My Essay: Dissertation Writings Help"

Is it ad or hacked?

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: www.vim.org "Thanks to..."

2016-01-29 Fir de Conversatie Yukihiro Nakadaira
On Sat, Jan 30, 2016 at 5:09 AM, Bram Moolenaar <b...@moolenaar.net> wrote:

>
> Yukihiro Nakadaira wrote:
>
> > At bottom of http://www.vim.org/
> >
> > "Thanks to:   VPS en Nubevps: Servidor Virtual Cloud   |   Website
> > Monitoring Provided by UptimePal   |   Taylor Hill at Fame Bible   |   Do
> > My Essay: Dissertation Writings Help"
> >
> > Is it ad or hacked?
>
> These are "sponsored links".  It generates money for the project in
> Uganda.  At the current rate we help about five children to join
> primary school.
>

I got it. Thank  you.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


Empty key in JSON

2016-01-26 Fir de Conversatie Yukihiro Nakadaira
:echo jsondecode('{"":"x"}')
E713: Cannot use empty key for Dictionary

Will Vim allow empty key?

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: Empty key in JSON

2016-01-26 Fir de Conversatie Yukihiro Nakadaira
On Tue, Jan 26, 2016 at 10:29 PM, Bram Moolenaar <b...@moolenaar.net> wrote:

>
> Yukihiro Nakadaira wrote:
>
> > :echo jsondecode('{"":"x"}')
> > E713: Cannot use empty key for Dictionary
> >
> > Will Vim allow empty key?
>
> Hmm, if you take the standard literally I suppose it allows for an empty
> key.  In practice it's an indication something went wrong.
>
> Why are you asking, do you see a practical application for it?
>

I don't know practical example in JSON.

In Vim script, counting line is a possible example.

let d = {}
for line in getline(1, '$')
  let d[line] = get(d, line, 0) + 1
endfor
for line in getline(1, '$')
  if d[line] == 1
do something
  else
do something
  endif
endfor

Patience diff algorithm uses such a method, for example.

https://github.com/ynkdir/vim-diff/blob/master/autoload/diff/patience.vim

Although, there is a workaround like d['x'.line] = ...


> The standard also allows for duplicate names, even though in practice
> that doesn't work.  So even though it's valid JSON, it doesn't mean it's
> a valid value after converting from JSON to Vim types.
>
> So the error is actually correct, it's not saying the JSON is invalid,
> it's saying the result in Vim types is invalid.
>

I see.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


test92 and test93 fails in non utf-8 locale.

2016-01-17 Fir de Conversatie Yukihiro Nakadaira
In Japanese Windows, test92 and test93 fails when using gvim.

  vim/src/testdir> nmake -f Make_dos.mak VIMPROG=..\gvim

Test script convert newline from unix to dos with this command.

  ..\gvim -u dos.vim --noplugin "+set ff=dos|f dostmp\test92.in|wq"
test92.in

Test92 and test93 has modeline setting 'fenc' option.

 vim: set ft=vim fenc=utf-8:

If ~/_gvimrc exists,  Vim sets 'nocompatible' and 'modeline'.  and 'fenc' is
set to utf-8 by modeline.  Then ":wq" (cp932 to utf-8 conversion) fails.

Adding "-U NONE" fixes this problem.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak
index 47f9d22..8055e47 100644
--- a/src/testdir/Make_dos.mak
+++ b/src/testdir/Make_dos.mak
@@ -38,7 +38,7 @@ win32:nolog $(SCRIPTS_FIRST) $(SCRIPTS) 
$(SCRIPTS_WIN32) newtests report
 $(DOSTMP_INFILES): $(*B).in
if not exist $(DOSTMP)\NUL md $(DOSTMP)
if exist $@ del $@
-   $(VIMPROG) -u dos.vim --noplugin "+set ff=dos|f $@|wq" $(*B).in
+   $(VIMPROG) -u dos.vim -U NONE --noplugin "+set ff=dos|f $@|wq" $(*B).in
 
 # For each input file dostmp/test99.in run the tests.
 # This moves test99.in to test99.in.bak temporarily.
@@ -55,7 +55,7 @@ $(TEST_OUTFILES): $(DOSTMP)\$(*B).in
-@if exist Xfind rd /s /q Xfind
-@del X*
-@if exist viminfo del viminfo
-   $(VIMPROG) -u dos.vim --noplugin "+set ff=unix|f test.out|wq" \
+   $(VIMPROG) -u dos.vim -U NONE --noplugin "+set ff=unix|f test.out|wq" \
$(DOSTMP)\$(*B).out
@diff test.out $*.ok & if errorlevel 1 \
( move /y test.out $*.failed \
@@ -113,4 +113,4 @@ bench_re_freeze.out: bench_re_freeze.vim
 newtests: $(NEW_TESTS)
 
 .vim.res:
-   $(VIMPROG) -u NONE -S runtest.vim $*.vim
+   $(VIMPROG) -u NONE -U NONE -S runtest.vim $*.vim
diff --git a/src/testdir/Make_ming.mak b/src/testdir/Make_ming.mak
index b4ebaeb..d0b088c 100644
--- a/src/testdir/Make_ming.mak
+++ b/src/testdir/Make_ming.mak
@@ -65,8 +65,8 @@ win32:fixff $(SCRIPTS_FIRST) $(SCRIPTS) 
$(SCRIPTS_WIN32)
echo ALL DONE
 
 fixff:
-   -$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=dos|upd" +q *.in *.ok
-   -$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=unix|upd" +q \
+   -$(VIMPROG) -u dos.vim -U NONE --noplugin "+argdo set ff=dos|upd" +q 
*.in *.ok
+   -$(VIMPROG) -u dos.vim -U NONE --noplugin "+argdo set ff=unix|upd" +q \
dotest.in test60.ok test71.ok test74.ok test_listchars.ok
 
 clean:
diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms
index 9a93e21..17b7429 100644
--- a/src/testdir/Make_vms.mms
+++ b/src/testdir/Make_vms.mms
@@ -163,7 +163,7 @@ SCRIPT_PYTHON = test86.out test87.out
-@ write sys$output ""$*" "
-@ write sys$output "---"
-@ !run the test
-   -@ create/term/wait/nodetach mcr $(VIMPROG) $(GUI_OPTION) -u vms.vim 
--noplugin -s dotest.in $*.in
+   -@ create/term/wait/nodetach mcr $(VIMPROG) $(GUI_OPTION) -u vms.vim -U 
NONE --noplugin -s dotest.in $*.in
-@ !analyse the result
-@ directory /size/date test.out
-@ if "''F$SEARCH("test.out.*")'" .NES. "" then rename/nolog test.out 
$*.out 
diff --git a/src/testdir/Makefile b/src/testdir/Makefile
index 8f321b5..6d98a80 100644
--- a/src/testdir/Makefile
+++ b/src/testdir/Makefile
@@ -127,4 +127,4 @@ newtestssilent: $(NEW_TESTS)
 
 
 .vim.res:
-   $(RUN_VIMTEST) -u NONE -S runtest.vim $*.vim
+   $(RUN_VIMTEST) -u NONE -U NONE -S runtest.vim $*.vim


Re: if_mzscheme does not work.

2016-01-16 Fir de Conversatie Yukihiro Nakadaira
On Sat, Jan 16, 2016 at 9:42 PM, Bram Moolenaar <b...@moolenaar.net> wrote:

>
> Yukihiro Nakadaira wrote:
>
> > On Fri, Jan 15, 2016 at 12:10 AM, Ken Takata <ktakata65...@gmail.com>
> wrote:
> >
> > > Hi,
> > >
> > > 2016/1/14 Thu 13:01:28 UTC+9 Yukihiro Nakadaira wrote:
> > > > Thank you.  I merged
> > > >
> > >
> https://bitbucket.org/k_takata/vim-ktakata-mq/raw/d2b34c2918f89b9fb6caf6043ea2ab6622632d11/mzscheme_collects_and_mingw.patch
> > > >
> > >
> https://bitbucket.org/k_takata/vim-ktakata-mq/raw/d2b34c2918f89b9fb6caf6043ea2ab6622632d11/mzscheme_base_module.patch
> > > > and created merged patch if_mzscheme5.diff.
> > > >
> > > > if_mzscheme now uses racket/base module and falls back to
> scheme/base if
> > > it doesn't exist.
> > >
> > > I wrote a patch for src/INSTALLpc.txt:
> > >
> > >
> https://bitbucket.org/k_takata/vim-ktakata-mq/src/23061ff5facacdf82768e6516bd75c42c4917a37/mzscheme_installpc.patch?fileviewer=file-view-default
> > >
> > > Please review.
> > >
> >
> > Thank you.  I merged it in my patch.
> >
> > And I updated patch for crash in appveyor test.  I guess Racket is using
> > thread internally and it is broken by unloading the dll when exiting.
> So I
> > changed if_zscheme to not unload the dll.
> >
> > The latest patch if_mzscheme6.diff is attached.
>
> Thanks.  Is this ready to be included now?
>

Yes, it is.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: if_mzscheme does not work.

2016-01-15 Fir de Conversatie Yukihiro Nakadaira
On Fri, Jan 15, 2016 at 12:10 AM, Ken Takata <ktakata65...@gmail.com> wrote:

> Hi,
>
> 2016/1/14 Thu 13:01:28 UTC+9 Yukihiro Nakadaira wrote:
> > Thank you.  I merged
> >
> https://bitbucket.org/k_takata/vim-ktakata-mq/raw/d2b34c2918f89b9fb6caf6043ea2ab6622632d11/mzscheme_collects_and_mingw.patch
> >
> https://bitbucket.org/k_takata/vim-ktakata-mq/raw/d2b34c2918f89b9fb6caf6043ea2ab6622632d11/mzscheme_base_module.patch
> > and created merged patch if_mzscheme5.diff.
> >
> > if_mzscheme now uses racket/base module and falls back to scheme/base if
> it doesn't exist.
>
> I wrote a patch for src/INSTALLpc.txt:
>
> https://bitbucket.org/k_takata/vim-ktakata-mq/src/23061ff5facacdf82768e6516bd75c42c4917a37/mzscheme_installpc.patch?fileviewer=file-view-default
>
> Please review.
>

Thank you.  I merged it in my patch.

And I updated patch for crash in appveyor test.  I guess Racket is using
thread internally and it is broken by unloading the dll when exiting.  So I
changed if_zscheme to not unload the dll.

The latest patch if_mzscheme6.diff is attached.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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/if_mzsch.txt b/runtime/doc/if_mzsch.txt
index b42570a..1da8ccc 100644
--- a/runtime/doc/if_mzsch.txt
+++ b/runtime/doc/if_mzsch.txt
@@ -1,4 +1,4 @@
-*if_mzsch.txt*  For Vim version 7.4.  Last change: 2012 Dec 17
+*if_mzsch.txt*  For Vim version 7.4.  Last change: 2016 Jan 10
 
 
  VIM REFERENCE MANUALby Sergey Khorev
@@ -13,6 +13,7 @@ The MzScheme Interface to Vim 
*mzscheme* *MzScheme*
 5. mzeval() Vim function   |mzscheme-mzeval|
 6. Using Function references   |mzscheme-funcref|
 7. Dynamic loading |mzscheme-dynamic|
+8. MzScheme setup  |mzscheme-setup|
 
 {Vi does not have any of these commands}
 
@@ -272,6 +273,9 @@ output then includes |+mzscheme/dyn|.
 This means that Vim will search for the MzScheme DLL files only when needed.
 When you don't use the MzScheme interface you don't need them, thus you can
 use Vim without these DLL files.
+NOTE: Newer version of MzScheme (Racket) require earlier (trampolined)
+initialisation via scheme_main_setup.  So Vim always load MzScheme DLL at
+startup if possible.
 
 To use the MzScheme interface the MzScheme DLLs must be in your search path.
 In a console window type "path" to see what directories are used.
@@ -282,5 +286,24 @@ For MzScheme version 209 they will be 
"libmzsch209_000.dll" and
 command, look for -DDYNAMIC_MZSCH_DLL="something" and
 -DDYNAMIC_MZGC_DLL="something" in the "Compilation" info.
 
+For example, if MzScheme (Racket) is installed at C:\Racket63, you may need
+to set the environment variable as the following: >
+
+  PATH=%PATH%;C:\Racket63\lib
+  PLTCOLLECTS=C:\Racket63\collects
+  PLTCONFIGDIR=C:\Racket63\etc
+<
+==
+8. MzScheme setup  *mzscheme-setup*
+
+Vim requires "racket/base" module for if_mzsch core (fallback to "scheme/base"
+if it doesn't exist), "r5rs" module for test and "raco ctool" command for
+building Vim.  If MzScheme did not have them, you can install them with
+MzScheme's raco command:
+>
+  raco pkg install scheme-lib   # scheme/base module
+  raco pkg install r5rs-lib # r5rs module
+  raco pkg install cext-lib # raco ctool command
+<
 ==
   vim:tw=78:ts=8:sts=4:ft=help:norl:
diff --git a/src/INSTALLpc.txt b/src/INSTALLpc.txt
index 384..8c68895 100644
--- a/src/INSTALLpc.txt
+++ b/src/INSTALLpc.txt
@@ -24,7 +24,7 @@ Contents:
 5. Cross compiling for Win32 from a Linux machine
 6. Building with Python support
 7. Building with Python3 support
-8. Building with MzScheme support
+8. Building with MzScheme/Racket support
 9. Building with Lua support
 10. Building with Perl support
 11. Building with Ruby support
@@ -415,8 +415,10 @@ E.g. When using MSVC (as one line):
 PYTHON3=C:\Python34 DYNAMIC_PYTHON3=yes PYTHON3_VER=34
 
 
-8. Building with MzScheme support
-=
+8. Building with MzScheme/Racket support
+
+
+1) Building with MzScheme support
 
 (written by 

Re: if_mzscheme does not work.

2016-01-13 Fir de Conversatie Yukihiro Nakadaira
On Wed, Jan 13, 2016 at 9:39 PM, Ken Takata <ktakata65...@gmail.com> wrote:

> Hi Yukihiro,
>
> 2016/1/10 Sun 17:51:27 UTC+9 Yukihiro Nakadaira wrote:
> > On Sun, Jan 10, 2016 at 3:31 AM, Sergey Khorev <sergey...@gmail.com>
> wrote:
> >
> > Yukihiro-san,
> >
> >
> > I gave up on catching up Racket updates in if_mzscheme so the interface
> has been broken for some time now. Your patch seems to finally fix the
> issues I encounterred (tested on Arch successfully), many thanks for that.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > With this change, test70 still fails because test70 uses r5rs module and
> Minimal
> > Racket doesn't have it.
> >
> >
> > This was solved by
> > raco.exe pkg install scheme-lib
> > raco.exe pkg install r5rs-lib
> >
> >
> >
> >
> > Don't you think this should be included in the documentation?
> >
> >
> > Thank you for your suggestion.  I have added documentation for it.
> >
> >
> > ```
> > 8. MzScheme setup*mzscheme-setup*
> >
> >
> > Vim requires "scheme/base" module for if_mzsch core, "r5rs" module for
> test
> > and "raco ctool" command for building Vim.  If MzScheme did not have
> them, you
> > can install them with MzScheme's raco command:
> >
> >
> >   raco pkg install scheme-lib   # scheme/base module
> >   raco pkg install r5rs-lib # r5rs module
> >   raco pkg install cext-lib # raco ctool command
> > ```
>
> I wrote an additional patch for your if_mzscheme4.diff:
>
> https://bitbucket.org/k_takata/vim-ktakata-mq/src/5b5a73a34c71df5e0ecf5234d698570dae3f40e8/mzscheme_collects_and_mingw.patch?fileviewer=file-view-default
>
> This adds a new setting MZSCHEME_COLLECTS so that the collects directory
> (used
> at runtime) can be set separately form the MZSCHEME directory (used at
> compile
> time).
> This also adds changes for MinGW/Cygwin.
>
> I think it's also better to update src/INSTALLpc.txt. I'm preparing it.
>

Thank you.  I merged
https://bitbucket.org/k_takata/vim-ktakata-mq/raw/d2b34c2918f89b9fb6caf6043ea2ab6622632d11/mzscheme_collects_and_mingw.patch
https://bitbucket.org/k_takata/vim-ktakata-mq/raw/d2b34c2918f89b9fb6caf6043ea2ab6622632d11/mzscheme_base_module.patch
and created merged patch if_mzscheme5.diff.

if_mzscheme now uses racket/base module and falls back to scheme/base if it
doesn't exist.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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/if_mzsch.txt b/runtime/doc/if_mzsch.txt
index b42570a..1da8ccc 100644
--- a/runtime/doc/if_mzsch.txt
+++ b/runtime/doc/if_mzsch.txt
@@ -1,4 +1,4 @@
-*if_mzsch.txt*  For Vim version 7.4.  Last change: 2012 Dec 17
+*if_mzsch.txt*  For Vim version 7.4.  Last change: 2016 Jan 10
 
 
  VIM REFERENCE MANUALby Sergey Khorev
@@ -13,6 +13,7 @@ The MzScheme Interface to Vim 
*mzscheme* *MzScheme*
 5. mzeval() Vim function   |mzscheme-mzeval|
 6. Using Function references   |mzscheme-funcref|
 7. Dynamic loading |mzscheme-dynamic|
+8. MzScheme setup  |mzscheme-setup|
 
 {Vi does not have any of these commands}
 
@@ -272,6 +273,9 @@ output then includes |+mzscheme/dyn|.
 This means that Vim will search for the MzScheme DLL files only when needed.
 When you don't use the MzScheme interface you don't need them, thus you can
 use Vim without these DLL files.
+NOTE: Newer version of MzScheme (Racket) require earlier (trampolined)
+initialisation via scheme_main_setup.  So Vim always load MzScheme DLL at
+startup if possible.
 
 To use the MzScheme interface the MzScheme DLLs must be in your search path.
 In a console window type "path" to see what directories are used.
@@ -282,5 +286,24 @@ For MzScheme version 209 they will be 
"libmzsch209_000.dll" and
 command, look for -DDYNAMIC_MZSCH_DLL="something" and
 -DDYNAMIC_MZGC_DLL="something" in the "Compilation" info.
 
+For example, if MzScheme (Racket) is installed at C:\Racket63, you may need
+to set the environment variable as the following: >
+
+  PATH=%PATH%;C:\Racket63\lib
+  PLTCOLLECTS=C:\Racket63\collects
+ 

Re: if_mzscheme does not work.

2016-01-11 Fir de Conversatie Yukihiro Nakadaira
On Mon, Jan 11, 2016 at 8:52 PM, Christian Brabandt <cbli...@256bit.org>
wrote:

> Hi Yukihiro!
>
> On So, 10 Jan 2016, Yukihiro Nakadaira wrote:
>
> > On Sun, Jan 10, 2016 at 3:31 AM, Sergey Khorev <sergey.kho...@gmail.com>
> wrote:
> >
> > Yukihiro-san,
> >
> > I gave up on catching up Racket updates in if_mzscheme so the
> interface has
> > been broken for some time now. Your patch seems to finally fix the
> issues I
> > encounterred (tested on Arch successfully), many thanks for that.
> >
> >
> >
> > With this change, test70 still fails because test70 uses r5rs
> > module and Minimal
> > Racket doesn't have it.
> >
> >
> > This was solved by
> > raco.exe pkg install scheme-lib
> > raco.exe pkg install r5rs-lib
> >
> >
> >
> > Don't you think this should be included in the documentation?
> >
> >
> > Thank you for your suggestion.  I have added documentation for it.
> >
> > ```
> > 8. MzScheme setup*mzscheme-setup*
> >
> > Vim requires "scheme/base" module for if_mzsch core, "r5rs" module for
> test
> > and "raco ctool" command for building Vim.  If MzScheme did not have
> them, you
> > can install them with MzScheme's raco command:
> >
> >   raco pkg install scheme-lib   # scheme/base module
> >   raco pkg install r5rs-lib # r5rs module
> >   raco pkg install cext-lib # raco ctool command
> > ```
>
>
> Thanks for that. Is it possible, to build scheme with DYNAMIC_SCHEME=yes
> on Windows? I tried it, but it failed for me. Not sure if it still
> possible at all.
>

Yes, DYNAMIC_MZSCHEME should work.  If Racket is installed in C:\Racket63,
build command is

nmake -f Make_mvc.mak MZSCHEME=C:\Racket63 MZSCHEME_VER=3m_9z0ds0
DYNAMIC_MZSCHEME=yes

MZSCHEME is install path.
MZSCHEME_VER is version number of C:\Racket63\lib\libracketXX.dll.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: if_mzscheme does not work.

2016-01-11 Fir de Conversatie Yukihiro Nakadaira
On Mon, Jan 11, 2016 at 9:37 PM, Christian Brabandt <cbli...@256bit.org>
wrote:

> Hi Yukihiro!
>
> On Mo, 11 Jan 2016, Yukihiro Nakadaira wrote:
>
> > On Mon, Jan 11, 2016 at 8:52 PM, Christian Brabandt <cbli...@256bit.org>
> wrote:
> >
> > Hi Yukihiro!
> >
> > On So, 10 Jan 2016, Yukihiro Nakadaira wrote:
> >
> > > On Sun, Jan 10, 2016 at 3:31 AM, Sergey Khorev <
> sergey.kho...@gmail.com>
> > wrote:
> > >
> > > Yukihiro-san,
> > >
> > > I gave up on catching up Racket updates in if_mzscheme so the
> > interface has
> > > been broken for some time now. Your patch seems to finally fix
> the
> > issues I
> > > encounterred (tested on Arch successfully), many thanks for
> that.
> > >
> > >
> > >
> > > With this change, test70 still fails because test70
> uses r5rs
> > > module and Minimal
> > > Racket doesn't have it.
> > >
> > >
> > > This was solved by
> > > raco.exe pkg install scheme-lib
> > > raco.exe pkg install r5rs-lib
> > >
> > >
> > >
> > > Don't you think this should be included in the documentation?
> > >
> > >
> > > Thank you for your suggestion.  I have added documentation for it.
> > >
> > > ```
> > > 8. MzScheme setup*mzscheme-setup*
> > >
> > > Vim requires "scheme/base" module for if_mzsch core, "r5rs" module
> for
> > test
> > > and "raco ctool" command for building Vim.  If MzScheme did not
> have
> > them, you
> > > can install them with MzScheme's raco command:
> > >
> > >   raco pkg install scheme-lib   # scheme/base module
> > >   raco pkg install r5rs-lib # r5rs module
> > >   raco pkg install cext-lib # raco ctool command
> > > ```
> >
> >
> > Thanks for that. Is it possible, to build scheme with
> DYNAMIC_SCHEME=yes
> > on Windows? I tried it, but it failed for me. Not sure if it still
> > possible at all.
> >
> >
> > Yes, DYNAMIC_MZSCHEME should work.  If Racket is installed in
> C:\Racket63,
> > build command is
> >
> > nmake -f Make_mvc.mak MZSCHEME=C:\Racket63 MZSCHEME_VER=3m_9z0ds0
> > DYNAMIC_MZSCHEME=yes
> >
> > MZSCHEME is install path.
> > MZSCHEME_VER is version number of C:\Racket63\lib\libracketXX.dll.
>
> Tried that. I see those errors:
> cl -c /W3 /nologo  -I. -Iproto -DHAVE_PATHDEF -DWIN32
>  -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG   -DFEAT_XPM_W32   -DWINVER=0x0400
> -D_WIN32_WINNT=0x0400  /Fo.\ObjGXZi386/ /Ox /GL -DNDEBUG  /Zl /MT
> -DFEAT_GUI_W32 -DFEAT_DIRECTX -DDYNAMIC_DIRECTX -DDYNAMIC_ICONV
> -DDYNAMIC_GETTEXT -DFEAT_MZSCHEME -I C:\racket63\\include
> -DINCLUDE_MZSCHEME_BASE -DDYNAMIC_MZSCHEME
> -DDYNAMIC_MZSCH_DLL=\"libracket3m_9z0ds0.dll\"
> -DDYNAMIC_MZGC_DLL=\"libmzgc3m_9z0ds0.dll\" -DFEAT_huge /Fd.\ObjGXZi386/
> /Zi if_mzsch.c  -DMZSCHEME_COLLECTS=\"C:\\racket63collects\"
> if_mzsch.c
> if_mzsch.c(371) : warning C4005: 'scheme_current_thread' : macro
> redefinition
> c:\racket63\include\schthread.h(645) : see previous definition of
> 'scheme_current_thread'
> if_mzsch.c(871) : fatal error C1189: #error :  Precise GC v.4+ or Racket
> with futures/places do not support dynamic MzScheme
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual
> Studio 12.0\VC\BIN\cl.EXE"' : return code '0x2'
> Stop.
>
> And even after uncommenting the Precise GC error I see link errors:
> if_mzsch.obj : error LNK2001: unresolved external symbol
> __imp__scheme_register_embedded_load
> if_mzsch.obj : error LNK2001: unresolved external symbol
> __imp__scheme_register_tls_space
> if_mzsch.obj : error LNK2001: unresolved external symbol
> __imp__scheme_embedded_load
> if_mzsch.obj : error LNK2001: unresolved external symbol
> __imp__scheme_main_setup
> gvim.exe : fatal error LNK1120: 4 unresolved externals
> NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual
> Studio 12.0\VC\BIN\link.EXE"' : return code '0x460'
> Stop.
>

It seems that my patch is not applied correctly.
Please try latest patch if_mzscheme4.diff in this post
https://groups.google.com/d/msg/vim_dev/qg7R7HeGq50/5Xl8uLdMBAAJ

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: if_mzscheme does not work.

2016-01-10 Fir de Conversatie Yukihiro Nakadaira
On Sun, Jan 10, 2016 at 3:31 AM, Sergey Khorev <sergey.kho...@gmail.com>
wrote:

> Yukihiro-san,
>
> I gave up on catching up Racket updates in if_mzscheme so the interface
> has been broken for some time now. Your patch seems to finally fix the
> issues I encounterred (tested on Arch successfully), many thanks for that.
>
>
>>> With this change, test70 still fails because test70 uses r5rs module and
>>> Minimal
>>> Racket doesn't have it.
>>>
>>
>> This was solved by
>> raco.exe pkg install scheme-lib
>> raco.exe pkg install r5rs-lib
>>
>>
> Don't you think this should be included in the documentation?
>

Thank you for your suggestion.  I have added documentation for it.

```
8. MzScheme setup*mzscheme-setup*

Vim requires "scheme/base" module for if_mzsch core, "r5rs" module for test
and "raco ctool" command for building Vim.  If MzScheme did not have them,
you
can install them with MzScheme's raco command:

  raco pkg install scheme-lib   # scheme/base module
  raco pkg install r5rs-lib # r5rs module
  raco pkg install cext-lib # raco ctool command
```

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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/if_mzsch.txt b/runtime/doc/if_mzsch.txt
index b42570a..0522098 100644
--- a/runtime/doc/if_mzsch.txt
+++ b/runtime/doc/if_mzsch.txt
@@ -1,4 +1,4 @@
-*if_mzsch.txt*  For Vim version 7.4.  Last change: 2012 Dec 17
+*if_mzsch.txt*  For Vim version 7.4.  Last change: 2016 Jan 10
 
 
  VIM REFERENCE MANUALby Sergey Khorev
@@ -13,6 +13,7 @@ The MzScheme Interface to Vim 
*mzscheme* *MzScheme*
 5. mzeval() Vim function   |mzscheme-mzeval|
 6. Using Function references   |mzscheme-funcref|
 7. Dynamic loading |mzscheme-dynamic|
+8. MzScheme setup  |mzscheme-setup|
 
 {Vi does not have any of these commands}
 
@@ -272,6 +273,9 @@ output then includes |+mzscheme/dyn|.
 This means that Vim will search for the MzScheme DLL files only when needed.
 When you don't use the MzScheme interface you don't need them, thus you can
 use Vim without these DLL files.
+NOTE: Newer version of MzScheme (Racket) require earlier (trampolined)
+initialisation via scheme_main_setup.  So Vim always load MzScheme DLL at
+startup if possible.
 
 To use the MzScheme interface the MzScheme DLLs must be in your search path.
 In a console window type "path" to see what directories are used.
@@ -282,5 +286,23 @@ For MzScheme version 209 they will be 
"libmzsch209_000.dll" and
 command, look for -DDYNAMIC_MZSCH_DLL="something" and
 -DDYNAMIC_MZGC_DLL="something" in the "Compilation" info.
 
+For example, if MzScheme (Racket) is installed at C:\Racket63, you may need
+to set the environment variable as the following: >
+
+  PATH=%PATH%;C:\Racket63\lib
+  PLTCOLLECTS=C:\Racket63\collects
+  PLTCONFIGDIR=C:\Racket63\etc
+<
+==
+8. MzScheme setup  *mzscheme-setup*
+
+Vim requires "scheme/base" module for if_mzsch core, "r5rs" module for test
+and "raco ctool" command for building Vim.  If MzScheme did not have them, you
+can install them with MzScheme's raco command: >
+
+  raco pkg install scheme-lib   # scheme/base module
+  raco pkg install r5rs-lib # r5rs module
+  raco pkg install cext-lib # raco ctool command
+<
 ==
   vim:tw=78:ts=8:sts=4:ft=help:norl:
diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak
index a446015..68b3932 100644
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -752,43 +752,49 @@ PYTHON3_LIB = $(PYTHON3)\libs\python$(PYTHON3_VER).lib
 !ifndef MZSCHEME_VER
 MZSCHEME_VER = 205_000
 !endif
-CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I $(MZSCHEME)\include
-!if EXIST("$(MZSCHEME)\collects\scheme\base.ss") \
-   || EXIST("$(MZSCHEME)\collects\scheme\base.rkt") \
-   || EXIST("$(MZSCHEME)\collects\racket\base.rkt")
-# for MzScheme >= 4 we need to include byte code for basic Scheme stuff
-MZSCHEME_EXTRA_DEP = mzscheme_base.c
-CFLAGS = $(CFLAGS) -DINCLUDE_MZSCHEME_BASE
-!endif
+CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I "$(MZSCHEME)

Re: Fix for pointer truncation warning on Windows.

2016-01-10 Fir de Conversatie Yukihiro Nakadaira
On Sun, Jan 10, 2016 at 7:52 PM, Mike Williams <
mike.willi...@globalgraphics.com> wrote:

> Hi,
>
>
> On 13/12/2015 13:30, Mike Williams wrote:
>
>> Hi all,
>>
>> VS2015 is raising a pointer cast truncation warning in gui_w32.c  On
>> 64bit builds with VC HandleToLong() is a function but for 32bit builds
>> it is a macro.  The current VIM code defines a macro if one is not
>> defined so shadows the function call resulting in the warning.
>>
>> Going through the source history this looks like it got broken when
>> coping with MingW warnings in 7.3.870.  The following patch copes with
>> old MS compilers (for the Win95 hold outs - are there still any?) and
>> MingW.  I don't have MingW so can someone please check the following
>> works for them, and if a 64bit MingW raises its own warning for the cast.
>>
>>
>> diff --git a/src/gui_w32.c b/src/gui_w32.c
>> --- a/src/gui_w32.c
>> +++ b/src/gui_w32.c
>> @@ -1769,9 +1769,11 @@ gui_mch_init(void)
>>#endif
>>
>>#ifdef FEAT_EVAL
>> -# ifndef HandleToLong
>> -/* HandleToLong() only exists in compilers that can do 64 bit builds */
>> -#  define HandleToLong(h) ((long)(h))
>> +# if !defined(_MSC_VER) || (_MSC_VER < 1400)
>> +/* Define HandleToLong for old MS and none-MS compilers if not defined */
>> +#  ifndef HandleToLong
>> +#   define HandleToLong(h) ((long)(h))
>> +#  endif
>># endif
>>/* set the v:windowid variable */
>>set_vim_var_nr(VV_WINDOWID, HandleToLong(s_hwnd));
>>
>>
> Has anyone tried this on MingW?  Any problems?
>

I tried to compile it with mingw32 and mingw64 and I got no warnings.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: GVimExt 64bit builds with VS2015

2016-01-10 Fir de Conversatie Yukihiro Nakadaira
On Mon, Jan 11, 2016 at 12:30 AM, Yukihiro Nakadaira <
yukihiro.nakada...@gmail.com> wrote:

> On Sun, Jan 10, 2016 at 8:06 PM, Mike Williams <
> mike.willi...@globalgraphics.com> wrote:
>
>> Hi
>>
>> On 13/12/2015 14:27, Mike Williams wrote:
>>
>>> Hi,
>>>
>>> GVimEXT fails to build for me with VS2015, a large number of undefined
>>> symbols from the Windows headers when compiling.  The Makefile is
>>> missing some symbols defined that Win32.mak needs to set up the build
>>> environment correctly.
>>>
>>
>> Tweaked to be more consistent with the main msvc makefile.
>>
>> diff --git a/src/GvimExt/Makefile b/src/GvimExt/Makefile
>> --- a/src/GvimExt/Makefile
>> +++ b/src/GvimExt/Makefile
>> @@ -12,6 +12,24 @@ APPVER=5.0
>>  NODEBUG = 1
>>  !endif
>>
>> +TARGETOS = BOTH
>> +
>> +!ifdef PROCESSOR_ARCHITECTURE
>> +# On Windows NT
>> +! ifndef CPU
>> +CPU = i386
>> +!  ifdef PLATFORM
>> +!   if ("$(PLATFORM)" == "x64") || ("$(PLATFORM)" == "X64")
>> +CPU = AMD64
>> +!   elseif ("$(PLATFORM)" != "x86") && ("$(PLATFORM)" != "X86")
>> +!error *** ERROR Unknown target platform "$(PLATFORM)". Make aborted.
>> +!   endif
>> +!  endif
>> +! endif
>> +!else
>> +CPU = i386
>> +!endif
>> +
>>
>> Anyone got any problems with GVimExt with this patch?
>>
>
> I can not reproduce the problem with VS2015 and Windows10 and Win32.Mak
> copied
> from Windows SDK 7.1.
>

Perhaps the patch is needed for cross compile?

With "VS2015 X64 X86 Cross Tool" and "VS2015 X86 X64 Cross Tool", I got many
errors for compiling GvimExt.  And it was fixed by your patch.  Generated
binary seems correct (I just checked dll header with "dumpbin /headers
gvimext.dll").

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: GVimExt 64bit builds with VS2015

2016-01-10 Fir de Conversatie Yukihiro Nakadaira
On Sun, Jan 10, 2016 at 8:06 PM, Mike Williams <
mike.willi...@globalgraphics.com> wrote:

> Hi
>
> On 13/12/2015 14:27, Mike Williams wrote:
>
>> Hi,
>>
>> GVimEXT fails to build for me with VS2015, a large number of undefined
>> symbols from the Windows headers when compiling.  The Makefile is
>> missing some symbols defined that Win32.mak needs to set up the build
>> environment correctly.
>>
>
> Tweaked to be more consistent with the main msvc makefile.
>
> diff --git a/src/GvimExt/Makefile b/src/GvimExt/Makefile
> --- a/src/GvimExt/Makefile
> +++ b/src/GvimExt/Makefile
> @@ -12,6 +12,24 @@ APPVER=5.0
>  NODEBUG = 1
>  !endif
>
> +TARGETOS = BOTH
> +
> +!ifdef PROCESSOR_ARCHITECTURE
> +# On Windows NT
> +! ifndef CPU
> +CPU = i386
> +!  ifdef PLATFORM
> +!   if ("$(PLATFORM)" == "x64") || ("$(PLATFORM)" == "X64")
> +CPU = AMD64
> +!   elseif ("$(PLATFORM)" != "x86") && ("$(PLATFORM)" != "X86")
> +!error *** ERROR Unknown target platform "$(PLATFORM)". Make aborted.
> +!   endif
> +!  endif
> +! endif
> +!else
> +CPU = i386
> +!endif
> +
>
> Anyone got any problems with GVimExt with this patch?
>

I can not reproduce the problem with VS2015 and Windows10 and Win32.Mak
copied
from Windows SDK 7.1.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: if_mzscheme does not work.

2016-01-07 Fir de Conversatie Yukihiro Nakadaira
On Thu, Jan 7, 2016 at 5:08 AM, Bram Moolenaar <b...@moolenaar.net> wrote:

>
> Yukihiro Nakadaira wrote:
>
> > if_mzscheme does not work.  I wrote patch for it.  Please check the
> attached
> > patch.
> >
> > Linux & Windows:
> >   Fix startup_mzscheme() to initialize collects and config path properly.
> >
> > Linux:
> >   Fix configure script for build error.
> >
> > Windows:
> >   Fix make_mvc.mak for build error.
> >   Use scheme_register_tls_space() for 64bit Windows (racket provides it
> for
> > 64bit from version 6.3).
> >   Enable DYNAMIC_MZSCHEME with precise GC version of racket which is the
> > binary
> > distributed by racket-lang.org.
> >
> > I tested racket-6.3 64bit, racket-6.3 32bit, racket-5.1.2 64bit and
> racket
> > 5.0 32bit in Windows10 64bit. And racket-6.3, racket-5.3.6 in Ubuntu
> 15.04
> > 64bit.
>
> Unfortunately it still doesn't work for me, Ubuntu 15.10 with racket
> 6.2-2.  It didn't work before, thus this change doesn't break it, but it
> also doesn't make it work.
>
> Configure output:
>
> || checking --enable-mzschemeinterp argument... yes
> || checking --with-plthome argument... "no"
> || checking PLTHOME environment var... not set
> || checking for mzscheme... /usr/bin/mzscheme
> || checking MzScheme install prefix... /usr
> || checking for racket include directory... /usr/include/racket
> || checking for racket lib directory... /usr/lib/racket
> || checking if racket requires -pthread... yes
> || checking for racket config directory... /etc/racket
> || checking for racket collects directory... /usr/share/racket/
> || checking for mzscheme_base.c... needed
> || checking for ffi_type_void in -lffi... yes
> || checking if compile and link flags for MzScheme are sane... no:
> MZSCHEME DISABLED
>
> Log:
>
> configure:5534: checking if compile and link flags for MzScheme are sane
> configure:5551: gcc -o conftest -g -Wall -Wextra -Wmissing-prototypes
> -Wunreachable-code -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1  -pthread
> -DMZSCHEME_CONFIGDIR='"/etc/racket"' -DINCLUDE_MZSCHEME_BASE
> -I/usr/include/racket
>  -DMZSCHEME_COLLECTS='"/usr/share/racket/collects"'  -L.
> -Wl,-Bsymbolic-functions -Wl,-z,relro
> -L/build/ruby2.1-_3OTYb/ruby2.1-2.1.5/debian/lib -fstack-protector
> -rdynamic -Wl,-export-dynamic -Wl,-E   -L/usr/local/lib -Wl,--as-needed
> conftest.c  -L/usr/lib/racket -lmzscheme -lmzgc -Wl,-rpath
> -Wl,/usr/lib/racket -pthread -lffi >&5
> /usr/bin/ld: cannot find -lmzscheme
> /usr/bin/ld: cannot find -lmzgc
> collect2: error: ld returned 1 exit status
>
> Can this also be made to work?
> Or am I missing a package?
>

I used self compiled binary and installer from racket-lang.org.

Ubuntu's racket package does not have library for embedding.  I thought that
/usr/lib/racket/mzdyn3m.o is that.  But it isn't.

I updated patch.

Make_mvc.mak:
  Quote $(MZSCHEME) variable properly.
  Do not use raco when it is not found.

if_mzsch.c:
  Add error handling for scheme_namespace_require() to avoid abort when
  scheme/base module is not found.

if_mzsch.c works without mzscheme_base.c.  So we can remove stuff related
to it.

I added error message for when scheme/base module could not be loaded.
if_mzsch.c:1273: "Exxx: Sorry, this command is disabled, the MzScheme's
scheme/base module could not be loaded."
Please number it.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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/if_mzsch.txt b/runtime/doc/if_mzsch.txt
index b42570a..a6d4794 100644
--- a/runtime/doc/if_mzsch.txt
+++ b/runtime/doc/if_mzsch.txt
@@ -272,6 +272,9 @@ output then includes |+mzscheme/dyn|.
 This means that Vim will search for the MzScheme DLL files only when needed.
 When you don't use the MzScheme interface you don't need them, thus you can
 use Vim without these DLL files.
+NOTE: Newer version of MzScheme (Racket) require earlier (trampolined)
+initialisation via scheme_main_setup.  So Vim always load MzScheme DLL at
+startup if possible.
 
 To use the MzScheme interface the MzScheme DLLs must be in your search path.
 In a console window type "path" to see what directories are used.
@@ -282,5 +285,12 @@ For MzScheme version 209 they will be 
"libmzsch209_000.dll"

Re: if_mzscheme does not work.

2016-01-07 Fir de Conversatie Yukihiro Nakadaira
On Thu, Jan 7, 2016 at 4:03 AM, tux. <z...@tuxproject.de> wrote:

> Still not working on Windows:
>
> > raco.exe: Unrecognized command: ctool
> >
> > Usage: raco   ...  ...
>

I updated patch for problem what you described (quote $(MZSCHEME) and don't
use
raco when it is not found).  I posted it in the other mail.

I don't know why raco is not exist but I think raco ctool is not removed.
In
the documentation only "9.3 Compiling to Native Code via C" section was
removed.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: if_mzscheme does not work.

2016-01-07 Fir de Conversatie Yukihiro Nakadaira
I tried Minimal Racket installer and actually its raco.exe doesn't have
ctool
subcommand.  So it seems related to build option.

With Minimal Racket, if_mzscheme doesn't work because Minimal Racket doesn't
have "scheme/base" module.  Replacing it with "racket/base" module will
work.
I'm not sure if it doesn't have side effect.

With this change, test70 still fails because test70 uses r5rs module and
Minimal
Racket doesn't have it.

for if_mzscheme3.diff
diff --git a/src/if_mzsch.c b/src/if_mzsch.c
index da23353..1cc6807 100644
--- a/src/if_mzsch.c
+++ b/src/if_mzsch.c
@@ -1021,7 +1021,7 @@ mzscheme_env_main(Scheme_Env *env, int argc, char
**argv)
 static Scheme_Object*
 load_base_module(void *data)
 {
-scheme_namespace_require(scheme_intern_symbol("scheme/base"));
+scheme_namespace_require(scheme_intern_symbol("racket/base"));
 return scheme_null;
 }

@@ -1270,7 +1270,7 @@ mzscheme_init(void)
 #endif
  if (load_base_module_failed || startup_mzscheme())
  {
- EMSG(_("Exxx: Sorry, this command is disabled, the MzScheme's
scheme/base module could not be loaded."));
+ EMSG(_("Exxx: Sorry, this command is disabled, the MzScheme's
racket/base module could not be loaded."));
  return -1;
  }
  initialized = TRUE;

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


if_mzscheme does not work.

2016-01-06 Fir de Conversatie Yukihiro Nakadaira
if_mzscheme does not work.  I wrote patch for it.  Please check the attached
patch.

Linux & Windows:
  Fix startup_mzscheme() to initialize collects and config path properly.

Linux:
  Fix configure script for build error.

Windows:
  Fix make_mvc.mak for build error.
  Use scheme_register_tls_space() for 64bit Windows (racket provides it for
64bit from version 6.3).
  Enable DYNAMIC_MZSCHEME with precise GC version of racket which is the
binary
distributed by racket-lang.org.

I tested racket-6.3 64bit, racket-6.3 32bit, racket-5.1.2 64bit and racket
5.0 32bit in Windows10 64bit. And racket-6.3, racket-5.3.6 in Ubuntu 15.04
64bit.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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/if_mzsch.txt b/runtime/doc/if_mzsch.txt
index b42570a..a6d4794 100644
--- a/runtime/doc/if_mzsch.txt
+++ b/runtime/doc/if_mzsch.txt
@@ -272,6 +272,9 @@ output then includes |+mzscheme/dyn|.
 This means that Vim will search for the MzScheme DLL files only when needed.
 When you don't use the MzScheme interface you don't need them, thus you can
 use Vim without these DLL files.
+NOTE: Newer version of MzScheme (Racket) require earlier (trampolined)
+initialisation via scheme_main_setup.  So Vim always load MzScheme DLL at
+startup if possible.
 
 To use the MzScheme interface the MzScheme DLLs must be in your search path.
 In a console window type "path" to see what directories are used.
@@ -282,5 +285,12 @@ For MzScheme version 209 they will be 
"libmzsch209_000.dll" and
 command, look for -DDYNAMIC_MZSCH_DLL="something" and
 -DDYNAMIC_MZGC_DLL="something" in the "Compilation" info.
 
+For example, if MzScheme (Racket) is installed at C:\Racket63, you may need
+to set the environment variable as the following: >
+
+  set PATH=%PATH%;C:\Racket63\lib
+  set PLTCOLLECTS=C:\Racket63\collects
+  set PLTCONFIGDIR=C:\Racket63\etc
+<
 ==
   vim:tw=78:ts=8:sts=4:ft=help:norl:
diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak
index f3c19b5..5add91b 100644
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -740,7 +740,7 @@ CFLAGS = $(CFLAGS) -DFEAT_MZSCHEME -I $(MZSCHEME)\include
 !if EXIST("$(MZSCHEME)\collects\scheme\base.ss") \
|| EXIST("$(MZSCHEME)\collects\scheme\base.rkt") \
|| EXIST("$(MZSCHEME)\collects\racket\base.rkt")
-# for MzScheme >= 4 we need to include byte code for basic Scheme stuff
+# Include byte code for basic Scheme stuff (optional)
 MZSCHEME_EXTRA_DEP = mzscheme_base.c
 CFLAGS = $(CFLAGS) -DINCLUDE_MZSCHEME_BASE
 !endif
@@ -749,27 +749,43 @@ MZSCHEME_MAIN_LIB=mzsch
 !else
 MZSCHEME_MAIN_LIB=racket
 !endif
-!if EXIST("$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib") \
-   && !EXIST("$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib")
+!if (EXIST("$(MZSCHEME)\lib\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll") \
+ && !EXIST("$(MZSCHEME)\lib\libmzgc$(MZSCHEME_VER).dll")) \
+|| 
(EXIST("$(MZSCHEME)\lib\msvc\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).lib") \
+&& !EXIST("$(MZSCHEME)\lib\msvc\libmzgc$(MZSCHEME_VER).lib"))
 !message Building with Precise GC
 MZSCHEME_PRECISE_GC = yes
 CFLAGS = $(CFLAGS) -DMZ_PRECISE_GC
 !endif
 !if "$(DYNAMIC_MZSCHEME)" == "yes"
+!message MzScheme DLLs will be loaded dynamically
+CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME
 !if "$(MZSCHEME_PRECISE_GC)" == "yes"
-!error MzScheme with Precise GC cannot be loaded dynamically
+# Precise GC does not use separate dll
+CFLAGS = $(CFLAGS) \
+-DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" \
+-DDYNAMIC_MZGC_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\"
+!else
+CFLAGS = $(CFLAGS) \
+-DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" \
+-DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
 !endif
-!message MzScheme DLLs will be loaded dynamically
-CFLAGS = $(CFLAGS) -DDYNAMIC_MZSCHEME \
-   
-DDYNAMIC_MZSCH_DLL=\"lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).dll\" \
-   -DDYNAMIC_MZGC_DLL=\"libmzgc$(MZSCHEME_VER).dll\"
 !else
+!if EXIST("$(MZSCHEME)\lib\lib$(MZSCHEME_MAIN_LIB)$(MZSCHEME_VER).def")
+# create .lib from .def
+MZSCHEME_BUILD_LIB=yes
+MZSCHEME_EXTRA_DEP = $(MZ

In insert mode, searchpos('$') skips first match.

2015-12-31 Fir de Conversatie Yukihiro Nakadaira
In insert mode, searchpos('$') skips first match.

Steps to reproduce:
  $ vim -u NONE -N
  :call setline(1, ['abc', 'abc', 'abc'])
  :call cursor(2, 3)
  :inoremap  S S()
  :function! S()
  :  echo searchpos('$', 'n')
  :  return ''
  :endfunction
  iS
  [3, 4]

  =buffer=
  1: a b c

  2: a b|c
^cursor
  3: a b c
  ^matched
  

I think this sould be matched at [2, 4].
I wrote patch for this problem.
Please check the attached patch.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/search.c b/src/search.c
index 1145558..de94ec9 100644
--- a/src/search.c
+++ b/src/search.c
@@ -761,7 +761,9 @@ searchit(win, buf, pos, dir, pat, count, options, pat_use, 
stop_lnum, tm)
&& (int)endpos.col - 1
 < (int)start_pos.col + extra_col)
: ((int)matchpos.col
- - (ptr[matchpos.col] == NUL)
+ - ((State & INSERT)
+ ? 0
+ : (ptr[matchpos.col] == 
NUL))
< (int)start_pos.col + extra_col)))
{
/*
diff --git a/src/testdir/test_searchpos.vim b/src/testdir/test_searchpos.vim
index 4a1e024..23194d2 100644
--- a/src/testdir/test_searchpos.vim
+++ b/src/testdir/test_searchpos.vim
@@ -26,3 +26,59 @@ func Test_searchpos()
   q!
 
 endfunc
+
+func Test_searchpos_eol_in_insertmode()
+  new one
+
+  call setline(1, ['abc', 'abc', 'abc'])
+
+  inoremap   ISearchPos($,n) ISearchPos('$', 'n')
+  inoremap   ISearchPos($,nb) ISearchPos('$', 'nb')
+  inoremap   ISearchPos($,nc) ISearchPos('$', 'nc')
+  inoremap   ISearchPos($,nbc) ISearchPos('$', 'nbc')
+
+  call cursor(2, 3)
+  normal iISearchPos($,n)
+  call assert_equal([2, 4], s:pos)
+
+  call cursor(2, 3)
+  normal iISearchPos($,nb)
+  call assert_equal([1, 4], s:pos)
+
+  call cursor(2, 3)
+  normal iISearchPos($,nc)
+  call assert_equal([2, 4], s:pos)
+
+  call cursor(2, 3)
+  normal iISearchPos($,nbc)
+  call assert_equal([1, 4], s:pos)
+
+  call cursor(2, 3)
+  normal aISearchPos($,n)
+  call assert_equal([3, 4], s:pos)
+
+  call cursor(2, 3)
+  normal aISearchPos($,nb)
+  call assert_equal([1, 4], s:pos)
+
+  call cursor(2, 3)
+  normal aISearchPos($,nc)
+  call assert_equal([2, 4], s:pos)
+
+  call cursor(2, 3)
+  normal aISearchPos($,nbc)
+  call assert_equal([2, 4], s:pos)
+
+  iunmap ISearchPos($,n)
+  iunmap ISearchPos($,nb)
+  iunmap ISearchPos($,nc)
+  iunmap ISearchPos($,nbc)
+
+  q!
+endfunc
+
+function! s:ISearchPos(pat, flag)
+  let s:pos = searchpos(a:pat, a:flag)
+  return ''
+endfunction
+


Re: In insert mode, searchpos('$') skips first match.

2015-12-31 Fir de Conversatie Yukihiro Nakadaira
On Fri, Jan 1, 2016 at 2:22 AM, Bram Moolenaar <b...@moolenaar.net> wrote:

>
> Yukihiro Nakadaira wrote:
>
> > In insert mode, searchpos('$') skips first match.
> >
> > Steps to reproduce:
> >   $ vim -u NONE -N
> >   :call setline(1, ['abc', 'abc', 'abc'])
> >   :call cursor(2, 3)
> >   :inoremap  S S()
> >   :function! S()
> >   :  echo searchpos('$', 'n')
> >   :  return ''
> >   :endfunction
> >   iS
> >   [3, 4]
> >
> >   =buffer=
> >   1: a b c
> >
> >   2: a b|c
> > ^cursor
> >   3: a b c
> >   ^matched
> >   
> >
> > I think this sould be matched at [2, 4].
> > I wrote patch for this problem.
> > Please check the attached patch.
>
> Hmm, I'm not so sure if having searchpos() behave slightly differently
> in Insert mode is a good idea.
>

I agree.


> If you want to accept a match at the cursor position, then use the 'c'
> flag:
>echo searchpos('$', 'nc')
>
> Is there is a reason this would not be a good solution?
>

searchpos('$', 'nc') does not match at cursor position when cursor is at
end of line.

Maybe we can use some workaround for it in a script.  But I just thought
that this behavior is a bit strange.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


getchar() in map- break internal state.

2015-09-13 Fir de Conversatie Yukihiro Nakadaira
getchar() in map- break internal state.

Steps to reproduce:
  $ gvim -u NONE(I tested on Windows)
  :nnoremap  x getchar()

  Then, type "x" and "" (any key with modifier)

  Now, all mappings does not work.

In the vgetc(), no_mapping and allow_keys are restored wrongly.

getchar.c:vgetc()
1633 if (mod_mask)   /* no mapping after modifier has been
read */
1634 {
1635 ++no_mapping;
1636 ++allow_keys;
1637 }
1638 c = vgetorpeek(TRUE);<- getchar() in map  change
mod_mask
1639 if (mod_mask)
1640 {
1641 --no_mapping;
1642 --allow_keys;
1643 }

Please check the following patch.

diff --git a/src/getchar.c b/src/getchar.c
index a80432f..acf1c2f 100644
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -4659,6 +4659,7 @@ eval_map_expr(str, c)
 pos_T save_cursor;
 int  save_msg_col;
 int  save_msg_row;
+int  save_mod_mask;

 /* Remove escaping of CSI, because "str" is in a format to be used as
  * typeahead. */
@@ -4684,6 +4685,7 @@ eval_map_expr(str, c)
 save_cursor = curwin->w_cursor;
 save_msg_col = msg_col;
 save_msg_row = msg_row;
+save_mod_mask = mod_mask; /* getchar() may change mod_mask */
 p = eval_to_string(expr, NULL, FALSE);
 --textlock;
 #ifdef FEAT_EX_EXTRA
@@ -4692,6 +4694,7 @@ eval_map_expr(str, c)
 curwin->w_cursor = save_cursor;
 msg_col = save_msg_col;
 msg_row = save_msg_row;
+mod_mask = save_mod_mask;

 restore_cmdline_alloc(save_cmd);
 vim_free(expr);


-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: split(",,,x,,,", ",") returns ["x", "", ""].

2015-08-31 Fir de Conversatie Yukihiro Nakadaira
On Mon, Aug 31, 2015 at 1:35 AM, Bram Moolenaar <b...@moolenaar.net> wrote:

>
> Yukihiro Nakadaira wrote:
>
> > split(",,,x,,,", ",") returns ["x", "", ""].  I think expected result is
> > ["x"].
>
> The documentation says that only empty items at the start and end are
> dropped, thus the result should be ["", "", "x", "", ""].
>
> But I can see you would like to drop all empty items.  Or all empty
> items at the start and end.
>
> So far the keepempty argument was zero or non-zero.  If we make it a
> string then we can pass different flags:
> 0   default - drop empty items at start and end
> 1   keep all empty items
> 'd'  drop all empty items
> 's'  drop one empty item at start
> 'e'  drop one empty item at end
> 'se' drop one empty item at start and end
>
> How about that?
>

Ah sorry, I have no complaints if it works as documented.  Keepempty=1 is
sufficient.  And Vim script is powerful enough to filter result.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


split(,,,x,,,, ,) returns [x, , ].

2015-08-30 Fir de Conversatie Yukihiro Nakadaira
split(,,,x ,) returns [x, , ].  I think expected result is
[x].


diff --git a/src/eval.c b/src/eval.c
index 3650c34..e5fd5cf 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -18291,6 +18291,14 @@ f_split(argvars, rettv)
  vim_regfree(regmatch.regprog);
 }

+if (!keepempty)
+{
+ while (rettv-vval.v_list-lv_len  0
+   rettv-vval.v_list-lv_last-li_tv.vval.v_string[0] == NUL)
+ vimlist_remove(rettv-vval.v_list, rettv-vval.v_list-lv_last,
+  rettv-vval.v_list-lv_last);
+}
+
 p_cpo = save_cpo;
 }



Anyway, is it possible to change split()'s behavior to omit all empty field
(split(,,,x,,,y,,,) = [x, y])?  I don't have a problem with this.
But I
thought that the current omitting behavior is a bit strange.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: split(,,,x,,,, ,) returns [x, , ].

2015-08-30 Fir de Conversatie Yukihiro Nakadaira
On Mon, Aug 31, 2015 at 12:19 AM, LCD 47 lcd...@gmail.com wrote:

 On 30 August 2015, Yukihiro Nakadaira yukihiro.nakada...@gmail.com
 wrote:

...

  Anyway, is it possible to change split()'s behavior to omit all empty
  field (split(,,,x,,,y,,,) = [x, y])?

 You can achieve that by allowing multiple separators:

 :echo split(',,,x,,,y,,,', '\m,\+')
 ['x', 'y']

 For reference, Perl and Ruby remove the trailing empty items by
 default, but not the leading ones:

 $ perl -MData::Dumper -e 'print Dumper([split(,, ,,,x,,,)])'
 $VAR1 = [
 '',
 '',
 '',
 'x'
 ];

 $ ruby -e 'print ,,,x,,,.split(,)'
 [, , , x]


Indeed.  And they doesn't remove empty field in middle.  My suggestion is
not good idea.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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-A and CTRL-X does not update '[, '] mark.

2015-08-23 Fir de Conversatie Yukihiro Nakadaira
CTRL-A and CTRL-X does not update '[, '] mark.  I think they should update
the
'[, '] mark because they change the text.  I wrote patch fot it.  Please
check
the attached patch.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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

--- 
You received this message because you are subscribed to the Google Groups 
vim_dev group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/ops.c b/src/ops.c
index 62d88a7..7fda2c7 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -5407,6 +5407,8 @@ do_addsub(command, Prenum1, g_cmd)
 intdid_change = FALSE;
 pos_T  t = curwin-w_cursor;
 intmaxlen = 0;
+pos_T  startpos;
+pos_T  endpos;
 
 dohex = (vim_strchr(curbuf-b_p_nf, 'x') != NULL); /* heX */
 dooct = (vim_strchr(curbuf-b_p_nf, 'o') != NULL); /* Octal */
@@ -5581,9 +5583,12 @@ do_addsub(command, Prenum1, g_cmd)
 #endif
}
curwin-w_cursor.col = col;
+   if (!did_change)
+   startpos = curwin-w_cursor;
did_change = TRUE;
(void)del_char(FALSE);
ins_char(firstdigit);
+   endpos = curwin-w_cursor;
curwin-w_cursor.col = col;
}
else
@@ -5673,6 +5678,8 @@ do_addsub(command, Prenum1, g_cmd)
 * Delete the old number.
 */
curwin-w_cursor.col = col;
+   if (!did_change)
+   startpos = curwin-w_cursor;
did_change = TRUE;
todel = length;
c = gchar_cursor();
@@ -5747,6 +5754,7 @@ do_addsub(command, Prenum1, g_cmd)
STRCAT(buf1, buf2);
ins_str(buf1);  /* insert the new number */
vim_free(buf1);
+   endpos = curwin-w_cursor;
if (lnum  lnume)
curwin-w_cursor.col = t.col;
else if (did_change  curwin-w_cursor.col)
@@ -5776,6 +5784,13 @@ do_addsub(command, Prenum1, g_cmd)
 if (visual)
/* cursor at the top of the selection */
curwin-w_cursor = VIsual;
+if (did_change)
+{
+   curbuf-b_op_start = startpos;
+   curbuf-b_op_end = endpos;
+   if (curbuf-b_op_end.col  0)
+   --curbuf-b_op_end.col;
+}
 return OK;
 }
 
diff --git a/src/testdir/test_marks.in b/src/testdir/test_marks.in
index 341f3ac..23c2fb6 100644
--- a/src/testdir/test_marks.in
+++ b/src/testdir/test_marks.in
@@ -8,11 +8,27 @@ STARTTEST
 madduu
 :let a = string(getpos('a))
 :$put ='Mark after delete-undo-redo-undo: '.a
-:/^\t/,$wq! test.out
+:''
 ENDTEST
 
textline A
textline B
textline C
 
+STARTTEST
+: test that CTRL-A and CTRL-X updates last changed mark '[, '].
+:/^123/
+:execute normal! \C-A`[v`]rAjwvjw\C-X`[v`]rX
+ENDTEST
+
+CTRL-A CTRL-X:
+123 123 123
+123 123 123
+123 123 123
+
+STARTTEST
+:g/^STARTTEST/.,/^ENDTEST/d
+:wq! test.out
+ENDTEST
+
 Results:
diff --git a/src/testdir/test_marks.ok b/src/testdir/test_marks.ok
index dd1a3e4..e6c02ee 100644
--- a/src/testdir/test_marks.ok
+++ b/src/testdir/test_marks.ok
@@ -1,6 +1,16 @@
+Tests for marks.
+
+
textline A
textline B
textline C
 
+
+CTRL-A CTRL-X:
+AAA 123 123
+123 XXX
+XXX 123 123
+
+
 Results:
 Mark after delete-undo-redo-undo: [0, 15, 2, 0]


search('multi-byte char', 'bce') does not match at cursor position.

2015-07-09 Fir de Conversatie Yukihiro Nakadaira
search('multi-byte char', 'bce') does not match at cursor position.

Steps to reproduce:

  $ vim -u NONE
  :set encoding=utf-8
  :call setline(1, \uff21)
  :echo search(\uff21, bceW)   no wrap scan
  0

Expected:

  1

I think that the attached patch fixes this problem.  Please check it.


For search(\uff21, bce), Vim checks if matched position is before the
start
position with this expression:

  regmatch.endpos[0].col - 1 + extra_col = start_pos.col
  (extra_col = SEARCH_START ? 0 : 1)

  normal boundary
  | SEARCH_START boundary
-|   -|
  |0|1|2|3|
  |  A  |
   ^   ^ ^
   |   | regmatch.endpos[0].col
   |   | LHS: regmatch.endpos[0].col - 1 + extra_col(1)
   |   LHS: regmatch.endpos[0].col - 1 + extra_col(0)   (LHS=RHS = false)
   RHS: start_pos.col

This patch change it to:

  regmatch.endpos[0].col - 1  start_pos.col + extra_col
  (extra_col = SEARCH_START ? len(A) : 0)

  normal boundary
  | SEARCH_START boundary
-|   -|
  |0|1|2|3|
  |  A  |
   ^   ^ ^
   |   | regmatch.endpos[0].col
   |   | RHS: start_pos.col + extra_col(len(A))  (LHSRHS = true)
   |   LHS: regmatch.endpos[0].col - 1
   start_pos.col
   RHS: start_pos.col + extra_col(0)


-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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 -r bfc3682510d6 src/search.c
--- a/src/search.c  Sat Jul 04 15:05:14 2015 +0200
+++ b/src/search.c  Thu Jul 09 21:28:34 2015 +0900
@@ -548,6 +548,7 @@
 pos_T  start_pos;
 intat_first_line;
 intextra_col;
+intstart_char_len;
 intmatch_ok;
 long   nmatched;
 intsubmatch = 0;
@@ -574,23 +575,37 @@
/* When not accepting a match at the start position set extra_col to
 * a non-zero value.  Don't do that when starting at MAXCOL, since
 * MAXCOL + 1 is zero. */
-   if ((options  SEARCH_START) || pos-col == MAXCOL)
-   extra_col = 0;
+   if (pos-col == MAXCOL)
+   start_char_len = 0;
 #ifdef FEAT_MBYTE
/* Watch out for the col being MAXCOL - 2, used in a closed fold. */
-   else if (dir != BACKWARD  has_mbyte
- pos-lnum = 1  pos-lnum = buf-b_ml.ml_line_count
- pos-col  MAXCOL - 2)
+   else if (has_mbyte
+pos-lnum = 1  pos-lnum = buf-b_ml.ml_line_count
+pos-col  MAXCOL - 2)
{
ptr = ml_get_buf(buf, pos-lnum, FALSE) + pos-col;
if (*ptr == NUL)
-   extra_col = 1;
+   start_char_len = 1;
else
-   extra_col = (*mb_ptr2len)(ptr);
+   start_char_len = (*mb_ptr2len)(ptr);
}
 #endif
else
-   extra_col = 1;
+   start_char_len = 1;
+   if (dir == FORWARD)
+   {
+   if (options  SEARCH_START)
+   extra_col = 0;
+   else
+   extra_col = start_char_len;
+   }
+   else
+   {
+   if (options  SEARCH_START)
+   extra_col = start_char_len;
+   else
+   extra_col = 0;
+   }
 
start_pos = *pos;   /* remember start pos for detecting no match */
found = 0;  /* default: not found */
@@ -779,15 +794,15 @@
|| (lnum + regmatch.endpos[0].lnum
 == start_pos.lnum
  (int)regmatch.endpos[0].col - 1
-  + extra_col
-   = (int)start_pos.col))
+(int)start_pos.col
+   + extra_col))
: (lnum + regmatch.startpos[0].lnum
   start_pos.lnum
|| (lnum + regmatch.startpos[0].lnum
 == start_pos.lnum
  (int)regmatch.startpos[0].col
-  + extra_col
- = (int)start_pos.col
+  (int)start_pos.col

doc fix for :help readfile()

2015-07-01 Fir de Conversatie Yukihiro Nakadaira
Recently the following line was changed.  But its behavior is not changed.

diff -r 99fc18dc1ede runtime/doc/eval.txt
--- a/runtime/doc/eval.txt Sun Jun 28 19:24:40 2015 +0200
+++ b/runtime/doc/eval.txt Wed Jul 01 18:14:36 2015 +0900
@@ -4889,7 +4889,7 @@
  separated with CR will result in a single long line (unless a
  NL appears somewhere).
  All NUL characters are replaced with a NL character.
- When {binary/append} contains b binary mode is used:
+ When {binary} is equal to b binary mode is used:
  - When the last line ends in a NL an extra empty list item is
   added.
  - No CR characters are removed.


-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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] Respect file's EOL/NOEOL settings

2015-06-23 Fir de Conversatie Yukihiro Nakadaira
+1
-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


v_p split line at unexpected place when replacing last character with line register.

2015-05-22 Fir de Conversatie Yukihiro Nakadaira
v_p split line at unexpected place when replacing last character with line
register.

Steps to reproduce:

  $ vim -u NONE
  iaaa
  bbb
  cccEscggYj$vp

Result:

  1 aaa
  2 b
  3 aaa
  4 b
  5 ccc

Expected:

  1 aaa
  2 bb
  3 aaa
  4
  5 ccc

I wrote patch for this problem.  Please check the attached patch.

With this patch, this command

  $ vim -u NONE
  iaaa
  bbb
  cccEscggYG$v$p

results

  1 aaa
  2 bbb
  3 cc
  4 aaa
  5 [empty line]

I'm not sure the empty line should be appended or not when newline is
selected
at last line.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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 -r 18d84ed365a5 src/ops.c
--- a/src/ops.c Wed Apr 22 22:18:22 2015 +0200
+++ b/src/ops.c Sat May 23 09:53:11 2015 +0900
@@ -3488,17 +3488,26 @@
 {
if (flags  PUT_LINE_SPLIT)
{
+   char_u *p;
+
/* p or P in Visual mode: split the lines to put the text in
 * between. */
if (u_save_cursor() == FAIL)
goto end;
-   ptr = vim_strsave(ml_get_cursor());
+   p = ml_get_cursor();
+   if (dir == FORWARD  *p != NUL)
+   mb_ptr_adv(p);
+   ptr = vim_strsave(p);
if (ptr == NULL)
goto end;
ml_append(curwin-w_cursor.lnum, ptr, (colnr_T)0, FALSE);
vim_free(ptr);
 
-   ptr = vim_strnsave(ml_get_curline(), curwin-w_cursor.col);
+   oldp = ml_get_curline();
+   p = oldp + curwin-w_cursor.col;
+   if (dir == FORWARD  *p != NUL)
+   mb_ptr_adv(p);
+   ptr = vim_strnsave(oldp, p - oldp);
if (ptr == NULL)
goto end;
ml_replace(curwin-w_cursor.lnum, ptr, FALSE);
diff -r 18d84ed365a5 src/testdir/test94.in
--- a/src/testdir/test94.in Wed Apr 22 22:18:22 2015 +0200
+++ b/src/testdir/test94.in Sat May 23 09:53:11 2015 +0900
@@ -64,6 +64,42 @@
 d:
:set ma | put = v:errmsg =~# '^E21' ? 'ok' : 'failed'
 dv:dV::set noma | let v:errmsg = ''
 d::set ma | put = v:errmsg =~# '^E21' ? 'failed' : 'ok'
+:
+:$put =''
+:$put ='v_p: replace last character with line register at middle line'
+:$put ='aaa'
+:$put ='bbb'
+:$put ='ccc'
+:-2yank
+k$vp
+:$put ='---'
+:
+:$put =''
+:$put ='v_p: replace last character with line register at middle line 
selecting newline'
+:$put ='aaa'
+:$put ='bbb'
+:$put ='ccc'
+:-2yank
+k$v$p
+:$put ='---'
+:
+:$put =''
+:$put ='v_p: replace last character with line register at last line'
+:$put ='aaa'
+:$put ='bbb'
+:$put ='ccc'
+:-2yank
+$vp
+:$put ='---'
+:
+:$put =''
+:$put ='v_p: replace last character with line register at last line selecting 
newline'
+:$put ='aaa'
+:$put ='bbb'
+:$put ='ccc'
+:-2yank
+$v$p
+:$put ='---'
 :/^start:/+2,$w! test.out
 :q!
 ENDTEST
diff -r 18d84ed365a5 src/testdir/test94.ok
--- a/src/testdir/test94.ok Wed Apr 22 22:18:22 2015 +0200
+++ b/src/testdir/test94.ok Sat May 23 09:53:11 2015 +0900
@@ -18,3 +18,34 @@
 zzz
 ok
 ok
+
+v_p: replace last character with line register at middle line
+aaa
+bb
+aaa
+
+ccc
+---
+
+v_p: replace last character with line register at middle line selecting newline
+aaa
+bb
+aaa
+ccc
+---
+
+v_p: replace last character with line register at last line
+aaa
+bbb
+cc
+aaa
+
+---
+
+v_p: replace last character with line register at last line selecting newline
+aaa
+bbb
+cc
+aaa
+
+---


v_p at last line causes error E315: ml_get: invalid lnum

2015-05-22 Fir de Conversatie Yukihiro Nakadaira
v_p at last line causes error E315: ml_get: invalid lnum

Steps to reproduce:

  $ vim -u NONE
  oxEscylv$p
  E315: ml_get: invalid lnum: 2
  E322: line number out of range: 1 past the end

This behavior was introduced by 7.4.034.

There is related another problem.

  $ vim -u NONE
  ixCRyEscv$d
  :echo getline(1, '$')
  [x]

  Expected: [x, ]

This behavior was introduce by 7.3.251.  v$d delete line.  I think this
is not
expected behavior at last line.

v_p execute 'd' and 'p'.

normal.c:nv_put()
9411 /* Now delete the selected text. */
9412 cap-cmdchar = 'd';
9413 cap-nchar = NUL;
9414 cap-oap-regname = NUL;
9415 nv_operator(cap);
9416 do_pending_operator(cap, 0, FALSE);
9417 empty = (curbuf-b_ml.ml_flags  ML_EMPTY);
...
9450 do_put(cap-oap-regname, dir, cap-count1, flags);

For the above behavior 'd' delete last line.  And 'p' put register to the
line
already deleted.  Then it causes error.

I wrote patch for this problem.  Please check the attached patch.  It revert
7.3.251 and add the following line.  It passes test.  But I'm not sure it
doesn't cause another problem.

diff -r 18d84ed365a5 src/normal.c
--- a/src/normal.c Wed Apr 22 22:18:22 2015 +0200
+++ b/src/normal.c Fri May 22 14:26:03 2015 +0900
@@ -1547,8 +1547,10 @@
 }

 /* In Select mode, a linewise selection is operated upon like a
- * characterwise selection. */
-if (VIsual_select  VIsual_mode == 'V')
+ * characterwise selection.
+ * Special case: gHDel deletes the last line. */
+if (VIsual_select  VIsual_mode == 'V'
+ cap-oap-op_type != OP_DELETE)
 {
  if (lt(VIsual, curwin-w_cursor))
  {

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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 -r 18d84ed365a5 src/normal.c
--- a/src/normal.c  Wed Apr 22 22:18:22 2015 +0200
+++ b/src/normal.c  Fri May 22 14:26:03 2015 +0900
@@ -1547,8 +1547,10 @@
}
 
/* In Select mode, a linewise selection is operated upon like a
-* characterwise selection. */
-   if (VIsual_select  VIsual_mode == 'V')
+* characterwise selection.
+* Special case: gHDel deletes the last line. */
+   if (VIsual_select  VIsual_mode == 'V'
+cap-oap-op_type != OP_DELETE)
{
if (lt(VIsual, curwin-w_cursor))
{
@@ -1770,24 +1772,16 @@
oap-inclusive = FALSE;
/* Try to include the newline, unless it's an operator
 * that works on lines only. */
-   if (*p_sel != 'o'  !op_on_lines(oap-op_type))
+   if (*p_sel != 'o'
+!op_on_lines(oap-op_type)
+oap-end.lnum  curbuf-b_ml.ml_line_count)
{
-   if (oap-end.lnum  curbuf-b_ml.ml_line_count)
-   {
-   ++oap-end.lnum;
-   oap-end.col = 0;
+   ++oap-end.lnum;
+   oap-end.col = 0;
 #ifdef FEAT_VIRTUALEDIT
-   oap-end.coladd = 0;
-#endif
-   ++oap-line_count;
-   }
-   else
-   {
-   /* Cannot move below the last line, make the op
-* inclusive to tell the operation to include the
-* line break. */
-   oap-inclusive = TRUE;
-   }
+   oap-end.coladd = 0;
+#endif
+   ++oap-line_count;
}
}
}
diff -r 18d84ed365a5 src/ops.c
--- a/src/ops.c Wed Apr 22 22:18:22 2015 +0200
+++ b/src/ops.c Fri May 22 14:26:03 2015 +0900
@@ -1959,60 +1959,31 @@
curwin-w_cursor.coladd = 0;
}
 #endif
-   if (oap-op_type == OP_DELETE
-oap-inclusive
-oap-end.lnum == curbuf-b_ml.ml_line_count
-n  (int)STRLEN(ml_get(oap-end.lnum)))
-   {
-   /* Special case: gHDel deletes the last line. */
-   del_lines(1L, FALSE);
-   }
-   else
-   {
-   (void)del_bytes((long)n, !virtual_op,
-   oap-op_type == OP_DELETE  !oap-is_VIsual);
-   }
+   (void)del_bytes((long)n

Re: E887: Sorry, this command is disabled, the Python's site module could not be loaded.

2015-04-06 Fir de Conversatie Yukihiro Nakadaira
On Tue, Apr 7, 2015 at 3:38 AM, David Fishburn dfishburn@gmail.com
wrote:

 :echo has('perl') has('python') has('python3')
 1 1 0

 :python print 'anything'
 E887: Sorry, this command is disabled, the Python's site module could not
 be loaded.



 I have found only 1 reference to this error in vim_use or vim_dev:


 https://groups.google.com/forum/#!searchin/vim_dev/the$20Python$27s$20site$20module$20could$20not$20be$20loaded/vim_dev/d4Iz0vdPJ48/HZzSJ-fVTOcJ

 Which is this:

 Patch 7.4.380
 Problem:Loading python may cause Vim to exit.
 Solution:   Avoid loading the site module. (Taro Muraoka)
 Files:src/if_python.c


 Does anyone know what I might be doing wrong?


Check result of where python27.dll in command prompt.
I guess that Mercurial's python27.dll is found before Python's python27.dll.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


doc fix for if_ruby.txt

2015-02-21 Fir de Conversatie Yukihiro Nakadaira
According to :help ruby-evaluate, VIM::evaluate({expr}) returns string.
But since 7.2.374 it returns converted value for each type.

diff -r b64f0df9399c runtime/doc/if_ruby.txt
--- a/runtime/doc/if_ruby.txtTue Feb 17 17:50:26 2015 +0100
+++ b/runtime/doc/if_ruby.txtSat Feb 21 23:47:58 2015 +0900
@@ -120,9 +120,13 @@
 *ruby-evaluate*
 VIM::evaluate({expr})
 Evaluates {expr} using the vim internal expression evaluator (see
-|expression|).  Returns the expression result as a string.
-A |List| is turned into a string by joining the items and inserting
-line breaks.
+|expression|).  Returns the expression result as:
+- a Integer if the Vim expression evaluates to a number
+- a Float if the Vim expression evaluates to a float
+- a String if the Vim expression evaluates to a string
+- a Array if the Vim expression evaluates to a Vim list
+- a Hash if the Vim expression evaluates to a Vim dictionary
+Dictionaries and lists are recursively expanded.

 ==
 3. VIM::Buffer objects*ruby-buffer*


-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: Windows GVim Freezes on Redraw

2015-02-13 Fir de Conversatie Yukihiro Nakadaira
On Fri, Feb 13, 2015 at 8:14 PM, unknown3...@gmail.com wrote:

 Bump. No thoughts on this?


Maybe it calls Vim's function from non-main thread?
Vim is not thread safe.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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

2015-02-04 Fir de Conversatie Yukihiro Nakadaira
On Wed, Feb 4, 2015 at 7:11 AM, Bram Moolenaar b...@moolenaar.net wrote:


 Patch 7.4.618 (after 7.4.609)
 Problem:luaV_setref() is missing a return statement. (Ozaki Kiichi)
 Solution:   Put the return statement back.
 Files:  src/if_lua.c


 *** ../vim-7.4.617/src/if_lua.c 2015-02-03 12:55:11.136179596 +0100
 --- src/if_lua.c2015-02-03 23:07:59.892636921 +0100
 ***
 *** 1547,1552 
 --- 1547,1553 
 abort = set_ref_in_item(tv, copyID, NULL, NULL);
   }
   lua_pushinteger(L, abort);
 + return 0;
   }


Return value should be 1 which is number of results.
http://www.lua.org/manual/5.3/manual.html#lua_CFunction

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: [7.4.50] [BUG] (G)Vim exits Insert mode after I type letter U+00F2

2015-02-01 Fir de Conversatie Yukihiro Nakadaira
On Sat, Jan 31, 2015 at 9:58 PM, Khang Nguyen khang.soc...@gmail.com
wrote:

 Thank you for your reply.

 Your suggestion really helps me in investigating the case.

 With 'gvim -u NONE', I can type the letter 'ň' (U+00F2) without any
 errors. This suggests that the cause is in my .vimrc. To be specific,
 the following line in my .vimrc was causing the problem :

 imap A-r Esc

 I had a chance to test on another Debian Stable machine, and found that
 without any input methods active, pressing A-r makes Gvim and Xterm
 output letter 'ň'.

 So i think this is an coincidence when the UTF-8 representation of letter
 'ň' is the same as A-r.

 Basically, I conclude that this is not a vim error. If you think so, this
 can be closed.


I think this is a problem that Vim applies mappings to pre-edit text.

Currently Vim shows pre-edit text as over-the-spot.  Vim inserts
pre-edit text to the buffer temporarily to show it.  But as commented at
im_preedit_changed_cb() in the source code, over-the-spot implementation
have a few problem.

I would like to suggest to use on-the-spot (i.e to show pre-edit text in
the separated window).

Simple way is to let IM to show pre-edit text.

diff -r 84171683fd66 src/mbyte.c
--- a/src/mbyte.cTue Jan 27 22:52:15 2015 +0100
+++ b/src/mbyte.cSun Feb 01 17:39:50 2015 +0900
@@ -5018,6 +5018,7 @@
 g_signal_connect(G_OBJECT(xic), preedit_end,
  G_CALLBACK(im_preedit_end_cb), NULL);

+gtk_im_context_set_use_preedit(xic, FALSE);
 gtk_im_context_set_client_window(xic, gui.drawarea-window);
 }

However, IM's implementation might not work nicely.  It might be better
to use own window (patch is attached).

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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 -r 84171683fd66 src/edit.c
--- a/src/edit.cTue Jan 27 22:52:15 2015 +0100
+++ b/src/edit.cSun Feb 01 17:59:03 2015 +0900
@@ -9361,12 +9361,7 @@
 tpos = curwin-w_cursor;
 if (oneleft() == OK)
 {
-#if defined(FEAT_XIM)  defined(FEAT_GUI_GTK)
-   /* Only call start_arrow() when not busy with preediting, it will
-* break undo.  K_LEFT is inserted in im_correct_cursor(). */
-   if (!im_is_preediting())
-#endif
-   start_arrow(tpos);
+   start_arrow(tpos);
 #ifdef FEAT_RIGHTLEFT
/* If exit reversed string, position is fixed */
if (revins_scol != -1  (int)curwin-w_cursor.col = revins_scol)
diff -r 84171683fd66 src/ex_getln.c
--- a/src/ex_getln.cTue Jan 27 22:52:15 2015 +0100
+++ b/src/ex_getln.cSun Feb 01 17:59:03 2015 +0900
@@ -94,9 +94,6 @@
 static voidsave_cmdline __ARGS((struct cmdline_info *ccp));
 static voidrestore_cmdline __ARGS((struct cmdline_info *ccp));
 static int cmdline_paste __ARGS((int regname, int literally, int remcr));
-#if defined(FEAT_XIM)  defined(FEAT_GUI_GTK)
-static voidredrawcmd_preedit __ARGS((void));
-#endif
 #ifdef FEAT_WILDMENU
 static voidcmdline_del __ARGS((int from));
 #endif
@@ -2484,106 +2481,6 @@
 }
 #endif
 
-#if (defined(FEAT_XIM)  (defined(FEAT_GUI_GTK))) || defined(PROTO)
-/*
- * Return the virtual column number at the current cursor position.
- * This is used by the IM code to obtain the start of the preedit string.
- */
-colnr_T
-cmdline_getvcol_cursor()
-{
-if (ccline.cmdbuff == NULL || ccline.cmdpos  ccline.cmdlen)
-   return MAXCOL;
-
-# ifdef FEAT_MBYTE
-if (has_mbyte)
-{
-   colnr_T col;
-   int i = 0;
-
-   for (col = 0; i  ccline.cmdpos; ++col)
-   i += (*mb_ptr2len)(ccline.cmdbuff + i);
-
-   return col;
-}
-else
-# endif
-   return ccline.cmdpos;
-}
-#endif
-
-#if defined(FEAT_XIM)  defined(FEAT_GUI_GTK)
-/*
- * If part of the command line is an IM preedit string, redraw it with
- * IM feedback attributes.  The cursor position is restored after drawing.
- */
-static void
-redrawcmd_preedit()
-{
-if ((State  CMDLINE)
-xic != NULL
-   /*  im_get_status()  doesn't work when using SCIM */
-!p_imdisable
-im_is_preediting())
-{
-   int cmdpos = 0;
-   int cmdspos;
-   int old_row;
-   int old_col;
-   colnr_T col;
-
-   old_row = msg_row;
-   old_col = msg_col;
-   cmdspos = ((ccline.cmdfirstc != NUL) ? 1 : 0) + ccline.cmdindent;
-
-# ifdef FEAT_MBYTE
-   if (has_mbyte)
-   {
-   for (col = 0; col  preedit_start_col
-  cmdpos  ccline.cmdlen; ++col)
-   {
-   cmdspos += (*mb_ptr2cells

Re: [7.4.50] [BUG] (G)Vim exits Insert mode after I type letter U+00F2

2015-02-01 Fir de Conversatie Yukihiro Nakadaira
 Currently Vim shows pre-edit text as over-the-spot.  Vim inserts
 pre-edit text to the buffer temporarily to show it.  But as commented at
 im_preedit_changed_cb() in the source code, over-the-spot implementation
 have a few problem.

s/over-the-spot/on-the-spot/

 I would like to suggest to use on-the-spot (i.e to show pre-edit text in
 the separated window).

s/on-the-spot/over-the-spot/

-- 
-- 
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: [7.4.50] [BUG] (G)Vim exits Insert mode after I type letter U+00F2

2015-01-31 Fir de Conversatie Yukihiro Nakadaira
On Wed, Jan 28, 2015 at 5:27 AM, Nony Sense khang.soc...@gmail.com wrote:

 Hi,

 When I typed the letter U+00F2 (latin small letter o with grave) with
 input methods active, and pressed space bar, vim (and gvim)
 automatically exited insert mode, returned back to normal mode. Only 1
 space character was added as the cursor moved forward, the letter didn't
 appear.

 To type the letter U+00F2, with input methods on, I would type in insert
 mode
 'o' then '2' then 'spacebar'.

 The input methods that I have tried :
 scim version : 1.4.14

scim-unikey : 0.3.1
scim-vi-vni : built-in

 ibus verion : 1.3.19
ibus-unikey : 0.5.1

 With normal Vim and XTerm please do the similar tasks as below.
 Steps to reproduce (with Gvim):
 With scim
   1. Setup scim
   2. environment GTK_IM_MODULE=scim
  GTK_IM_MODULE_FILE=to-the-correct-immodules.cache (or
  similar filename)
   3. In scim setup  Global Setup, disable all but Vietnamese.
   4. Now assuming gvim and scim is ready.
  In gvim, 'i' to go to insert mode.
  Press Ctrl-Space to activate scim, then choose Vietnamese-vi-vni
  in scim toolbar. (or Vietnamese-Unikey, and choose vni instead
  of telex)
  Then type 'o' then '2' then space.
   5. Gvim should go back to normal mode while it should have shown
   letter ò (letter U+00F2) instead.

 With ibus, the procedure is similar.

 Here is what I saw with :set verbose=20 :
 after typing 'o','2','spacebar' with scim activated:


I can not reproduce the problem with ibus on ubuntu.

  ubuntu 14.10
  ibus 1.5.8-2ubuntu2
  ibus-unikey 0.6.1-1build2
  vim 7.4.050

Is it still reproducible with gvim -u NONE (no vimrc, no plugins)?

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


systemlist() returns locked value.

2015-01-25 Fir de Conversatie Yukihiro Nakadaira
systemlist() returns locked value.

Steps to reproduce:
  $ vim -u NONE
  :echo map(systemlist('ls'), '0')
  E741: Value is locked: map() argument
or
  E742: Cannot change value of map() argument

v_lock is not initialized when creating result list.

diff -r e9538738fd8c src/eval.c
--- a/src/eval.cWed Jan 07 19:04:29 2015 +0100
+++ b/src/eval.cMon Jan 26 13:48:30 2015 +0900
@@ -18708,6 +18708,7 @@
 goto errret;
 }
 li-li_tv.v_type = VAR_STRING;
+li-li_tv.v_lock = 0;
 li-li_tv.vval.v_string = s;
 list_append(list, li);
 }

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


typo in tag for :help :si

2014-12-18 Fir de Conversatie Yukihiro Nakadaira
I think that short tag for :simalt should be :sim.

diff -r ab36689121ad runtime/doc/gui_w32.txt
--- a/runtime/doc/gui_w32.txtWed Dec 17 21:00:49 2014 +0100
+++ b/runtime/doc/gui_w32.txtThu Dec 18 19:31:16 2014 +0900
@@ -452,7 +452,7 @@
 You can drag and drop one or more files into the Vim window, where they
will
 be opened as normal.  See |drag-n-drop|.

-*:simalt* *:si*
+*:simalt* *:sim*
 :sim[alt] {key}simulate pressing {key} while holding Alt pressed.
 {not in Vi} {only for Win32 versions}

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


In :help col() and virtcol(), v is not listed in the accepted positions.

2014-12-06 Fir de Conversatie Yukihiro Nakadaira
In :help col() and virtcol(), v is not listed in the accepted positions.

diff -r 946876e24d5d runtime/doc/eval.txt
--- a/runtime/doc/eval.txtSun Dec 07 00:18:33 2014 +0100
+++ b/runtime/doc/eval.txtSun Dec 07 15:28:19 2014 +0900
@@ -2395,6 +2395,10 @@
 number of bytes in the cursor line plus one)
 'xposition of mark x (if the mark is not set, 0 is
 returned)
+vIn Visual mode: the start of the Visual area (the
+cursor is the end).  When not in Visual mode
+returns the cursor position.  Differs from |'| in
+that it's updated right away.
 Additionally {expr} can be [lnum, col]: a |List| with the line
 and column number. Most useful when the column is $, to get
 the last column of a specific line.  When lnum or col is
@@ -6418,6 +6422,10 @@
 plus one)
 'xposition of mark x (if the mark is not set, 0 is
 returned)
+vIn Visual mode: the start of the Visual area (the
+cursor is the end).  When not in Visual mode
+returns the cursor position.  Differs from |'| in
+that it's updated right away.
 Note that only marks in the current file can be used.
 Examples: 
   virtcol(.)   with text foo^Lbar, with cursor on the ^L,
returns 5

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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

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


Vim crashes with list range assign.

2014-12-01 Fir de Conversatie Yukihiro Nakadaira
Vim crashes with list range assign.

Steps to reproduce:
  $ vim -u NONE
  :let x = [0]
  :let x[:] = [1, 2]
  Vim: Caught deadly signal SEGV
  Vim: Finished.

Please check the following patch.


diff -r 4604a182f04c src/eval.c
--- a/src/eval.cSun Nov 30 22:51:06 2014 +0100
+++ b/src/eval.cMon Dec 01 22:02:13 2014 +0900
@@ -2951,7 +2951,7 @@
 /*
  * Check whether any of the list items is locked
  */
-for (ri = rettv-vval.v_list-lv_first; ri != NULL; )
+for (ri = rettv-vval.v_list-lv_first; ri != NULL  ll_li != NULL; )
 {
 if (tv_check_lock(ll_li-li_tv.v_lock, lp-ll_name))
 return;
diff -r 4604a182f04c src/testdir/test55.in
--- a/src/testdir/test55.inSun Nov 30 22:51:06 2014 +0100
+++ b/src/testdir/test55.inMon Dec 01 22:02:13 2014 +0900
@@ -401,6 +401,11 @@
 :  $put =v:exception[:15] . v:exception[-1:-1]
 :endtry
 :$put =string(d)
+:
+: test for range assign
+:let l = [0]
+:let l[:] = [1, 2]
+:$put =string(l)
 :endfun
 :
 :call Test(1, 2, [3, 4], {5: 6})   This may take a while
diff -r 4604a182f04c src/testdir/test55.ok
--- a/src/testdir/test55.okSun Nov 30 22:51:06 2014 +0100
+++ b/src/testdir/test55.okMon Dec 01 22:02:13 2014 +0900
@@ -129,6 +129,7 @@
 {'a': {'b': 'B'}}
 Vim(call):E737: a
 {'a': {'b': 'B'}}
+[1, 2]
 Vim(foldopen):E490:

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


typo in eval.txt

2014-09-27 Fir de Conversatie Yukihiro Nakadaira
Argument of count() is mistaken.

diff -r 3d9d6241de2b runtime/doc/eval.txt
--- a/runtime/doc/eval.txtWed Sep 24 13:26:44 2014 +0200
+++ b/runtime/doc/eval.txtSat Sep 27 16:27:16 2014 +0900
@@ -1751,7 +1751,7 @@
 copy( {expr})anymake a shallow copy of {expr}
 cos( {expr})Floatcosine of {expr}
 cosh( {expr})Floathyperbolic cosine of {expr}
-count( {list}, {expr} [, {start} [, {ic}]])
+count( {list}, {expr} [, {ic} [, {start}]])
 Number count how many {expr} are in {list}
 cscope_connection( [{num} , {dbpath} [, {prepend}]])
 Numberchecks existence of cscope connection

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


localoptions is not listed in :help 'viewoptions'.

2014-09-05 Fir de Conversatie Yukihiro Nakadaira
:help :mkview says

  3. Restore mappings, abbreviations and options local to the window if
 'viewoptions' contains options or localoptions.  ...

But localoptions is not listed in :help 'viewoptions'.

diff -r dde8ff798ed9 runtime/doc/options.txt
--- a/runtime/doc/options.txtSat Aug 30 18:10:19 2014 +0200
+++ b/runtime/doc/options.txtFri Sep 05 19:57:54 2014 +0900
@@ -7848,6 +7848,7 @@
cursorcursor position in file and in window
foldsmanually created folds, opened/closed folds and local
 fold options
+   localoptionssame as options
optionsoptions and mappings local to a window or buffer (not
 global values for local options)
slashbackslashes in file names replaced with forward

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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

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


:set all doesn't reset indent amount for cindent.

2014-08-27 Fir de Conversatie Yukihiro Nakadaira
:set all doesn't reset indent amount for cindent.

Steps to reproduce:
  $ vim -u NONE
  :set shiftwidth=2
  :set all
  :set shiftwidth?
shiftwidth=8
  :set cindent
  i{
  This line should be indented with 8 spaces (tab character).
  }Esc

Result:
{
  This line should be indented with 8 spaces (tab character).
}

Expected:
{
---This line should be indented with 8 spaces (tab character).
}


Cindent uses buffer local cache value. But :set all doesn't reset it.

diff -r babc6a1d4c27 src/option.c
--- a/src/option.cSat Aug 23 15:31:19 2014 +0200
+++ b/src/option.cThu Aug 28 10:56:40 2014 +0900
@@ -3642,6 +3642,10 @@
 #else
 win_comp_scroll(curwin);
 #endif
+
+#ifdef FEAT_CINDENT
+parse_cino(curbuf);
+#endif
 }

 /*

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


doc fix for :help arglistid()

2014-08-19 Fir de Conversatie Yukihiro Nakadaira
According to :help arglistid(), it returns zero for invalid argument.
But it returns -1 instead.

diff -r 7af530381fec runtime/doc/eval.txt
--- a/runtime/doc/eval.txtSun Aug 17 17:24:07 2014 +0200
+++ b/runtime/doc/eval.txtTue Aug 19 21:28:25 2014 +0900
@@ -2113,7 +2113,7 @@
 Return the argument list ID.  This is a number which
 identifies the argument list being used.  Zero is used for the
 global argument list.
-Return zero if the arguments are invalid.
+Return -1 if the arguments are invalid.

 Without arguments use the current window.
 With {winnr} only use this window in the current tab page.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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

2014-08-15 Fir de Conversatie Yukihiro Nakadaira
On Sat, Aug 16, 2014 at 1:08 AM, h_east h.east@gmail.com wrote:

 Bram,

 2014/7/10(Thu) 3:21:03 UTC+9 Bram Moolenaar:
  Patch 7.4.362
 
  Problem:When matchaddpos() uses a length smaller than the number of
 bytes
 
in the (last) character the highlight continues until the end
 of
 
the line.
 
  Solution:   Change condition from equal to larger-or-equal.
 
  Files:src/screen.c
 
 
 
 
 
  *** ../vim-7.4.361/src/screen.c   2014-07-03 22:54:04.911859458 +0200
 
  --- src/screen.c  2014-07-09 20:14:46.611627298 +0200
 
  ***
 
  *** 3852,3858 
 
{
 
shl-attr_cur = shl-attr;
 
}
 
  ! else if (v == (long)shl-endcol)
 
{
 
shl-attr_cur = 0;
 
next_search_hl(wp, shl, lnum, (colnr_T)v, cur);
 
  --- 3852,3858 
 
{
 
shl-attr_cur = shl-attr;
 
}
 
  ! else if (v = (long)shl-endcol)
 
{
 
shl-attr_cur = 0;
 
next_search_hl(wp, shl, lnum, (colnr_T)v, cur);
 
  *** ../vim-7.4.361/src/version.c  2014-07-09 19:58:21.115647328 +0200
 
  --- src/version.c 2014-07-09 20:20:14.423620635 +0200
 
  ***
 
  *** 736,737 
 
  --- 736,739 
 
{   /* Add new patch number below this line */
 
  + /**/
 
  + 362,
 
/**/

 After patch 7.4.362, Processing time is slow under certain conditions.

 That condition is 'set hlsearch' and 'set cursorline'.

 I've prepared a script file(test603.vim) for verification.
 
 function! T()
 call cursor(1, 1)
 let t = reltime()
 for l in range(1, line('$'))
 call cursor(l, 1)
 redraw
 endfor
 echo reltimestr(reltime(t))
 endfunction

 function! S()
 let s = []
 for l in range(1, line('$'))
 let s += ['\%' . l . 'l\%(abcde\)']
 endfor
 let @/ = join(s, '\|')
 endfunction

 :set hlsearch
 :set cursorline
 :call setline(1, repeat(['abcdef'], 100))
 :call S()
 :call T()
 

 Exec below.
 $ vim -N -u test603.vim

 Exec result:
 Vim Ver.  Elasped time
 7.4.131   0.045500
 7.4.361   0.046550
 7.4.362   1.136427   -- It is 25 times slower.
 7.4.398   1.135489

 I think patch 7.4.362 is not enough multi-byte support.

 I wrote a patch.
 Vim 7.4.404 with my patch elapsed time is 0.053999!
 Please check this.


It doesn't work when highlighting multiple characters.

$ vim -u NONE
:set encoding=utf-8
:call setline(1, 'aáaaa')
:hi Test guibg=red ctermbg=red
:call matchaddpos('Test', [[1, 1, 2]])

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: Upward tag search not finding tag file in relative directory

2014-08-05 Fir de Conversatie Yukihiro Nakadaira
On Tue, Aug 5, 2014 at 11:38 PM, patrick.hem...@gmail.com wrote:

 On Saturday, June 28, 2014 1:59:59 PM UTC-4, patrick...@gmail.com wrote:
  On Saturday, June 28, 2014 1:42:08 PM UTC-4, Ben Fritz wrote:
   On Saturday, June 28, 2014 3:59:08 AM UTC-5, patrick...@gmail.com
 wrote:
I keep my tag files in the `.git` directory when in a git repo. Thus
 my `tags` option includes ./.git/tags;. If I'm in the top level of the
 repo, it will find the tag file, but if I'm in a nested directory, it does
 not.
   
This used to work as of vim 7.3.762, but after upgrading to 7.4.326
 it no longer does.
   
-Patrick
  
   What system are you running on? There is a known problem with upward
 search on Windows, where the search won't actually start if the given
 relative directory does not exist from the current path. I can't find the
 thread, though.
 
  Linux.
 
  -Patrick

 Anyone? Is this a bug? Is there any additional information I should
 provide?


Anyway, this behavior is introduced by 7.3.1297.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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

2014-07-17 Fir de Conversatie Yukihiro Nakadaira
On Thu, Jul 17, 2014 at 6:32 AM, Bram Moolenaar b...@moolenaar.net wrote:


 Yukihiro Nakadaira wrote:

  --047d7bdc801adb733f04fe52c63e
  Content-Type: text/plain; charset=UTF-8
 
  On Thu, Jul 17, 2014 at 1:53 AM, Yukihiro Nakadaira 
  yukihiro.nakada...@gmail.com wrote:
 
   On Thu, Jul 17, 2014 at 1:38 AM, Yukihiro Nakadaira 
   yukihiro.nakada...@gmail.com wrote:
  
  
   On Thu, Jul 17, 2014 at 1:19 AM, Bram Moolenaar b...@moolenaar.net
   wrote:
  
  
   Patch 7.4.372
   Problem:When 'winminheight' is zero there might not be one line
 for
   the
   current window.
   Solution:   Change the size computations. (Yukihiro Nakadaira)
   Files:  src/window.c
  
  
   I'm sorry, this patch have a bug.  Please revert for now.
  
   $ vim -u NONE -N
   :set winminwidth=0 winminheight=0
   :while 1 | split | endwhile
   :topleft vsplit
   :split
   E36: Not enough room
   Expected: split the window
  
  
   I'm sorry, this behavior is not due to this patch.  This seems original
   behavior.  hmm...
  
 
  With or without this patch, split will fail when 'winminheight' is
 non-zero.
 
  $ vim -u NONE -N
  :set winminheight=1
  :while 1 | split | endwhile
  :topleft vsplit
  :split
  E36: Not enough room

 I'll add it on the todo list.


I wrote patch for this problem.  Please check the attached patch.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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 -r febc041c984b src/window.c
--- a/src/window.c  Wed Jul 16 23:39:54 2014 +0200
+++ b/src/window.c  Thu Jul 17 18:21:30 2014 +0900
@@ -684,7 +684,7 @@
 intavailable;
 intoldwin_height = 0;
 intlayout;
-frame_T*frp, *curfrp;
+frame_T*frp, *curfrp, *frp2, *prevfrp;
 intbefore;
 intminheight;
 intwmh1;
@@ -730,12 +730,33 @@
needed = wmw1 + 1;
if (flags  WSP_ROOM)
needed += p_wiw - wmw1;
-   if (p_ea || (flags  (WSP_BOT | WSP_TOP)))
+   if (flags  (WSP_BOT | WSP_TOP))
{
minwidth = frame_minwidth(topframe, NOWIN);
available = topframe-fr_width;
needed += minwidth;
}
+   else if (p_ea)
+   {
+   minwidth = frame_minwidth(oldwin-w_frame, NOWIN);
+   prevfrp = oldwin-w_frame;
+   for (frp = oldwin-w_frame-fr_parent; frp != NULL;
+   frp = frp-fr_parent)
+   {
+   if (frp-fr_layout == FR_ROW)
+   {
+   for (frp2 = frp-fr_child; frp2 != NULL;
+   frp2 = frp2-fr_next)
+   {
+   if (frp2 != prevfrp)
+   minwidth += frame_minwidth(frp2, NOWIN);
+   }
+   }
+   prevfrp = frp;
+   }
+   available = topframe-fr_width;
+   needed += minwidth;
+   }
else
{
minwidth = frame_minwidth(oldwin-w_frame, NOWIN);
@@ -798,12 +819,33 @@
needed = wmh1 + STATUS_HEIGHT;
if (flags  WSP_ROOM)
needed += p_wh - wmh1;
-   if (p_ea || (flags  (WSP_BOT | WSP_TOP)))
+   if (flags  (WSP_BOT | WSP_TOP))
{
minheight = frame_minheight(topframe, NOWIN) + need_status;
available = topframe-fr_height;
needed += minheight;
}
+   else if (p_ea)
+   {
+   minheight = frame_minheight(oldwin-w_frame, NOWIN) + need_status;
+   prevfrp = oldwin-w_frame;
+   for (frp = oldwin-w_frame-fr_parent; frp != NULL;
+   frp = frp-fr_parent)
+   {
+   if (frp-fr_layout == FR_COL)
+   {
+   for (frp2 = frp-fr_child; frp2 != NULL;
+   frp2 = frp2-fr_next)
+   {
+   if (frp2 != prevfrp)
+   minheight += frame_minheight(frp2, NOWIN);
+   }
+   }
+   prevfrp = frp;
+   }
+   available = topframe-fr_height;
+   needed += minheight;
+   }
else
{
minheight = frame_minheight(oldwin-w_frame, NOWIN) + need_status;


Re: :botright split create window with invalid size when there is only a few spaces.

2014-07-16 Fir de Conversatie Yukihiro Nakadaira
On Wed, Jul 16, 2014 at 9:35 AM, Yukihiro Nakadaira 
yukihiro.nakada...@gmail.com wrote

 I found another problem that zero width/height current window is created.
 hmm...

 $ vim -u NONE -N
 :set noequalalways winminheight=0
 :while 1 | split | endwhile

 $ vim -u NONE -N
 :set noequalalways winminwidth=0
 :while 1 | vsplit | endwhile


I wrote patch for this problem.  This patch contains a few cleaning up
for previous patch.  Please check the attached patch.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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 -r 616723e9f486 src/window.c
--- a/src/window.c  Wed Jul 16 17:01:54 2014 +0200
+++ b/src/window.c  Thu Jul 17 00:10:50 2014 +0900
@@ -688,6 +688,8 @@
 intbefore;
 intminwidth;
 intminheight;
+intwmw1;
+intwmh1;
 
 if (flags  WSP_TOP)
oldwin = firstwin;
@@ -722,19 +724,22 @@
 * Check if we are able to split the current window and compute its
 * width.
 */
-   needed = p_wmw + 1;
+   /* Current window requires at least 1 space. */
+   wmw1 = (p_wmw == 0 ? 1 : p_wmw);
+   needed = wmw1 + 1;
if (flags  WSP_ROOM)
-   needed += p_wiw - p_wmw;
+   needed += p_wiw - wmw1;
if (p_ea || (flags  (WSP_BOT | WSP_TOP)))
{
-   minwidth = frame_minwidth(topframe, NULL);
+   minwidth = frame_minwidth(topframe, NOWIN);
available = topframe-fr_width;
needed += minwidth;
}
else
{
-   minwidth = frame_minwidth(oldwin-w_frame, NULL);
-   available = oldwin-w_width;
+   minwidth = frame_minwidth(oldwin-w_frame, NOWIN);
+   available = oldwin-w_frame-fr_width;
+   needed += minwidth;
}
if (available  needed  new_wp == NULL)
{
@@ -743,12 +748,10 @@
}
if (new_size == 0)
new_size = oldwin-w_width / 2;
-   if (new_size  oldwin-w_width - p_wmw - 1)
-   new_size = oldwin-w_width - p_wmw - 1;
if (new_size  available - minwidth - 1)
new_size = available - minwidth - 1;
-   if (new_size  p_wmw)
-   new_size = p_wmw;
+   if (new_size  wmw1)
+   new_size = wmw1;
 
/* if it doesn't fit in the current window, need win_equal() */
if (oldwin-w_width - new_size - 1  p_wmw)
@@ -789,20 +792,22 @@
 * Check if we are able to split the current window and compute its
 * height.
 */
-   needed = p_wmh + STATUS_HEIGHT + need_status;
+   /* Current window requires at least 1 space. */
+   wmh1 = (p_wmh == 0 ? 1 : p_wmh);
+   needed = wmh1 + STATUS_HEIGHT;
if (flags  WSP_ROOM)
-   needed += p_wh - p_wmh;
+   needed += p_wh - wmh1;
if (p_ea || (flags  (WSP_BOT | WSP_TOP)))
{
-   minheight = frame_minheight(topframe, NULL);
+   minheight = frame_minheight(topframe, NOWIN) + need_status;
available = topframe-fr_height;
needed += minheight;
}
else
{
-   minheight = frame_minheight(oldwin-w_frame, NULL);
-   available = oldwin-w_height;
-   needed += p_wmh;
+   minheight = frame_minheight(oldwin-w_frame, NOWIN) + need_status;
+   available = oldwin-w_frame-fr_height;
+   needed += minheight;
}
if (available  needed  new_wp == NULL)
{
@@ -817,13 +822,10 @@
}
if (new_size == 0)
new_size = oldwin_height / 2;
-
-   if (new_size  oldwin_height - p_wmh - STATUS_HEIGHT)
-   new_size = oldwin_height - p_wmh - STATUS_HEIGHT;
if (new_size  available - minheight - STATUS_HEIGHT)
new_size = available - minheight - STATUS_HEIGHT;
-   if (new_size  p_wmh)
-   new_size = p_wmh;
+   if (new_size  wmh1)
+   new_size = wmh1;
 
/* if it doesn't fit in the current window, need win_equal() */
if (oldwin_height - new_size - STATUS_HEIGHT  p_wmh)


Re: Patch 7.4.372

2014-07-16 Fir de Conversatie Yukihiro Nakadaira
On Thu, Jul 17, 2014 at 1:19 AM, Bram Moolenaar b...@moolenaar.net wrote:


 Patch 7.4.372
 Problem:When 'winminheight' is zero there might not be one line for the
 current window.
 Solution:   Change the size computations. (Yukihiro Nakadaira)
 Files:  src/window.c


I'm sorry, this patch have a bug.  Please revert for now.

$ vim -u NONE -N
:set winminwidth=0 winminheight=0
:while 1 | split | endwhile
:topleft vsplit
:split
E36: Not enough room
Expected: split the window

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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

2014-07-16 Fir de Conversatie Yukihiro Nakadaira
On Thu, Jul 17, 2014 at 1:38 AM, Yukihiro Nakadaira 
yukihiro.nakada...@gmail.com wrote:


 On Thu, Jul 17, 2014 at 1:19 AM, Bram Moolenaar b...@moolenaar.net
 wrote:


 Patch 7.4.372
 Problem:When 'winminheight' is zero there might not be one line for
 the
 current window.
 Solution:   Change the size computations. (Yukihiro Nakadaira)
 Files:  src/window.c


 I'm sorry, this patch have a bug.  Please revert for now.

 $ vim -u NONE -N
 :set winminwidth=0 winminheight=0
 :while 1 | split | endwhile
 :topleft vsplit
 :split
 E36: Not enough room
 Expected: split the window


I'm sorry, this behavior is not due to this patch.  This seems original
behavior.  hmm...

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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

2014-07-16 Fir de Conversatie Yukihiro Nakadaira
On Thu, Jul 17, 2014 at 1:53 AM, Yukihiro Nakadaira 
yukihiro.nakada...@gmail.com wrote:

 On Thu, Jul 17, 2014 at 1:38 AM, Yukihiro Nakadaira 
 yukihiro.nakada...@gmail.com wrote:


 On Thu, Jul 17, 2014 at 1:19 AM, Bram Moolenaar b...@moolenaar.net
 wrote:


 Patch 7.4.372
 Problem:When 'winminheight' is zero there might not be one line for
 the
 current window.
 Solution:   Change the size computations. (Yukihiro Nakadaira)
 Files:  src/window.c


 I'm sorry, this patch have a bug.  Please revert for now.

 $ vim -u NONE -N
 :set winminwidth=0 winminheight=0
 :while 1 | split | endwhile
 :topleft vsplit
 :split
 E36: Not enough room
 Expected: split the window


 I'm sorry, this behavior is not due to this patch.  This seems original
 behavior.  hmm...


With or without this patch, split will fail when 'winminheight' is non-zero.

$ vim -u NONE -N
:set winminheight=1
:while 1 | split | endwhile
:topleft vsplit
:split
E36: Not enough room

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


:botright split create window with invalid size when there is only a few spaces.

2014-07-15 Fir de Conversatie Yukihiro Nakadaira
:botright split create window with invalid size when there is only a few
spaces.

Steps to reproduce:

  $ vim -u NONE -N
  :vsplit
  :while 1 | split | endwhile
  :quit
  :botright split
  :echo winheight(0)
  11(actual height is 2 or 3)
  oCRCRCRCRCRCRCRCRCRCRCR   (editing buffer may
cause crash)
  Vim: Caught deadly signal SEGV

  It is same with :botright vsplit

  $ vim -u NONE -N
  :split
  :while 1 | vsplit | endwhile
  :quit
  :botright vsplit
  :echo winheight(0)
  40(actual width is 2 or 3)

Please check the attached patch.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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 -r 0efec12f52ac src/window.c
--- a/src/window.c  Thu Jul 10 22:01:47 2014 +0200
+++ b/src/window.c  Tue Jul 15 23:07:51 2014 +0900
@@ -686,6 +686,8 @@
 intlayout;
 frame_T*frp, *curfrp;
 intbefore;
+intminwidth;
+intminheight;
 
 if (flags  WSP_TOP)
oldwin = firstwin;
@@ -725,11 +727,15 @@
needed += p_wiw - p_wmw;
if (p_ea || (flags  (WSP_BOT | WSP_TOP)))
{
+   minwidth = frame_minwidth(topframe, NULL);
available = topframe-fr_width;
-   needed += frame_minwidth(topframe, NULL);
+   needed += minwidth;
}
else
+   {
+   minwidth = frame_minwidth(oldwin-w_frame, NULL);
available = oldwin-w_width;
+   }
if (available  needed  new_wp == NULL)
{
EMSG(_(e_noroom));
@@ -739,6 +745,8 @@
new_size = oldwin-w_width / 2;
if (new_size  oldwin-w_width - p_wmw - 1)
new_size = oldwin-w_width - p_wmw - 1;
+   if (new_size  available - minwidth - 1)
+   new_size = available - minwidth - 1;
if (new_size  p_wmw)
new_size = p_wmw;
 
@@ -786,11 +794,13 @@
needed += p_wh - p_wmh;
if (p_ea || (flags  (WSP_BOT | WSP_TOP)))
{
+   minheight = frame_minheight(topframe, NULL);
available = topframe-fr_height;
-   needed += frame_minheight(topframe, NULL);
+   needed += minheight;
}
else
{
+   minheight = frame_minheight(oldwin-w_frame, NULL);
available = oldwin-w_height;
needed += p_wmh;
}
@@ -810,6 +820,8 @@
 
if (new_size  oldwin_height - p_wmh - STATUS_HEIGHT)
new_size = oldwin_height - p_wmh - STATUS_HEIGHT;
+   if (new_size  available - minheight - STATUS_HEIGHT)
+   new_size = available - minheight - STATUS_HEIGHT;
if (new_size  p_wmh)
new_size = p_wmh;
 


Re: :botright split create window with invalid size when there is only a few spaces.

2014-07-15 Fir de Conversatie Yukihiro Nakadaira
On Tue, Jul 15, 2014 at 11:56 PM, Yukihiro Nakadaira 
yukihiro.nakada...@gmail.com wrote:

 :botright split create window with invalid size when there is only a few
 spaces.

 Steps to reproduce:

   $ vim -u NONE -N
   :vsplit
   :while 1 | split | endwhile
   :quit
   :botright split
   :echo winheight(0)
   11(actual height is 2 or 3)
   oCRCRCRCRCRCRCRCRCRCRCR   (editing buffer may
 cause crash)
   Vim: Caught deadly signal SEGV

   It is same with :botright vsplit

   $ vim -u NONE -N
   :split
   :while 1 | vsplit | endwhile
   :quit
   :botright vsplit
   :echo winheight(0)
   40(actual width is 2 or 3)


I found another problem that zero width/height current window is created.
hmm...

$ vim -u NONE -N
:set noequalalways winminheight=0
:while 1 | split | endwhile

$ vim -u NONE -N
:set noequalalways winminwidth=0
:while 1 | vsplit | endwhile

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: LUA interface giving me trouble with garbage collection patch

2014-07-11 Fir de Conversatie Yukihiro Nakadaira
On Fri, Jul 11, 2014 at 12:49 AM, Ben Fritz fritzophre...@gmail.com wrote:

 On Wednesday, July 9, 2014 11:24:50 PM UTC-5, Yukihiro Nakadaira wrote:
 
  Here is sample code.
 
  [edited]
 
  L = luaL_newstate();
 
  lua_pushcclosure(L, add, 0);
  lua_pushinteger(L, 111);
  lua_pushinteger(L, 222);
  lua_call(L, 2 /* nargs */, 1 /* nresults */);
  r = lua_tointeger(L, -1);
  lua_pop(L, 1);
  lua_close(L);

 Thanks! I'll give this a try later. What's the -1 for in lua_tointeger()?

 Is there a good way to test this when I'm done? E.g. are there LUA tests
 in Vim's test suite that will exercise the garbage collector? Or maybe a
 toy script using the LUA interface I could run myself?


I have no idea.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: getregtype() become always 1 for blockwised-star-yank on non-linux environment.

2014-07-09 Fir de Conversatie Yukihiro Nakadaira
On Wed, Jul 9, 2014 at 8:43 PM, Bram Moolenaar b...@moolenaar.net wrote:


 Yasuhiro Matsumoto wrote:

  Copy texts into star register, like: CTRL-V ll *y,
  getregtype() should return ^V3. On linux environment, it works fine
  because vim seems to handle changes of clipboard.
 
  Below is a patch to re-calculate y_width.

 I'm a bit confused: Why would it work on Linux and not on MS-Windows?
 I guess the value of y_width is computed but perhaps stored in the wrong
 location?  If that is so it would be better to copy the value of
 y_width.

 Hmm, perhaps it works to copy y_width in copy_yank_reg() ?
 No, that apparently already happens.


Vim doesn't store y_width to clipboard, so we lost y_width when copy
from clipboard.  On Linux, Vim uses its register directly without
accessing clipboard when Vim has ownership of it.  When clipboard is
owned by another Vim, we lost y_width just like on Windows.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: LUA interface giving me trouble with garbage collection patch

2014-07-09 Fir de Conversatie Yukihiro Nakadaira
On Mon, Jul 7, 2014 at 2:36 PM, Benjamin Fritz fritzophre...@gmail.com
wrote:

 I want to finish up this patch to fix a crash in Vim:
 https://groups.google.com/d/topic/vim_dev/dnN58kO5Vg4/discussion

 I changed luaV_setref() to return a value if garbage collection cannot
 safely proceed.

 But, I do not know how to get that return value back to the code
 calling it from eval.c, via set_ref_in_lua(). Can someone please
 explain briefly how the function calls in the LUA interface work? I
 cannot figure out how to get a return value back from lua_call(), in
 the C code.


Here is sample code.

#include lua.h
#include lauxlib.h
#include stdio.h

/* int add(int x, int y) */
int add(lua_State *L)
{
int x = lua_tointeger(L, 1);
int y = lua_tointeger(L, 2);
/* push result to stack */
lua_pushinteger(L, x + y);
/* return number of results */
return 1;
}

int main()
{
lua_State *L;
int r;

L = luaL_newstate();

/* r = add(111, 222) */
lua_pushcclosure(L, add, 0);
lua_pushinteger(L, 111);
lua_pushinteger(L, 222);
lua_call(L, 2 /* nargs */, 1 /* nresults */);
/* get results */
r = lua_tointeger(L, -1);
/* remove results from stack */
lua_pop(L, 1);

printf(add(111, 222) = %d\n, r);

lua_close(L);

return 0;
}

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: Cursor is not moved immediately when it is moved to other window at once.

2014-06-15 Fir de Conversatie Yukihiro Nakadaira
On Sun, Jun 15, 2014 at 9:16 PM, Christian Brabandt cbli...@256bit.org
wrote:

 On Sa, 14 Jun 2014, Yukihiro Nakadaira wrote:

  On Sat, Jun 14, 2014 at 10:03 PM, Christian Brabandt cbli...@256bit.org
 
  wrote:
 
   Hi Yukihiro!
  
   On Sa, 14 Jun 2014, Yukihiro Nakadaira wrote:
  
Cursor is not moved immediately when it is moved to other window at
 once.
   
Steps to reproduce:
  $ vim -u NONE
  :call setline(1, range(100))
  :split
  :call cursor(50, 1) | wincmd w On first window, cursor is
 not
moved.
  :wincmd w  Cursor is moved.
   
  
   This patch should fix it:
  
   diff -r 6e8b6a7f7bff src/eval.c
   --- a/src/eval.cSat Jun 14 12:53:33 2014 +0200
   +++ b/src/eval.cSat Jun 14 15:02:24 2014 +0200
   @@ -9882,6 +9882,7 @@
#endif
  
curwin-w_set_curswant = TRUE;
   +setcursor();
rettv-vval.v_number = 0;
}
  
 
  Thank you.  But it doesn't work for me.  And this problem is not only
  for cursor().  It is same with setpos() and :123.

 Yeah, looks like, this was the wrong solution. Note sure, why it seemed
 to work for me (now I can't make it work any longer). How about, this
 patch, which should redraw the old window, if the cursor position
 changed (thus it should redraw for all your problems mentioned) just
 before switching windows.

 diff --git a/src/window.c b/src/window.c
 --- a/src/window.c
 +++ b/src/window.c
 @@ -4250,6 +4250,9 @@ win_enter_ext(wp, undo_sync, curwin_inva
  /* sync undo before leaving the current buffer */
  if (undo_sync  curbuf != wp-w_buffer)
 u_sync(FALSE);
 +/* might need to redraw old window before switching (so cursor
 position
 + * will be shown correctly on the old window) */
 +update_topline();
  /* may have to copy the buffer options when 'cpo' contains 'S' */
  if (wp-w_buffer != curbuf)
 buf_copy_options(wp-w_buffer, BCO_ENTER | BCO_NOHELP);


Maybe we also need to call do_check_scrollbind() and
do_check_cursorbind() for 'scrollbind' and 'cursorbind' option?

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


Cursor is not moved immediately when it is moved to other window at once.

2014-06-14 Fir de Conversatie Yukihiro Nakadaira
Cursor is not moved immediately when it is moved to other window at once.

Steps to reproduce:
  $ vim -u NONE
  :call setline(1, range(100))
  :split
  :call cursor(50, 1) | wincmd w On first window, cursor is not
moved.
  :wincmd w  Cursor is moved.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: Cursor is not moved immediately when it is moved to other window at once.

2014-06-14 Fir de Conversatie Yukihiro Nakadaira
On Sat, Jun 14, 2014 at 10:03 PM, Christian Brabandt cbli...@256bit.org
wrote:

 Hi Yukihiro!

 On Sa, 14 Jun 2014, Yukihiro Nakadaira wrote:

  Cursor is not moved immediately when it is moved to other window at once.
 
  Steps to reproduce:
$ vim -u NONE
:call setline(1, range(100))
:split
:call cursor(50, 1) | wincmd w On first window, cursor is not
  moved.
:wincmd w  Cursor is moved.
 

 This patch should fix it:

 diff -r 6e8b6a7f7bff src/eval.c
 --- a/src/eval.cSat Jun 14 12:53:33 2014 +0200
 +++ b/src/eval.cSat Jun 14 15:02:24 2014 +0200
 @@ -9882,6 +9882,7 @@
  #endif

  curwin-w_set_curswant = TRUE;
 +setcursor();
  rettv-vval.v_number = 0;
  }


Thank you.  But it doesn't work for me.  And this problem is not only
for cursor().  It is same with setpos() and :123.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: Why vim doesn't insert cyrillic symbols properly in Ex mode?

2014-06-05 Fir de Conversatie Yukihiro Nakadaira
CC to vim_dev

On Thu, Jun 5, 2014 at 2:50 AM, Stas Malavin stas.mala...@gmail.com wrote:

 To make changes in several files I use the following script:

 echo search('publications.html') | normal olia
 href=./book_series.htmlКнижные серии/a/li
 echo search('collections.html') | d
 echo search('photo.html') | d
 wq

 Then I do
 for file in *.html do; vim -e $file  script; done

 As a result a string ^Z=86=K5 A5@88 is inserted instead of Книжные
 серии. All html files as well as the script itself are utf-8 encoded, and
 no other problems with Cyrillic revealed. What's going on?

 Thanks in advance for any comment!


In Ex mode, multi-byte character is not handled.
Please check the attached patch.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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 -r bed71c37618c src/ex_getln.c
--- a/src/ex_getln.cThu May 29 14:36:29 2014 +0200
+++ b/src/ex_getln.cThu Jun 05 22:30:34 2014 +0900
@@ -2188,6 +2188,7 @@
 intvcol = 0;
 char_u *p;
 intprev_char;
+intlen;
 
 /* Switch cursor on now.  This avoids that it happens after the \n, which
  * confuses the system function that computes tabstops. */
@@ -2264,7 +2265,17 @@
{
if (line_ga.ga_len  0)
{
-   --line_ga.ga_len;
+#ifdef FEAT_MBYTE
+   if (has_mbyte)
+   {
+   p = (char_u *)line_ga.ga_data;
+   p[line_ga.ga_len] = NUL;
+   len = (*mb_head_off)(p, p + line_ga.ga_len - 1) + 1;
+   line_ga.ga_len -= len;
+   }
+   else
+#endif
+   --line_ga.ga_len;
goto redraw;
}
continue;
@@ -2300,8 +2311,9 @@
/* redraw the line */
msg_col = startcol;
vcol = 0;
-   for (p = (char_u *)line_ga.ga_data;
- p  (char_u *)line_ga.ga_data + line_ga.ga_len; ++p)
+   p = (char_u *)line_ga.ga_data;
+   p[line_ga.ga_len] = NUL;
+   while (p  (char_u *)line_ga.ga_data + line_ga.ga_len)
{
if (*p == TAB)
{
@@ -2309,11 +2321,14 @@
{
msg_putchar(' ');
} while (++vcol % 8);
+   ++p;
}
else
{
-   msg_outtrans_len(p, 1);
-   vcol += char2cells(*p);
+   len = MB_PTR2LEN(p);
+   msg_outtrans_len(p, len);
+   vcol += ptr2cells(p);
+   p += len;
}
}
msg_clr_eos();
@@ -2362,7 +2377,15 @@
 
if (IS_SPECIAL(c1))
c1 = '?';
-   ((char_u *)line_ga.ga_data)[line_ga.ga_len] = c1;
+#ifdef FEAT_MBYTE
+   if (has_mbyte)
+   len = (*mb_char2bytes)(c1, (char_u *)line_ga.ga_data + 
line_ga.ga_len);
+   else
+#endif
+   {
+   len = 1;
+   ((char_u *)line_ga.ga_data)[line_ga.ga_len] = c1;
+   }
if (c1 == '\n')
msg_putchar('\n');
else if (c1 == TAB)
@@ -2376,10 +2399,10 @@
else
{
msg_outtrans_len(
-((char_u *)line_ga.ga_data) + line_ga.ga_len, 1);
+((char_u *)line_ga.ga_data) + line_ga.ga_len, len);
vcol += char2cells(c1);
}
-   ++line_ga.ga_len;
+   line_ga.ga_len += len;
escaped = FALSE;
 
windgoto(msg_row, msg_col);


substitute() with zero width pattern breaks multi-byte character.

2014-06-04 Fir de Conversatie Yukihiro Nakadaira
substitute() with zero width pattern breaks multi-byte character.

Steps to reproduce:
  $ vim -u NONE
  :set encoding=utf-8
  :echo substitute(\u00e1, '\zs', 'x', 'g')
  xc3xa1x

Please check the following patch.


diff -r bed71c37618c src/eval.c
--- a/src/eval.cThu May 29 14:36:29 2014 +0200
+++ b/src/eval.cWed Jun 04 20:44:48 2014 +0900
@@ -24848,8 +24848,11 @@
 if (zero_width == regmatch.startp[0])
 {
 /* avoid getting stuck on a match with an empty string */
-*((char_u *)ga.ga_data + ga.ga_len) = *tail++;
-++ga.ga_len;
+i = MB_PTR2LEN(tail);
+mch_memmove((char_u *)ga.ga_data + ga.ga_len, tail,
+(size_t)i);
+ga.ga_len += i;
+tail += i;
 continue;
 }
 zero_width = regmatch.startp[0];
diff -r bed71c37618c src/testdir/test69.in
--- a/src/testdir/test69.inThu May 29 14:36:29 2014 +0200
+++ b/src/testdir/test69.inWed Jun 04 20:44:48 2014 +0900
@@ -180,6 +180,13 @@
 byteidxcomp

 STARTTEST
+/^substitute
+:let y = substitute('123', '\zs', 'a', 'g')| put =y
+ENDTEST
+
+substitute
+
+STARTTEST
 :g/^STARTTEST/.,/^ENDTEST/d
 :1;/^Results/,$wq! test.out
 ENDTEST
diff -r bed71c37618c src/testdir/test69.ok
--- a/src/testdir/test69.okThu May 29 14:36:29 2014 +0200
+++ b/src/testdir/test69.okWed Jun 04 20:44:48 2014 +0900
@@ -160,3 +160,7 @@
 [0, 1, 3, 4, -1]
 [0, 1, 2, 4, 5, -1]

+
+substitute
+a1a2a3a
+

-- 
-- 
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: substitute() with zero width pattern breaks multi-byte character.

2014-06-04 Fir de Conversatie Yukihiro Nakadaira
On Wed, Jun 4, 2014 at 9:21 PM, Christ van Willegen cvwille...@gmail.com
wrote:

 Hi,

 On Wed, Jun 4, 2014 at 1:47 PM, Yukihiro Nakadaira
 yukihiro.nakada...@gmail.com wrote:
  substitute() with zero width pattern breaks multi-byte character.
 
  Please check the following patch.
 
  diff -r bed71c37618c src/eval.c
  --- a/src/eval.cThu May 29 14:36:29 2014 +0200
  +++ b/src/eval.cWed Jun 04 20:44:48 2014 +0900
  @@ -24848,8 +24848,11 @@
   if (zero_width == regmatch.startp[0])
   {
   /* avoid getting stuck on a match with an empty string */
  -*((char_u *)ga.ga_data + ga.ga_len) = *tail++;
  -++ga.ga_len;
  +i = MB_PTR2LEN(tail);
  +mch_memmove((char_u *)ga.ga_data + ga.ga_len, tail,
  +(size_t)i);
  +ga.ga_len += i;
  +tail += i;
   continue;
   }

 Shouldn't you check for #ifdef FEAT_MBYTE somewhere in this patch?


I think MB_PTR2LEN macro is enough for it.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


E704 error for :let t:x = function('tr')

2014-05-15 Fir de Conversatie Yukihiro Nakadaira
Help says:

  A Funcref variable must start with a capital, s:, w:, t: or b:.

But t: prefix causes error.

  :let t:x = function('tr')
  E704: Funcref variable name must start with a capital: t:x

Please check the following patch.

diff -r 94df797ed6b0 src/eval.c
--- a/src/eval.cSat Apr 12 13:12:24 2014 +0200
+++ b/src/eval.cThu May 15 23:58:09 2014 +0900
@@ -21037,7 +21037,7 @@
 char_u *name;/* points to start of variable name */
 intnew_var;  /* TRUE when creating the variable */
 {
-if (!(vim_strchr((char_u *)wbs, name[0]) != NULL  name[1] == ':')
+if (!(vim_strchr((char_u *)wbst, name[0]) != NULL  name[1] == ':')
  !ASCII_ISUPPER((name[0] != NUL  name[1] == ':')
  ? name[2] : name[0]))
 {

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


duplicate const

2014-04-08 Fir de Conversatie Yukihiro Nakadaira
os_unix.c:
  2818 static const char const *smack_copied_attributes[] =
This should be
  static const char *smack_copied_attributes[]
or
  static const char * const smack_copied_attributes[]

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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] “:execute 'if 1'” works like “:if 1”

2014-03-22 Fir de Conversatie Yukihiro Nakadaira
On Sat, Mar 22, 2014 at 11:33 PM, Bram Moolenaar b...@moolenaar.net wrote:


 ZyX wrote:

  Consider the following script:
 
  execute 'if 0'
  echo 'Not shown'
  else
  echo 'Shown'
  endif
 
  . If you source it you find that instead of 3 errors (“missing
  :endif”, “:else without :if”, “:endif without :if”) and two messages
  (“Not shown” and “Shown”) you will see one message (“Shown”) and no
  errors.
 
  Note that `execute 'if 0'` is explicitly forbidden in help:
 
   Note: The executed string may be any command-line,
 but
   you cannot start or end a while, for or if
   command.  Thus this is illegal:
   :execute 'while i  5'
   :execute 'echo test | break'

 The docs are wrong, using if is allowed.  The other two are not.


It doesn't work when it is used in nested block.

if 0
  execute 'if 1'
  endif
endif
= E580: :endif without :if: endif

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: issues with python and python3 commands

2014-02-27 Fir de Conversatie Yukihiro Nakadaira
On Wed, Feb 19, 2014 at 10:48 PM, antonis.loumio...@gmail.com wrote:

 I posted in this thread
 https://groups.google.com/forum/?hl=en#!searchin/vim_dev/python|sort:date/vim_dev/ASokGp_zCCc/HnOGHTfAZNwJa
  while ago about Vim crashing whenever I use the :python command.  Today I
 realized that the problem was that I had not installed Python 2.7 but only
 Python 3.3.  As soon as I installed Python 2.7 Vim stopped crashing after a
 :py command! It would have been better that a warning message was displayed
 that informed that Python 2.7 is not found instead of Vim crashing but I'm
 happy now that I found what caused the crash and how to fix it!

 But now I face another similar problem.  Vim crashes whenever I now use
 the :python3 command.  I tried to create a stack trace but I'm not sure
 where to get the PDB file described in the helpfile debug.txt.  I obtained
 the executable from http://cream.sourceforge.net/download.html but I
 can't find there the PDB file.  Could someone explain to me where to find
 the PDB file so that I could provide a more useful report about this crash?


With Make_mvc.mak, pdb file is created by default.

I can reproduce the problem in your first post.

1. Install python-2.7.6.msi and python-3.3.4.msi to compile vim.
2. Compile vim with nmake -f Make_mvc.mak USE_MSVCRT=yes MBYTE=yes GUI=yes
IME=yes XPM=no PYTHON=C:\python27 DYNAMIC_PYTHON=yes PYTHON_VER=27
PYTHON3=C:\python33 DYNAMIC_PYTHON3=yes PYTHON3_VER=33
3. Uninstall python-2.7.6
4. Run gvim.exe and execute :py command.
Then, vim crash (or exit?) silently.

I found that there is another python27.dll in Mercurial directory.

  CMD where python27.dll
  C:\Program Files\Mercurial\python27.dll

I removed Mercurial directory from $PATH.
And vim shows cannot load library error for :py command properly.

Perhaps there is non-standard python dll in your system?

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: issues with python and python3 commands

2014-02-27 Fir de Conversatie Yukihiro Nakadaira
On Thu, Feb 27, 2014 at 5:10 PM, Yukihiro Nakadaira 
yukihiro.nakada...@gmail.com wrote:

 I found that there is another python27.dll in Mercurial directory.

   CMD where python27.dll
   C:\Program Files\Mercurial\python27.dll

 I removed Mercurial directory from $PATH.
 And vim shows cannot load library error for :py command properly.


With CUI vim.exe and mercurial's python27.dll, it print ImportError: No
module named site and exit.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: dynamic 64-bit ruby 1.9 linking issues

2014-02-26 Fir de Conversatie Yukihiro Nakadaira
On Wed, Feb 26, 2014 at 4:12 AM, Danek Duvall duv...@comfychair.org wrote:

 I've been trying to get dynamic ruby support working on Solaris, with a
 64-bit build of vim 7.4.192 and Ruby 1.9.  I was getting a pair of link
 errors about rb_fix2int and rb_num2int, and in the course of poking around
 found that the following patch seems to work:

 --- src/if_ruby.c.orig  Tue Feb 25 10:14:41 2014
 +++ src/if_ruby.c   Tue Feb 25 10:14:45 2014
 @@ -88,7 +88,7 @@
  # define rb_int2big rb_int2big_stub
  #endif

 -#if defined(DYNAMIC_RUBY_VER)  DYNAMIC_RUBY_VER = 20 \
 +#if defined(DYNAMIC_RUBY_VER)  DYNAMIC_RUBY_VER = 19 \
  VIM_SIZEOF_INT  VIM_SIZEOF_LONG
  /* Ruby 2.0 defines a number of static functions which use rb_fix2int
 and
   * rb_num2int if VIM_SIZEOF_INT  VIM_SIZEOF_LONG (64bit) */
 @@ -392,7 +392,7 @@
  {
  return dll_rb_int2big(x);
  }
 -#  if defined(DYNAMIC_RUBY_VER)  DYNAMIC_RUBY_VER = 20 \
 +#  if defined(DYNAMIC_RUBY_VER)  DYNAMIC_RUBY_VER = 19 \
  VIM_SIZEOF_INT  VIM_SIZEOF_LONG
  long rb_fix2int_stub(VALUE x)
  {

 I don't know whether that's right or not, though, though our ruby.h
 definitely uses rb_fix2int() and rb_num2int() in macros, which is what it
 sounds like the comment suggests happened in 2.0.

 I do get the following warnings, though:

 if_ruby.c, line 206: warning: macro redefined: rb_fix2int
 if_ruby.c, line 207: warning: macro redefined: rb_num2int

 which isn't surprising, since fist they're #defined to the stub versions,
 and here they're #defined to the dll_ versions.

 Simple ruby tests work, so it's not all broken, but I don't know enough
 Ruby to test these two functions to see if what I've done is completely
 busted.

 Any help would be appreciated.


I think your patch is right.
With ruby2, I get same warnings without patch.
Maybe it is better to use stub version always for simplicity.

diff -r 10d35c8b50e3 src/if_ruby.c
--- a/src/if_ruby.cMon Feb 24 03:32:00 2014 +0100
+++ b/src/if_ruby.cThu Feb 27 02:31:03 2014 +0900
@@ -88,8 +88,7 @@
 # define rb_int2big rb_int2big_stub
 #endif

-#if defined(DYNAMIC_RUBY_VER)  DYNAMIC_RUBY_VER = 20 \
- VIM_SIZEOF_INT  VIM_SIZEOF_LONG
+#if defined(DYNAMIC_RUBY_VER)  VIM_SIZEOF_INT  VIM_SIZEOF_LONG
 /* Ruby 2.0 defines a number of static functions which use rb_fix2int and
  * rb_num2int if VIM_SIZEOF_INT  VIM_SIZEOF_LONG (64bit) */
 # define rb_fix2int rb_fix2int_stub
@@ -203,8 +202,6 @@
 # define rb_inspectdll_rb_inspect
 # define rb_int2inumdll_rb_int2inum
 # if VIM_SIZEOF_INT  VIM_SIZEOF_LONG /* 64 bits only */
-#  define rb_fix2intdll_rb_fix2int
-#  define rb_num2intdll_rb_num2int
 #  define rb_num2uintdll_rb_num2uint
 # endif
 # define rb_lastline_getdll_rb_lastline_get
@@ -392,8 +389,7 @@
 {
 return dll_rb_int2big(x);
 }
-#  if defined(DYNAMIC_RUBY_VER)  DYNAMIC_RUBY_VER = 20 \
- VIM_SIZEOF_INT  VIM_SIZEOF_LONG
+#  if defined(DYNAMIC_RUBY_VER)  VIM_SIZEOF_INT  VIM_SIZEOF_LONG
 long rb_fix2int_stub(VALUE x)
 {
 return dll_rb_fix2int(x);


-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: Problem with Python 3.4

2014-02-24 Fir de Conversatie Yukihiro Nakadaira
reported to python bug tracker http://bugs.python.org/issue20763

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: vim 7.3(.547) and 7.4(.135) regex bug

2014-01-26 Fir de Conversatie Yukihiro Nakadaira
On Sun, Jan 19, 2014 at 9:57 PM, Bram Moolenaar b...@moolenaar.net wrote:


 Christian Brabandt wrote:

  On Mi, 15 Jan 2014, Aidan Marlin wrote:
   Vim devs,
  
   I have discovered a bug which affects at least 7.4.135 and (likely)
 7.3.547. Example file is available at
 https://mega.co.nz/#!ndVjXZTY!aMX_9ll-0ce861tQwNZBaFveb_kONCJxvAT2GZOvzlc(1.2MB
  in size) which will crash vim when attempting the following regex:
  
   :%s/\n//g
  
   The file contains 20 000 lines, each line containing 60 characters.
  
   Join (:%j) works fine and fast in these versions of vim, while the
 above regex seems to consume excessive amounts of memory, and results in
 vim crash.
 
  How about to alias :s/\n// to the join function (see attached patch).

 OK, but with a slightly different pattern it would still be a problem.
 Did you look at the cause of the problem?


:%s/\n// process lines one by one.

1)
a   save for undo
b
c

2)
ab  replace
b
c

3)
ab
b   save for undo
c

4)
ab
c   delete

5)
ab  save for undo
c

6)
abc replace
c

7)
abc
c   save for undo

8)
abc
delete

So, undo memory size is about m * (((n + 1) * n / 2) - 1), where n is
number of lines and m is line length.

Perhaps it might be possible to re-use undo entry even after insert or
delete lines when new change is done above it?

diff -r 89b3a7ef9622 src/undo.c
--- a/src/undo.cThu Jan 23 22:45:58 2014 +0100
+++ b/src/undo.cSun Jan 26 20:52:22 2014 +0900
@@ -565,16 +565,18 @@
 break;

 /* If lines have been inserted/deleted we give up.
- * Also when the line was included in a multi-line save. */
-if ((curbuf-b_u_newhead-uh_getbot_entry != uep
+ * Also when the line was included in a multi-line save.
+ * Except when new change is done above this entry. */
+if (bot  uep-ue_top + 1
+ ((curbuf-b_u_newhead-uh_getbot_entry != uep
 ? (uep-ue_top + uep-ue_size + 1
 != (uep-ue_bot == 0
 ? curbuf-b_ml.ml_line_count + 1
 : uep-ue_bot))
 : uep-ue_lcount != curbuf-b_ml.ml_line_count)
-|| (uep-ue_size  1
- top = uep-ue_top
- top + 2 = uep-ue_top + uep-ue_size + 1))
+|| (uep-ue_size  1
+ top = uep-ue_top
+ top + 2 = uep-ue_top + uep-ue_size + 1)))
 break;

 /* If it's the same line we can skip saving it again. */


-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: 100% CPU usage, while vim tries to highlight syntax in a specific file

2014-01-20 Fir de Conversatie Yukihiro Nakadaira
On Sun, Jan 19, 2014 at 1:45 PM, Anhad Jai Singh
anhadjones5...@gmail.comwrote:


 When I do 'o' (plain old 'o', no fancy mappings nothing, the deafult
 open-INSERT-mode and take me to the next line 'o'), at a specific location
 in a specific file, vim hits 100% CPU usage, becomes unresponsive and needs
 to be killed.

 After some discussion on the #vim on freenode, :tek0 and :accolade helped
 narrow it down to the syntax highlighting. :syntax off makes the bug
 disappear.


 Steps to reproduce:

 1. vim main.php
 2. Go to line 48, on the closing '}' bracket.
 3. hit 'o'
 4. open top, watch vim hit 100% CPU usage.


 I'm attaching:

 1. The file main.php
 2. vim --version's output
 3. my .vimrc

 Some of the debugging output requested on #vim, which may be useful again:

 Q: What does :map o  give you? A: :map o gives No mapping found.
 Q: do you get anything for :au InsertEnter A: No.
 Q: any difference if you `:set foldmethod=manual`? A: No.
 Q: what's the filetype? A: filetype=php


It should be a problem of indentexpr script.
Maybe same issue with
https://github.com/2072/PHP-Indenting-for-VIm/issues/23

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


Error number E834 is used twice.

2014-01-18 Fir de Conversatie Yukihiro Nakadaira
Error number E834 is used twice.

options.c:
 5862 errmsg = (char_u *)_(E834: Conflicts with value of
'listchars');

undo.c:
 412 EMSG(_(E834: Line count changed unexpectedly));

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: After patch 7.4.045, substitute('xxx', 'x\zs', 'y', 'g') returns xyxxy.

2014-01-16 Fir de Conversatie Yukihiro Nakadaira
On Thu, Jan 16, 2014 at 5:58 AM, Bram Moolenaar b...@moolenaar.net wrote:


 Yukihiro Nakadaira wrote:

  On Tue, Dec 31, 2013 at 6:54 PM, Bram Moolenaar b...@moolenaar.net
 wrote:
 
   Yukihiro Nakadaira wrote:
  
After patch 7.4.045, substitute('xxx', 'x\zs', 'y', 'g') returns
 xyxxy.
xyxyxy is expected.
  
   Thanks for reporting the problem. I'll add it in the todo list.
 
 
  I think that this problem can be fixed with attached patch.
  Please check it.
 
  However, I found another problem, inconsistency between substitute() and
 :s.
 
  let y = substitute('aaa', '\ze', 'x', 'g') | $put =y = xaxaxax
  $put ='aaa' | s/\ze/x/g  = xaxaxa
 
  let y = substitute('abc', 'a\|\ze', 'x', 'g') | $put =y  = xxbxcx
  $put ='abc' | s/a\|\ze/x/g   = xbxc

 Nice to see a patch for this problem.


I have updated patch.

:echo substitute('123', '1\zs\|[23]', 'a', 'g')
old: 1a2a
new: 1aaa

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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.
diff -r 339a410f525a src/eval.c
--- a/src/eval.cTue Jan 14 15:24:39 2014 +0100
+++ b/src/eval.cThu Jan 16 18:54:52 2014 +0900
@@ -24355,7 +24355,7 @@
 garray_T   ga;
 char_u *ret;
 char_u *save_cpo;
-intzero_width;
+char_u *zero_width = NULL;
 
 /* Make 'cpoptions' empty, so that the 'l' flag doesn't work here */
 save_cpo = p_cpo;
@@ -24372,6 +24372,19 @@
tail = str;
while (vim_regexec_nl(regmatch, str, (colnr_T)(tail - str)))
{
+   /* Skip empty match except for first match. */
+   if (regmatch.startp[0] == regmatch.endp[0])
+   {
+   if (zero_width == regmatch.startp[0])
+   {
+   /* avoid getting stuck on a match with an empty string */
+   *((char_u *)ga.ga_data + ga.ga_len) = *tail++;
+   ++ga.ga_len;
+   continue;
+   }
+   zero_width = regmatch.startp[0];
+   }
+
/*
 * Get some space for a temporary buffer to do the substitution
 * into.  It will contain:
@@ -24394,17 +24407,9 @@
(void)vim_regsub(regmatch, sub, (char_u *)ga.ga_data
  + ga.ga_len + i, TRUE, TRUE, FALSE);
ga.ga_len += i + sublen - 1;
-   zero_width = (tail == regmatch.endp[0]
-   || regmatch.startp[0] == regmatch.endp[0]);
tail = regmatch.endp[0];
if (*tail == NUL)
break;
-   if (zero_width)
-   {
-   /* avoid getting stuck on a match with an empty string */
-   *((char_u *)ga.ga_data + ga.ga_len) = *tail++;
-   ++ga.ga_len;
-   }
if (!do_all)
break;
}
diff -r 339a410f525a src/testdir/test80.in
--- a/src/testdir/test80.in Tue Jan 14 15:24:39 2014 +0100
+++ b/src/testdir/test80.in Thu Jan 16 18:54:52 2014 +0900
@@ -176,6 +176,23 @@
 TEST_10:
 
 STARTTEST
+:set magic
+:set cpo
+:$put =\\n\nTEST_10:\
+:let y = substitute('123', '\zs', 'a', 'g') | $put =y
+:let y = substitute('123', '\zs.', 'a', 'g')| $put =y
+:let y = substitute('123', '.\zs', 'a', 'g')| $put =y
+:let y = substitute('123', '\ze', 'a', 'g') | $put =y
+:let y = substitute('123', '\ze.', 'a', 'g')| $put =y
+:let y = substitute('123', '.\ze', 'a', 'g')| $put =y
+:let y = substitute('123', '1\|\ze', 'a', 'g')  | $put =y
+:let y = substitute('123', '1\zs\|[23]', 'a', 'g')  | $put =y
+/^TEST_11
+ENDTEST
+
+TEST_11:
+
+STARTTEST
 :/^Results/,$wq! test.out
 ENDTEST
 
diff -r 339a410f525a src/testdir/test80.ok
--- a/src/testdir/test80.ok Tue Jan 14 15:24:39 2014 +0100
+++ b/src/testdir/test80.ok Thu Jan 16 18:54:52 2014 +0900
@@ -115,3 +115,14 @@
 
 TEST_9:
 XXx
+
+
+TEST_10:
+a1a2a3a
+aaa
+1a2a3a
+a1a2a3a
+a1a2a3
+aaa
+aa2a3a
+1aaa


Re: After patch 7.4.045, substitute('xxx', 'x\zs', 'y', 'g') returns xyxxy.

2014-01-15 Fir de Conversatie Yukihiro Nakadaira
On Tue, Dec 31, 2013 at 6:54 PM, Bram Moolenaar b...@moolenaar.net wrote:


 Yukihiro Nakadaira wrote:

  After patch 7.4.045, substitute('xxx', 'x\zs', 'y', 'g') returns xyxxy.
  xyxyxy is expected.

 Thanks for reporting the problem. I'll add it in the todo list.


I think that this problem can be fixed with attached patch.
Please check it.

However, I found another problem, inconsistency between substitute() and :s.

let y = substitute('aaa', '\ze', 'x', 'g') | $put =y = xaxaxax
$put ='aaa' | s/\ze/x/g  = xaxaxa

let y = substitute('abc', 'a\|\ze', 'x', 'g') | $put =y  = xxbxcx
$put ='abc' | s/a\|\ze/x/g   = xbxc

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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.
diff -r 339a410f525a src/eval.c
--- a/src/eval.cTue Jan 14 15:24:39 2014 +0100
+++ b/src/eval.cWed Jan 15 22:58:08 2014 +0900
@@ -24355,7 +24355,7 @@
 garray_T   ga;
 char_u *ret;
 char_u *save_cpo;
-intzero_width;
+char_u *zero_width = NULL;
 
 /* Make 'cpoptions' empty, so that the 'l' flag doesn't work here */
 save_cpo = p_cpo;
@@ -24372,6 +24372,14 @@
tail = str;
while (vim_regexec_nl(regmatch, str, (colnr_T)(tail - str)))
{
+   if (zero_width == regmatch.startp[0])
+   {
+   /* avoid getting stuck on a match with an empty string */
+   *((char_u *)ga.ga_data + ga.ga_len) = *tail++;
+   ++ga.ga_len;
+   continue;
+   }
+
/*
 * Get some space for a temporary buffer to do the substitution
 * into.  It will contain:
@@ -24394,19 +24402,13 @@
(void)vim_regsub(regmatch, sub, (char_u *)ga.ga_data
  + ga.ga_len + i, TRUE, TRUE, FALSE);
ga.ga_len += i + sublen - 1;
-   zero_width = (tail == regmatch.endp[0]
-   || regmatch.startp[0] == regmatch.endp[0]);
tail = regmatch.endp[0];
if (*tail == NUL)
break;
-   if (zero_width)
-   {
-   /* avoid getting stuck on a match with an empty string */
-   *((char_u *)ga.ga_data + ga.ga_len) = *tail++;
-   ++ga.ga_len;
-   }
if (!do_all)
break;
+   if (regmatch.startp[0] == regmatch.endp[0])
+   zero_width = regmatch.endp[0];
}
 
if (ga.ga_data != NULL)
diff -r 339a410f525a src/testdir/test80.in
--- a/src/testdir/test80.in Tue Jan 14 15:24:39 2014 +0100
+++ b/src/testdir/test80.in Wed Jan 15 22:58:08 2014 +0900
@@ -176,6 +176,21 @@
 TEST_10:
 
 STARTTEST
+:set magic
+:set cpo
+:$put =\\n\nTEST_10:\
+:$put =substitute('123', '\zs', 'a', 'g')
+:$put =substitute('123', '\zs.', 'a', 'g')
+:$put =substitute('123', '.\zs', 'a', 'g')
+:$put =substitute('123', '\ze', 'a', 'g')
+:$put =substitute('123', '\ze.', 'a', 'g')
+:$put =substitute('123', '.\ze', 'a', 'g')
+/^TEST_11
+ENDTEST
+
+TEST_11:
+
+STARTTEST
 :/^Results/,$wq! test.out
 ENDTEST
 
diff -r 339a410f525a src/testdir/test80.ok
--- a/src/testdir/test80.ok Tue Jan 14 15:24:39 2014 +0100
+++ b/src/testdir/test80.ok Wed Jan 15 22:58:08 2014 +0900
@@ -115,3 +115,12 @@
 
 TEST_9:
 XXx
+
+
+TEST_10:
+a1a2a3a
+aaa
+1a2a3a
+a1a2a3a
+a1a2a3
+aaa


Re: Patch 7.4.149

2014-01-14 Fir de Conversatie Yukihiro Nakadaira
On Tue, Jan 14, 2014 at 11:24 PM, Bram Moolenaar b...@moolenaar.net wrote:


 Patch 7.4.149
 Problem:Get E685 error when assigning a function to an autoload
 variable.
 (Yukihiro Nakadaira)
 Solution:   Instead of having a global no_autoload variable, pass an
 autoload
 flag down to where it is used. (ZyX)
 Files:  src/eval.c, src/testdir/test55.in, src/testdir/test55.ok,
 src/testdir/test60.in, src/testdir/test60.ok,
 src/testdir/sautest/autoload/footest.vim


Sorry for my late reply.  It need additional no_autoload to fix the problem.

diff -r 98a642716acc src/eval.c
--- a/src/eval.cTue Jan 14 15:53:52 2014 +0100
+++ b/src/eval.cWed Jan 15 00:58:24 2014 +0900
@@ -447,7 +447,7 @@
 #endif
 static int get_env_tv __ARGS((char_u **arg, typval_T *rettv, int
evaluate));
 static int find_internal_func __ARGS((char_u *name));
-static char_u *deref_func_name __ARGS((char_u *name, int *lenp));
+static char_u *deref_func_name __ARGS((char_u *name, int *lenp, int
no_autoload));
 static int get_func_tv __ARGS((char_u *name, int len, typval_T *rettv,
char_u **arg, linenr_T firstline, linenr_T lastline, int *doesrange, int
evaluate, dict_T *selfdict));
 static int call_func __ARGS((char_u *funcname, int len, typval_T *rettv,
int argcount, typval_T *argvars, linenr_T firstline, linenr_T lastline, int
*doesrange, int evaluate, dict_T *selfdict));
 static void emsg_funcname __ARGS((char *ermsg, char_u *name));
@@ -3432,7 +3432,7 @@

 /* If it is the name of a variable of type VAR_FUNC use its contents.
*/
 len = (int)STRLEN(tofree);
-name = deref_func_name(tofree, len);
+name = deref_func_name(tofree, len, FALSE);

 /* Skip white space to allow :call func ().  Not good, but required
for
  * backward compatibility. */
@@ -5159,7 +5159,7 @@
 {
 /* If s is the name of a variable of type VAR_FUNC
  * use its contents. */
-s = deref_func_name(s, len);
+s = deref_func_name(s, len, FALSE);

 /* Invoke the function. */
 ret = get_func_tv(s, len, rettv, arg,
@@ -8282,16 +8282,17 @@
  * name it contains, otherwise return name.
  */
 static char_u *
-deref_func_name(name, lenp)
+deref_func_name(name, lenp, no_autoload)
 char_u*name;
 int*lenp;
+intno_autoload;
 {
 dictitem_T*v;
 intcc;

 cc = name[*lenp];
 name[*lenp] = NUL;
-v = find_var(name, NULL, FALSE);
+v = find_var(name, NULL, no_autoload);
 name[*lenp] = cc;
 if (v != NULL  v-di_tv.v_type == VAR_FUNC)
 {
@@ -21938,14 +21939,14 @@
 if (lv.ll_exp_name != NULL)
 {
 len = (int)STRLEN(lv.ll_exp_name);
-name = deref_func_name(lv.ll_exp_name, len);
+name = deref_func_name(lv.ll_exp_name, len, flags  TFN_NO_AUTOLOAD);
 if (name == lv.ll_exp_name)
 name = NULL;
 }
 else
 {
 len = (int)(end - *pp);
-name = deref_func_name(*pp, len);
+name = deref_func_name(*pp, len, flags  TFN_NO_AUTOLOAD);
 if (name == *pp)
 name = NULL;
 }


-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: Patch 7.4.149

2014-01-14 Fir de Conversatie Yukihiro Nakadaira
On Wed, Jan 15, 2014 at 3:44 AM, Bram Moolenaar b...@moolenaar.net wrote:


 Yukihiro Nakadaira wrote:

   Patch 7.4.149
   Problem:Get E685 error when assigning a function to an autoload
   variable.
   (Yukihiro Nakadaira)
   Solution:   Instead of having a global no_autoload variable, pass an
   autoload
   flag down to where it is used. (ZyX)
   Files:  src/eval.c, src/testdir/test55.in, src/testdir/test55.ok,
   src/testdir/test60.in, src/testdir/test60.ok,
   src/testdir/sautest/autoload/footest.vim
  
 
  Sorry for my late reply.  It need additional no_autoload to fix the
  problem.

 Thanks.  Perhaps we can add a test for your problem?


I wrote test for it.  Please check the attached patch.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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.
diff -r a42040fed96c src/testdir/Make_amiga.mak
--- a/src/testdir/Make_amiga.makTue Jan 14 21:31:34 2014 +0100
+++ b/src/testdir/Make_amiga.makWed Jan 15 11:51:47 2014 +0900
@@ -34,7 +34,8 @@
test81.out test82.out test83.out test84.out test88.out \
test89.out test90.out test91.out test92.out test93.out \
test94.out test95.out test96.out test97.out test98.out \
-   test99.out test100.out test101.out test102.out test103.out
+   test99.out test100.out test101.out test102.out test103.out \
+   test104.out
 
 .SUFFIXES: .in .out
 
@@ -154,3 +155,4 @@
 test101.out: test101.in
 test102.out: test102.in
 test103.out: test103.in
+test104.out: test104.in
diff -r a42040fed96c src/testdir/Make_dos.mak
--- a/src/testdir/Make_dos.mak  Tue Jan 14 21:31:34 2014 +0100
+++ b/src/testdir/Make_dos.mak  Wed Jan 15 11:51:47 2014 +0900
@@ -33,7 +33,7 @@
test84.out test85.out test86.out test87.out test88.out \
test89.out test90.out test91.out test92.out test93.out \
test94.out test95.out test96.out test98.out test99.out \
-   test100.out test101.out test102.out test103.out
+   test100.out test101.out test102.out test103.out test104.out
 
 SCRIPTS32 =test50.out test70.out
 
diff -r a42040fed96c src/testdir/Make_ming.mak
--- a/src/testdir/Make_ming.mak Tue Jan 14 21:31:34 2014 +0100
+++ b/src/testdir/Make_ming.mak Wed Jan 15 11:51:47 2014 +0900
@@ -53,7 +53,7 @@
test84.out test85.out test86.out test87.out test88.out \
test89.out test90.out test91.out test92.out test93.out \
test94.out test95.out test96.out test98.out test99.out \
-   test100.out test101.out test102.out test103.out
+   test100.out test101.out test102.out test103.out test104.out
 
 SCRIPTS32 =test50.out test70.out
 
diff -r a42040fed96c src/testdir/Make_os2.mak
--- a/src/testdir/Make_os2.mak  Tue Jan 14 21:31:34 2014 +0100
+++ b/src/testdir/Make_os2.mak  Wed Jan 15 11:51:47 2014 +0900
@@ -35,7 +35,7 @@
test81.out test82.out test83.out test84.out test88.out \
test89.out test90.out test91.out test92.out test93.out \
test94.out test95.out test96.out test98.out test99.out \
-   test100.out test101.out test102.out test103.out
+   test100.out test101.out test102.out test103.out test104.out
 
 .SUFFIXES: .in .out
 
diff -r a42040fed96c src/testdir/Make_vms.mms
--- a/src/testdir/Make_vms.mms  Tue Jan 14 21:31:34 2014 +0100
+++ b/src/testdir/Make_vms.mms  Wed Jan 15 11:51:47 2014 +0900
@@ -79,7 +79,7 @@
 test82.out test83.out test84.out test88.out test89.out \
 test90.out test91.out test92.out test93.out test94.out \
 test95.out test96.out test97.out test98.out test99.out \
-test100.out test101.out test102.out test103.out
+test100.out test101.out test102.out test103.out test104.out
 
 # Known problems:
 # Test 30: a problem around mac format - unknown reason
diff -r a42040fed96c src/testdir/Makefile
--- a/src/testdir/Makefile  Tue Jan 14 21:31:34 2014 +0100
+++ b/src/testdir/Makefile  Wed Jan 15 11:51:47 2014 +0900
@@ -30,7 +30,8 @@
test84.out test85.out test86.out test87.out test88.out \
test89.out test90.out test91.out test92.out test93.out \
test94.out test95.out test96.out test97.out test98.out \
-   test99.out test100.out test101.out test102.out test103.out
+   test99.out test100.out test101.out test102.out test103.out \
+   test104.out
 
 SCRIPTS_GUI

Re: E685: Internal error: hash_add() happen when assigning autoload variable

2014-01-06 Fir de Conversatie Yukihiro Nakadaira
On Sun, Jan 5, 2014 at 11:44 PM, Nikolay Pavlov zyx@gmail.com wrote:


 On Jan 1, 2014 9:47 AM, Yukihiro Nakadaira yukihiro.nakada...@gmail.com
 wrote:
 
  Steps to reproduce:
$ cat ~/.vim/autoload/Foo.vim
let Foo#x = 0
$ vim -u NONE -N
:let Foo#x = function('tr')
E685: Internal error: hash_add()
 
  eval.c:set_var()
- var_check_func_name()Foo.vim is loaded and Foo#x is created.
- hash_add()   error, because Foo#x is already exists.
 
  Please check the following patch.
 
  diff -r 2f856c7c1d43 src/eval.c
  --- a/src/eval.cSun Dec 15 10:02:33 2013 +0100
  +++ b/src/eval.cWed Jan 01 13:44:46 2014 +0900
  @@ -20718,6 +20718,8 @@
   char_u *name;/* points to start of variable name */
   intnew_var;  /* TRUE when creating the variable */
   {
  +int err;
  +
   if (!(vim_strchr((char_u *)wbs, name[0]) != NULL  name[1] ==
 ':')
!ASCII_ISUPPER((name[0] != NUL  name[1] == ':')
? name[2] : name[0]))
  @@ -20729,7 +20731,10 @@
   /* Don't allow hiding a function.  When v is not NULL we might be
* assigning another function to the same var, the type is checked
* below. */
  -if (new_var  function_exists(name))
  +no_autoload = TRUE;
  +err = new_var  function_exists(name);
  +no_autoload = FALSE;

 Are you sure that no_autoload variable may never be TRUE when callin this
 function?


Yes, I am.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: E685: Internal error: hash_add() happen when assigning autoload variable

2014-01-06 Fir de Conversatie Yukihiro Nakadaira
On Tue, Jan 7, 2014 at 5:33 AM, ZyX zyx@gmail.com wrote:

  Yes, I am.

 You should not be.

 let d={}
 echo exists('*d[extend(g:, {Foo#x: function(tr)})]')

 . f_exists() sets no_autoload to TRUE, dict_extend() runs
 var_check_func_name() which you have modified setting it back to FALSE
 before f_exists ends. f_exists should by the way save no_autoload variable
 for the same reason: it may be called recursively.


Thank you for finding it out.  I didn't notice it.
Perhaps there is another problem that exists('x[y#z()]') doesn't trigger
autoload.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


E685: Internal error: hash_add() happen when assigning autoload variable

2013-12-31 Fir de Conversatie Yukihiro Nakadaira
Steps to reproduce:
  $ cat ~/.vim/autoload/Foo.vim
  let Foo#x = 0
  $ vim -u NONE -N
  :let Foo#x = function('tr')
  E685: Internal error: hash_add()

eval.c:set_var()
  - var_check_func_name()Foo.vim is loaded and Foo#x is created.
  - hash_add()   error, because Foo#x is already exists.

Please check the following patch.

diff -r 2f856c7c1d43 src/eval.c
--- a/src/eval.cSun Dec 15 10:02:33 2013 +0100
+++ b/src/eval.cWed Jan 01 13:44:46 2014 +0900
@@ -20718,6 +20718,8 @@
 char_u *name;/* points to start of variable name */
 intnew_var;  /* TRUE when creating the variable */
 {
+int err;
+
 if (!(vim_strchr((char_u *)wbs, name[0]) != NULL  name[1] == ':')
  !ASCII_ISUPPER((name[0] != NUL  name[1] == ':')
  ? name[2] : name[0]))
@@ -20729,7 +20731,10 @@
 /* Don't allow hiding a function.  When v is not NULL we might be
  * assigning another function to the same var, the type is checked
  * below. */
-if (new_var  function_exists(name))
+no_autoload = TRUE;
+err = new_var  function_exists(name);
+no_autoload = FALSE;
+if (err)
 {
 EMSG2(_(E705: Variable name conflicts with existing function: %s),
 name);


-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


getregtype() works differently from what is documented for empty or unknown register

2013-12-26 Fir de Conversatie Yukihiro Nakadaira
According to :help getregtype(), it returns 0 for empty or unknown
register.  But it returns  for empty register.  And it returns unnamed
register's type for unknown register.

Steps to reproduce:
  $ vim -u NONE -i NONE
  : test for empty register
  :echo getregtype('a') is ''
  : test for unknown register
  :echo getregtype('^') is ''
  :call setreg('', 'v')
  :echo getregtype('^') is ''

Result:
  1
  1
  0

Expected:
  1
  1
  1


I think it should be fixed as following.  Please check it.


diff -r 2f856c7c1d43 runtime/doc/eval.txt
--- a/runtime/doc/eval.txtSun Dec 15 10:02:33 2013 +0100
+++ b/runtime/doc/eval.txtThu Dec 26 21:40:45 2013 +0900
@@ -3460,7 +3460,7 @@
 vfor |characterwise| text
 Vfor |linewise| text
 CTRL-V{width}for |blockwise-visual| text
-0for an empty or unknown register
+for an empty or unknown register
 CTRL-V is one character with value 0x16.
 If {regname} is not specified, |v:register| is used.

diff -r 2f856c7c1d43 src/ops.c
--- a/src/ops.cSun Dec 15 10:02:33 2013 +0100
+++ b/src/ops.cThu Dec 26 21:40:45 2013 +0900
@@ -6240,7 +6240,9 @@
 regname = may_get_selection(regname);
 #endif

-/* Should we check for a valid name? */
+if (regname != NUL  !valid_yank_reg(regname, FALSE))
+return MAUTO;
+
 get_yank_register(regname, FALSE);

 if (y_current-y_array != NULL)


-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


After patch 7.4.045, substitute('xxx', 'x\zs', 'y', 'g') returns xyxxy.

2013-12-23 Fir de Conversatie Yukihiro Nakadaira
After patch 7.4.045, substitute('xxx', 'x\zs', 'y', 'g') returns xyxxy.
xyxyxy is expected.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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


tiny fix for doc

2013-12-02 Fir de Conversatie Yukihiro Nakadaira
In autocmd.txt, TextChanged and TextChangedI are not listed in :h
autocommand-events.
In eval.txt, there are some inconsistent notation ([expr] - [{expr}]).

Please check the attached patch.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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.
diff -r 486655e0c5a2 runtime/doc/autocmd.txt
--- a/runtime/doc/autocmd.txt   Thu Nov 28 19:27:30 2013 +0100
+++ b/runtime/doc/autocmd.txt   Mon Dec 02 20:24:36 2013 +0900
@@ -316,6 +316,9 @@
 |MenuPopup|just before showing the popup menu
 |CompleteDone| after Insert mode completion is done
 
+|TextChanged|  after a change was made to text
+|TextChangedI| after a change was made to text in Insert mode
+
 |User| to be used in combination with :doautocmd
 
 
diff -r 486655e0c5a2 runtime/doc/eval.txt
--- a/runtime/doc/eval.txt  Thu Nov 28 19:27:30 2013 +0100
+++ b/runtime/doc/eval.txt  Mon Dec 02 20:24:36 2013 +0900
@@ -1788,7 +1788,7 @@
Listlines {lnum} to {end} of buffer {expr}
 getbufvar( {expr}, {varname} [, {def}])
any variable {varname} in buffer {expr}
-getchar( [expr])   Number  get one character from the user
+getchar( [{expr}]) Number  get one character from the user
 getcharmod( )  Number  modifiers for the last typed character
 getcmdline()   String  return the current command-line
 getcmdpos()Number  return cursor position in command-line
@@ -1882,7 +1882,7 @@
 min( {list})   Number  minimum value of items in {list}
 mkdir( {name} [, {path} [, {prot}]])
Number  create directory {name}
-mode( [expr])  String  current editing mode
+mode( [{expr}])String  current editing mode
 mzeval( {expr})any evaluate |MzScheme| expression
 nextnonblank( {lnum})  Number  line nr of non-blank line = {lnum}
 nr2char( {expr}[, {utf8}]) String  single char with ASCII/UTF8 value {expr}
@@ -2006,7 +2006,7 @@
 undotree() Listundo file tree
 values( {dict})Listvalues in {dict}
 virtcol( {expr})   Number  screen column of cursor or mark
-visualmode( [expr])String  last visual mode used
+visualmode( [{expr}])  String  last visual mode used
 wildmenumode() Number  whether 'wildmenu' mode is active
 winbufnr( {nr})Number  buffer number of window {nr}
 wincol()   Number  window column of the cursor
@@ -3192,12 +3192,12 @@
:let bufmodified = getbufvar(1, mod)
:echo todo myvar =  . getbufvar(todo, myvar)
 
-getchar([expr])*getchar()*
+getchar([{expr}])  *getchar()*
Get a single character from the user or input stream.
-   If [expr] is omitted, wait until a character is available.
-   If [expr] is 0, only get a character when one is available.
+   If {expr} is omitted, wait until a character is available.
+   If {expr} is 0, only get a character when one is available.
Return zero otherwise.
-   If [expr] is 1, only check if a character is available, it is
+   If {expr} is 1, only check if a character is available, it is
not consumed.  Return zero if no character available.
 
Without {expr} and when {expr} is 0 a whole character or
@@ -4361,8 +4361,8 @@
:if exists(*mkdir)
 
*mode()*
-mode([expr])   Return a string that indicates the current mode.
-   If [expr] is supplied and it evaluates to a non-zero Number or
+mode([{expr}]) Return a string that indicates the current mode.
+   If {expr} is supplied and it evaluates to a non-zero Number or
a non-empty String (|non-zero-arg|), then the full mode is
returned, otherwise only the first letter is returned.  Note
that   and 0 are also non-empty strings.
@@ -6195,7 +6195,7 @@
echo max(map(range(1, line('$')), virtcol([v:val, '$'])))
 
 
-visualmode([expr]) *visualmode()*
+visualmode([{expr

Re: [patch] Undo messages may not be shown

2013-10-04 Fir de Conversatie Yukihiro Nakadaira
With this patch, message after undo is ignored when using macro.

$vim -u NONE -N
ofooEsc.:normal ukkk3dd

Message without patch:
3 fewer lines

Message with patch:
1 line less; before #6  5 seconds ago

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: language-mapping is not applied to macro

2013-08-16 Fir de Conversatie Yukihiro Nakadaira
On Fri, Aug 2, 2013 at 11:33 PM, Ron Aaron ronware@gmail.com wrote:

 Perhaps this is related to the bug I reported with Hebrew keymap, some
 imap doesn't work.


I think those two problem is slightly different.  Tyru's problem is that
it is not possible to record and repeat insertion using lmap.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: Vim 7.4a ready for beta testing (test96 FAILED)

2013-07-25 Fir de Conversatie Yukihiro Nakadaira
On Thu, Jul 25, 2013 at 12:53 AM, Bram Moolenaar b...@moolenaar.net wrote:


 Yukihiro Nakadaira wrote:

  On Mon, Jul 8, 2013 at 9:51 AM, r...@raf.org wrote:
 
   Bram Moolenaar wrote:
  
Announcing:  Vim (Vi IMproved) version 7.4a BETA
   
This is the first BETA release of Vim 7.4.
   
Please check that the distribution is OK.  I haven't done one for a
 long
time.  Report anything that isn't right.  That includes a crash but
 also
a typo in the documentation or a missing file.
  
   mid-2010 macbookpro
   macosx-10.6.8
   gcc-4.2.1
  
   obtained vim-7.4a.002 via hg (same result via ftp).
  
   configure \
   --disable-darwin \
   --with-x \
   --enable-gui=motif \
   --enable-multibyte \
   --with-mac-arch=current \
   --with-features=huge \
   --disable-acl
  
   Test results:
   test96 FAILED
   TEST FAILURE
  
   diff -u test96.ok test96.failed
   --- test96.ok   2013-07-08 10:12:36.0 +1000
   +++ test96.failed   2013-07-08 10:15:31.0 +1000
   @@ -4,6 +4,8 @@
  - quickfix claims that the file name displayed is: test://bar.txt
Test B:
  - number of window open: 2
   +Test B:
   +  - number of window open: 2
Test C:
  - 'buftype' of the location list window: quickfix
  - buffer displayed in the 2nd window: test://quux.txt
  
   i.e. the Test B section of the file is repeated.
  
 
  test96 failed on Windows Vista, too.
 
  Maybe I found the cause of this problem.  test96 depends on cursor
  position after switching buffer.  But it is not stable.  Try the
  following script:
 
  call setline(1, range(10))
  for i in range(5)
new
buffer 1
let l:foldminlines = i
call cursor(i, 1)
  endfor
  for i in range(5)
quit
  endfor
  for i in range(5)
new
buffer 1
  endfor
 
  Now, each window have different cursor position and different
  window-local option value (l:foldminlines in this case).
 
  I guess:
win_free() doesn't clear buf-b_wininfo.
After freeing memory, win_alloc() can return same address.
Then, buf-b_wininfo is re-used for newly allocated window in spite of
diffrent window.

 It would be possible.  Unfortunately I could not reproduce the problem.

 Please check if patch 7.4a.044 fixes the problem.


The problem seems to be solved.  Thank you.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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




Use of uninitialized variable

2013-07-22 Fir de Conversatie Yukihiro Nakadaira
In the following code, n and p can be used without initialization.

diff -r 3f65dc9c8840 src/os_win32.c
--- a/src/os_win32.cSun Jul 21 18:59:24 2013 +0200
+++ b/src/os_win32.cMon Jul 22 22:32:43 2013 +0900
@@ -2728,21 +2728,26 @@
 {
 longn;
 #ifdef FEAT_MBYTE
-WCHAR *p;
 if (enc_codepage = 0  (int)GetACP() != enc_codepage)
 {
-p = enc_to_utf16(name, NULL);
+WCHAR *p = enc_to_utf16(name, NULL);

 if (p != NULL)
 {
 n = _wchmod(p, perm);
 vim_free(p);
-if (n == -1  GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
-return FAIL;
-/* Retry with non-wide function (for Windows 98). */
+if (n == -1)
+{
+if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+return FAIL;
+/* Retry with non-wide function (for Windows 98). */
+n = _chmod(name, perm);
+}
 }
+else
+n = _chmod(name, perm);
 }
-if (p == NULL)
+else
 #endif
 n = _chmod(name, perm);
 if (n == -1)


-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: Vim 7.4a ready for beta testing (test96 FAILED)

2013-07-22 Fir de Conversatie Yukihiro Nakadaira
On Mon, Jul 8, 2013 at 9:51 AM, r...@raf.org wrote:

 Bram Moolenaar wrote:

  Announcing:  Vim (Vi IMproved) version 7.4a BETA
 
  This is the first BETA release of Vim 7.4.
 
  Please check that the distribution is OK.  I haven't done one for a long
  time.  Report anything that isn't right.  That includes a crash but also
  a typo in the documentation or a missing file.

 mid-2010 macbookpro
 macosx-10.6.8
 gcc-4.2.1

 obtained vim-7.4a.002 via hg (same result via ftp).

 configure \
 --disable-darwin \
 --with-x \
 --enable-gui=motif \
 --enable-multibyte \
 --with-mac-arch=current \
 --with-features=huge \
 --disable-acl

 Test results:
 test96 FAILED
 TEST FAILURE

 diff -u test96.ok test96.failed
 --- test96.ok   2013-07-08 10:12:36.0 +1000
 +++ test96.failed   2013-07-08 10:15:31.0 +1000
 @@ -4,6 +4,8 @@
- quickfix claims that the file name displayed is: test://bar.txt
  Test B:
- number of window open: 2
 +Test B:
 +  - number of window open: 2
  Test C:
- 'buftype' of the location list window: quickfix
- buffer displayed in the 2nd window: test://quux.txt

 i.e. the Test B section of the file is repeated.


test96 failed on Windows Vista, too.

Maybe I found the cause of this problem.  test96 depends on cursor
position after switching buffer.  But it is not stable.  Try the
following script:

call setline(1, range(10))
for i in range(5)
  new
  buffer 1
  let l:foldminlines = i
  call cursor(i, 1)
endfor
for i in range(5)
  quit
endfor
for i in range(5)
  new
  buffer 1
endfor

Now, each window have different cursor position and different
window-local option value (l:foldminlines in this case).

I guess:
  win_free() doesn't clear buf-b_wininfo.
  After freeing memory, win_alloc() can return same address.
  Then, buf-b_wininfo is re-used for newly allocated window in spite of
  diffrent window.

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

-- 
-- 
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: diff syntax update (translations to many languages need to be checked)

2013-07-21 Fir de Conversatie Yukihiro Nakadaira
On Sun, Jul 21, 2013 at 10:42 PM, Jakson Alves de Aquino jalve...@gmail.com
 wrote:

 Hi,

 I updated the translations of diff messages in syntax/diff.vim to
 version 3.3 of diffutils. Some messages are translated twice to
 match both diffutils 3.3 and older versions. The messages are in
 many languages and they were collected from the po files by a
 script. It would be good if speakers of the many languages could
 check if the diff.vim syntax script works for them. The languages
 are:

 Catalan, Chinese, Croatian, Czech, Danish, Dutch,
 Esperanto, Finnish, French, Galician, German,
 Greek, Hebrew, Hungarian, Indonesian, Irish,
 Italian, Japanese, Latvian, Malay, Polish,
 Portuguese, Romanian, Russian, Serbian, Spanish,
 Swedish, Turkish, Uzbek and Vietnamese.


Japanese messages looks good to me.

Perhaps diffNoEOL should have backslash?
- syn match diffNoEOL^No newline at end of file .*
- syn match diffNoEOL^\\ No newline at end of file .*

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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




regexp: \p doesn't match double width character

2013-07-18 Fir de Conversatie Yukihiro Nakadaira
\p doesn't match double width character.
And its behavior depends on 'ambiwidth' option.

:set encoding=utf-8
:echo match(\u3042, '\p')  HIRAGANA LETTER A
-1
:set ambiwidth=single
:echo match(\u00EC, '\p')  LATIN SMALL LETTER I WITH GRAVE
0
:set ambiwidth=double
:echo match(\u00EC, '\p')
-1

-- 
Yukihiro Nakadaira - yukihiro.nakada...@gmail.com

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




  1   2   3   >