">" on visual block break multi-byte string.

2016-03-03 Fir de Conversatie mattn
Hi.

When do visual-block with multi-byte strings,

http://go-gyazo.appspot.com/1537d909dba4e4b4.png

And type ">" to shift to left.

http://go-gyazo.appspot.com/07fdb58694234035.png

This make broken letter. Should be:

http://go-gyazo.appspot.com/d0f307ce038e9117.png

Below is a patch.

https://gist.github.com/mattn/371bae475217fa534bc5

- mattn

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


ch_sendexpr bug: sending a message with number 0 stops Vim from waiting for a numbered message

2016-03-03 Fir de Conversatie Christian J. Robinson


Previously this worked, but in the last day or so it has broken.

Vim sends a message to the server, the server first sends Vim a 
message with message number 0, then Vim completely ignores a message 
with the same index it sent.


Attached files reproduce this. Place both in the same directory, and 
source the Vim script.  Vim should echo two messages, but only echos 
one.


- Christian

--
Those people who think they know everything are a great annoyance to those of
 us who do.  -- Isaac Asimov
Christian J. Robinson   http://christianrobinson.name/

ch_sendexpr.pl
Description: Binary data


ch_sendexpr.vim
Description: Binary data


Re: Patch 7.4.1478

2016-03-03 Fir de Conversatie James McCoy
On Thu, Mar 03, 2016 at 05:55:25PM +0100, Bram Moolenaar wrote:
> 
> Hirohito Higashi wrote:
> 
> > Why is it different in the search pattern at 'runtimepath' and 'packpath' ?
> > 
> > 'runtimepath': "plugin/**/*.vim"  (in main.c: 633)
> > 'packpath': "plugin/*.vim" (in source_packages())
> > 
> > Is this expected?
> > There is no *.vim directly under plugin in the existing plug-in, which
> > is under the subfolder is not able to operate in 'packpath'.
> > 
> > e.g. https://github.com/sgur/vim-textobj-parameter
> 
> Yes, this is intentional.

So, we can't just take an addon that worked when you unzipped it
directly into ~/.vim and instead unzip it into ~/.vim/pack//ever?
Why?

I understand the additional directory level that's being imposed ("ever"
and "opt"), even though that seems like added complexity to the user for
little gain in the common case.  However, I don't see why an addon
author may now need to choose between structuring their repo so that it
works with existing plugin managers or so that it works with 'packpath'.

Shouldn't the rules for how things are sourced be the same, regardless
of whether it's the runtime directories in ~/.vim or the runtime
directories in ~/.vim/pack//ever?

Cheers,
-- 
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy 

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

2016-03-03 Fir de Conversatie SungHyun Nam
2016-03-04 오전 9:09에 SungHyun Nam 이(가) 쓴 글:
> 2016-03-03 오후 7:45에 Bram Moolenaar 이(가) 쓴 글:
>>
>> Patch 7.4.1475
>> Problem:When using hangulinput with utf-8 a CSI character is
>> misintepreted.
>> Solution:   Convert CSI to K_CSI. (SungHyun Nam)
>> Files:  src/ui.c
> 
> If a user use euc-kr, then hangul_string_convert() returns NULL.
> So that this patch breaks for such case.
> 
> If you didn't like 'tmpbuf' check in a if statement, that check can
> be safely removed.  I wanted to show the code is safe explicitely.
> I hope you apply my patch as is (or remove the tmpbuf check in
> if()).

Or maybe this patch looks better though we do unneeded alloc/free.

diff --git a/src/hangulin.c b/src/hangulin.c
index d799305..aa0bcce 100644
--- a/src/hangulin.c
+++ b/src/hangulin.c
@@ -1614,6 +1614,10 @@ hangul_string_convert(char_u *buf, int *p_len)
convert_setup(, NULL, NULL);
}
 }
+else
+{
+   tmpbuf = vim_strsave(buf);
+}

 return tmpbuf;
 }


BTW, you may want to retab the hangulin.c.  Some lines starts with TAB,
some lines starts with spaces.


>>
>> *** ../vim-7.4.1474/src/ui.c 2016-02-27 18:13:05.240593068 +0100
>> --- src/ui.c 2016-03-03 11:40:32.693060629 +0100
>> ***
>> *** 1689,1701 
>>   
>>   tmpbuf = hangul_string_convert(s, );
>>   if (tmpbuf != NULL)
>>  s = tmpbuf;
>>   
>> ! while (len--)
>> !inbuf[inbufcount++] = *s++;
>> ! 
>> ! if (tmpbuf != NULL)
>>  vim_free(tmpbuf);
>>   }
>>   #endif
>>   
>> --- 1689,1709 
>>   
>>   tmpbuf = hangul_string_convert(s, );
>>   if (tmpbuf != NULL)
>> + {
>>  s = tmpbuf;
>>   
>> !for (; len--; s++)
>> !{
>> !inbuf[inbufcount++] = *s;
>> !if (*s == CSI)
>> !{
>> !/* Turn CSI into K_CSI. */
>> !inbuf[inbufcount++] = KS_EXTRA;
>> !inbuf[inbufcount++] = (int)KE_CSI;
>> !}
>> !}
>>  vim_free(tmpbuf);
>> + }
>>   }
>>   #endif
>>   
>> *** ../vim-7.4.1474/src/version.c2016-03-02 22:16:28.512450505 +0100
>> --- src/version.c2016-03-03 11:41:56.928177531 +0100
>> ***
>> *** 745,746 
>> --- 745,748 
>>   {   /* Add new patch number below this line */
>> + /**/
>> + 1475,
>>   /**/
>>
> 

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

2016-03-03 Fir de Conversatie SungHyun Nam
2016-03-03 오후 7:45에 Bram Moolenaar 이(가) 쓴 글:
> 
> Patch 7.4.1475
> Problem:When using hangulinput with utf-8 a CSI character is
> misintepreted.
> Solution:   Convert CSI to K_CSI. (SungHyun Nam)
> Files:  src/ui.c

If a user use euc-kr, then hangul_string_convert() returns NULL.
So that this patch breaks for such case.

If you didn't like 'tmpbuf' check in a if statement, that check can
be safely removed.  I wanted to show the code is safe explicitely.
I hope you apply my patch as is (or remove the tmpbuf check in
if()).

> 
> *** ../vim-7.4.1474/src/ui.c  2016-02-27 18:13:05.240593068 +0100
> --- src/ui.c  2016-03-03 11:40:32.693060629 +0100
> ***
> *** 1689,1701 
>   
>   tmpbuf = hangul_string_convert(s, );
>   if (tmpbuf != NULL)
>   s = tmpbuf;
>   
> ! while (len--)
> ! inbuf[inbufcount++] = *s++;
> ! 
> ! if (tmpbuf != NULL)
>   vim_free(tmpbuf);
>   }
>   #endif
>   
> --- 1689,1709 
>   
>   tmpbuf = hangul_string_convert(s, );
>   if (tmpbuf != NULL)
> + {
>   s = tmpbuf;
>   
> ! for (; len--; s++)
> ! {
> ! inbuf[inbufcount++] = *s;
> ! if (*s == CSI)
> ! {
> ! /* Turn CSI into K_CSI. */
> ! inbuf[inbufcount++] = KS_EXTRA;
> ! inbuf[inbufcount++] = (int)KE_CSI;
> ! }
> ! }
>   vim_free(tmpbuf);
> + }
>   }
>   #endif
>   
> *** ../vim-7.4.1474/src/version.c 2016-03-02 22:16:28.512450505 +0100
> --- src/version.c 2016-03-03 11:41:56.928177531 +0100
> ***
> *** 745,746 
> --- 745,748 
>   {   /* Add new patch number below this line */
> + /**/
> + 1475,
>   /**/
> 

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

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


Patch 7.4.1485

2016-03-03 Fir de Conversatie Bram Moolenaar

Patch 7.4.1485
Problem:Job input from buffer is not implemented.
Solution:   Implement it.  Add "in-top" and "in-bot" options.
Files:  src/structs.h, src/eval.c, src/channel.c, src/proto/channel.pro,
src/os_unix.c, src/os_win32.c, src/testdir/test_channel.vim


*** ../vim-7.4.1484/src/structs.h   2016-02-27 18:13:05.240593068 +0100
--- src/structs.h   2016-03-03 22:05:05.171599848 +0100
***
*** 1267,1272 
--- 1267,1274 
  int   jv_exitval;
  char_u*jv_exit_cb;/* allocated */
  
+ buf_T *jv_in_buf; /* buffer from "in-name" */
+ 
  int   jv_refcount;/* reference count */
  channel_T *jv_channel;/* channel for I/O, reference counted */
  };
***
*** 1347,1353 
--- 1349,1358 
  
  cbq_T ch_cb_head; /* dummy node for per-request callbacks */
  char_u*ch_callback;   /* call when a msg is not handled */
+ 
  buf_T *ch_buffer; /* buffer to read from or write to */
+ linenr_T  ch_buf_top; /* next line to send */
+ linenr_T  ch_buf_bot; /* last line to send */
  } chanpart_T;
  
  struct channel_S {
***
*** 1402,1407 
--- 1407,1414 
  #define JO_OUT_NAME   0x8 /* "out-name" */
  #define JO_ERR_NAME   0x10/* "err-name" (JO_OUT_NAME << 1) */
  #define JO_IN_NAME0x20/* "in-name" (JO_OUT_NAME << 2) */
+ #define JO_IN_TOP 0x40/* "in-top" */
+ #define JO_IN_BOT 0x80/* "in-bot" */
  #define JO_ALL0xff
  
  #define JO_MODE_ALL   (JO_MODE + JO_IN_MODE + JO_OUT_MODE + JO_ERR_MODE)
***
*** 1433,1438 
--- 1440,1448 
  char_ujo_io_name_buf[4][NUMBUFLEN];
  char_u*jo_io_name[4]; /* not allocated! */
  
+ linenr_T  jo_in_top;
+ linenr_T  jo_in_bot;
+ 
  char_u*jo_callback;   /* not allocated! */
  char_u*jo_out_cb; /* not allocated! */
  char_u*jo_err_cb; /* not allocated! */
*** ../vim-7.4.1484/src/eval.c  2016-03-03 18:09:06.009997674 +0100
--- src/eval.c  2016-03-03 22:45:58.601399913 +0100
***
*** 9662,9668 
  rettv->vval.v_number = (buf != NULL && buf->b_ml.ml_mfp != NULL);
  }
  
! static buf_T *get_buf_tv(typval_T *tv, int curtab_only);
  
  /*
   * Get buffer by number or pattern.
--- 9662,9687 
  rettv->vval.v_number = (buf != NULL && buf->b_ml.ml_mfp != NULL);
  }
  
! static buf_T *
! buflist_find_by_name(char_u *name, int curtab_only)
! {
! int   save_magic;
! char_u*save_cpo;
! buf_T *buf;
! 
! /* Ignore 'magic' and 'cpoptions' here to make scripts portable */
! save_magic = p_magic;
! p_magic = TRUE;
! save_cpo = p_cpo;
! p_cpo = (char_u *)"";
! 
! buf = buflist_findnr(buflist_findpat(name, name + STRLEN(name),
!   TRUE, FALSE, curtab_only));
! 
! p_magic = save_magic;
! p_cpo = save_cpo;
! return buf;
! }
  
  /*
   * Get buffer by number or pattern.
***
*** 9671,9678 
  get_buf_tv(typval_T *tv, int curtab_only)
  {
  char_u*name = tv->vval.v_string;
- int   save_magic;
- char_u*save_cpo;
  buf_T *buf;
  
  if (tv->v_type == VAR_NUMBER)
--- 9690,9695 
***
*** 9684,9700 
  if (name[0] == '$' && name[1] == NUL)
return lastbuf;
  
! /* Ignore 'magic' and 'cpoptions' here to make scripts portable */
! save_magic = p_magic;
! p_magic = TRUE;
! save_cpo = p_cpo;
! p_cpo = (char_u *)"";
! 
! buf = buflist_findnr(buflist_findpat(name, name + STRLEN(name),
!   TRUE, FALSE, curtab_only));
! 
! p_magic = save_magic;
! p_cpo = save_cpo;
  
  /* If not found, try expanding the name, like done for bufexists(). */
  if (buf == NULL)
--- 9701,9707 
  if (name[0] == '$' && name[1] == NUL)
return lastbuf;
  
! buf = buflist_find_by_name(name, curtab_only);
  
  /* If not found, try expanding the name, like done for bufexists(). */
  if (buf == NULL)
***
*** 10110,10115 
--- 10117,10146 
opt->jo_io_name[part] =
   get_tv_string_buf_chk(item, opt->jo_io_name_buf[part]);
}
+   else if (STRCMP(hi->hi_key, "in-top") == 0
+   || STRCMP(hi->hi_key, "in-bot") == 0)
+   {
+   linenr_T *lp;
+ 
+   if (!(supported & JO_OUT_IO))
+   break;
+   if (hi->hi_key[3] == 't')
+   {
+   lp = >jo_in_top;
+   opt->jo_set |= JO_IN_TOP;
+   }
+   else
+   {
+   lp = >jo_in_bot;
+   opt->jo_set |= JO_IN_BOT;
+   }
+   *lp = get_tv_number(item);
+

Patch 7.4.1484

2016-03-03 Fir de Conversatie Bram Moolenaar

Patch 7.4.1484
Problem:Channel "err-io" value "out" is not supported.
Solution:   Connect stderr to stdout if wanted.
Files:  src/os_unix.c, src/os_win32.c, src/testdir/test_channel.vim,
src/testdir/test_channel_pipe.py


*** ../vim-7.4.1483/src/os_unix.c   2016-03-02 21:51:08.676257463 +0100
--- src/os_unix.c   2016-03-03 20:47:13.204717185 +0100
***
*** 5045,5050 
--- 5045,5051 
  int   fd_err[2];  /* for stderr */
  # ifdef FEAT_CHANNEL
  channel_T *channel = NULL;
+ int   use_out_for_err = options->jo_io[PART_ERR] == JIO_OUT;
  #endif
  
  /* default is to fail */
***
*** 5056,5062 
  /* TODO: without the channel feature connect the child to /dev/null? */
  # ifdef FEAT_CHANNEL
  /* Open pipes for stdin, stdout, stderr. */
! if ((pipe(fd_in) < 0) || (pipe(fd_out) < 0) ||(pipe(fd_err) < 0))
goto failed;
  
  channel = add_channel();
--- 5057,5064 
  /* TODO: without the channel feature connect the child to /dev/null? */
  # ifdef FEAT_CHANNEL
  /* Open pipes for stdin, stdout, stderr. */
! if (pipe(fd_in) < 0 || pipe(fd_out) < 0
!   || (!use_out_for_err && pipe(fd_err) < 0))
goto failed;
  
  channel = add_channel();
***
*** 5093,5109 
ignored = dup(fd_in[0]);
close(fd_in[0]);
  
/* set up stdout for the child */
close(fd_out[0]);
close(1);
ignored = dup(fd_out[1]);
close(fd_out[1]);
  
-   /* set up stderr for the child */
-   close(fd_err[0]);
-   close(2);
-   ignored = dup(fd_err[1]);
-   close(fd_err[1]);
  # endif
  
/* See above for type of argv. */
--- 5095,5120 
ignored = dup(fd_in[0]);
close(fd_in[0]);
  
+   /* set up stderr for the child */
+   if (use_out_for_err)
+   {
+   close(2);
+   ignored = dup(fd_out[1]);
+   }
+   else
+   {
+   close(fd_err[0]);
+   close(2);
+   ignored = dup(fd_err[1]);
+   close(fd_err[1]);
+   }
+ 
/* set up stdout for the child */
close(fd_out[0]);
close(1);
ignored = dup(fd_out[1]);
close(fd_out[1]);
  
  # endif
  
/* See above for type of argv. */
***
*** 5123,5131 
  /* child stdin, stdout and stderr */
  close(fd_in[0]);
  close(fd_out[1]);
- close(fd_err[1]);
  # ifdef FEAT_CHANNEL
! channel_set_pipes(channel, fd_in[1], fd_out[0], fd_err[0]);
  channel_set_job(channel, job);
  channel_set_options(channel, options);
  #  ifdef FEAT_GUI
--- 5134,5146 
  /* child stdin, stdout and stderr */
  close(fd_in[0]);
  close(fd_out[1]);
  # ifdef FEAT_CHANNEL
! if (!use_out_for_err)
! # endif
!   close(fd_err[1]);
! # ifdef FEAT_CHANNEL
! channel_set_pipes(channel, fd_in[1], fd_out[0],
!   use_out_for_err ? INVALID_FD : fd_err[0]);
  channel_set_job(channel, job);
  channel_set_options(channel, options);
  #  ifdef FEAT_GUI
*** ../vim-7.4.1483/src/os_win32.c  2016-02-27 18:13:05.240593068 +0100
--- src/os_win32.c  2016-03-03 20:53:34.848746475 +0100
***
*** 5000,5005 
--- 5000,5006 
  HANDLEjo;
  # ifdef FEAT_CHANNEL
  channel_T *channel;
+ int   use_out_for_err = options->jo_io[PART_ERR] == 
JIO_OUT;
  HANDLEifd[2];
  HANDLEofd[2];
  HANDLEefd[2];
***
*** 5038,5050 
 || !pSetHandleInformation(ifd[1], HANDLE_FLAG_INHERIT, 0)
 || !CreatePipe([0], [1], , 0)
 || !pSetHandleInformation(ofd[0], HANDLE_FLAG_INHERIT, 0)
!|| !CreatePipe([0], [1], , 0)
!|| !pSetHandleInformation(efd[0], HANDLE_FLAG_INHERIT, 0))
goto failed;
  si.dwFlags |= STARTF_USESTDHANDLES;
  si.hStdInput = ifd[0];
  si.hStdOutput = ofd[1];
! si.hStdError = efd[1];
  # endif
  
  if (!vim_create_process(cmd, TRUE,
--- 5039,5052 
 || !pSetHandleInformation(ifd[1], HANDLE_FLAG_INHERIT, 0)
 || !CreatePipe([0], [1], , 0)
 || !pSetHandleInformation(ofd[0], HANDLE_FLAG_INHERIT, 0)
!|| (!use_out_for_err
!  && (!CreatePipe([0], [1], , 0)
!   || !pSetHandleInformation(efd[0], HANDLE_FLAG_INHERIT, 0
goto failed;
  si.dwFlags |= STARTF_USESTDHANDLES;
  si.hStdInput = ifd[0];
  si.hStdOutput = ofd[1];
! si.hStdError = use_out_for_err ? ofd[1] : efd[1];
  # endif
  
  if (!vim_create_process(cmd, TRUE,
***
*** 5075,5084 
  # ifdef FEAT_CHANNEL
  CloseHandle(ifd[0]);
  CloseHandle(ofd[1]);
! CloseHandle(efd[1]);
  
  job->jv_channel = channel;
! channel_set_pipes(channel, (sock_T)ifd[1], (sock_T)ofd[0], 
(sock_T)efd[0]);
  channel_set_job(channel, 

Re: Patch 7.4.1478

2016-03-03 Fir de Conversatie Tony Mechelynck
On Thu, Mar 3, 2016 at 5:55 PM, Bram Moolenaar  wrote:
>
> Tony Mechelynck wrote:
>
>> On Thu, Mar 3, 2016 at 2:23 PM, Bram Moolenaar  wrote:
>> >
>> > Patch 7.4.1478
>> > Problem:":loadplugin" doesn't take care of ftdetect files.
>> > Solution:   Also load ftdetect scripts when appropriate.
>> > Files:  src/ex_cmds2.c
>>
>> After applying this patch (i.e., updating from the previous patchlevel
>> to this one), link failure in Tiny but not in Huge:
>> [...]
>
> Fixed with 7.4.1481.
>
Yes, it works now. :-)

Best regards,
Tony.

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

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


Patch 7.4.1483

2016-03-03 Fir de Conversatie Bram Moolenaar

Patch 7.4.1483
Problem:A one-time callback is not used for a raw channel.
Solution:   Use a one-time callback when it exists.
Files:  src/channel.c, src/testdir/test_channel.vim,
src/testdir/test_channel.py


*** ../vim-7.4.1482/src/channel.c   2016-03-02 21:16:56.025809799 +0100
--- src/channel.c   2016-03-03 18:49:48.409042489 +0100
***
*** 1390,1395 
--- 1390,1412 
  }
  }
  
+ static void
+ invoke_one_time_callback(
+   channel_T   *channel,
+   cbq_T   *cbhead,
+   cbq_T   *item,
+   typval_T*argv)
+ {
+ ch_logs(channel, "Invoking one-time callback %s",
+  (char *)item->cq_callback);
+ /* Remove the item from the list first, if the callback
+  * invokes ch_close() the list will be cleared. */
+ remove_cb_node(cbhead, item);
+ invoke_callback(channel, item->cq_callback, argv);
+ vim_free(item->cq_callback);
+ vim_free(item);
+ }
+ 
  /*
   * Invoke a callback for "channel"/"part" if needed.
   * Return TRUE when a message was handled, there might be another one.
***
*** 1402,1407 
--- 1419,1426 
  typval_T  argv[CH_JSON_MAX_ARGS];
  int   seq_nr = -1;
  ch_mode_T ch_mode = channel->ch_part[part].ch_mode;
+ cbq_T *cbhead = >ch_part[part].ch_cb_head;
+ cbq_T *cbitem = cbhead->cq_next;
  char_u*callback = NULL;
  buf_T *buffer = NULL;
  
***
*** 1409,1415 
/* this channel is handled elsewhere (netbeans) */
return FALSE;
  
! if (channel->ch_part[part].ch_callback != NULL)
callback = channel->ch_part[part].ch_callback;
  else
callback = channel->ch_callback;
--- 1428,1437 
/* this channel is handled elsewhere (netbeans) */
return FALSE;
  
! /* use a message-specific callback, part callback or channel callback */
! if (cbitem != NULL)
!   callback = cbitem->cq_callback;
! else if (channel->ch_part[part].ch_callback != NULL)
callback = channel->ch_part[part].ch_callback;
  else
callback = channel->ch_callback;
***
*** 1525,1551 
  
  if (seq_nr > 0)
  {
-   cbq_T   *head = >ch_part[part].ch_cb_head;
-   cbq_T   *item = head->cq_next;
int done = FALSE;
  
/* invoke the one-time callback with the matching nr */
!   while (item != NULL)
{
!   if (item->cq_seq_nr == seq_nr)
{
!   ch_logs(channel, "Invoking one-time callback %s",
!  (char *)item->cq_callback);
!   /* Remove the item from the list first, if the callback
!* invokes ch_close() the list will be cleared. */
!   remove_cb_node(head, item);
!   invoke_callback(channel, item->cq_callback, argv);
!   vim_free(item->cq_callback);
!   vim_free(item);
done = TRUE;
break;
}
!   item = item->cq_next;
}
if (!done)
ch_logn(channel, "Dropping message %d without callback", seq_nr);
--- 1547,1564 
  
  if (seq_nr > 0)
  {
int done = FALSE;
  
/* invoke the one-time callback with the matching nr */
!   while (cbitem != NULL)
{
!   if (cbitem->cq_seq_nr == seq_nr)
{
!   invoke_one_time_callback(channel, cbhead, cbitem, argv);
done = TRUE;
break;
}
!   cbitem = cbitem->cq_next;
}
if (!done)
ch_logn(channel, "Dropping message %d without callback", seq_nr);
***
*** 1599,1609 
}
}
}
if (callback != NULL)
{
!   /* invoke the channel callback */
!   ch_logs(channel, "Invoking channel callback %s", (char *)callback);
!   invoke_callback(channel, callback, argv);
}
  }
  else
--- 1612,1629 
}
}
}
+ 
if (callback != NULL)
{
!   if (cbitem != NULL)
!   invoke_one_time_callback(channel, cbhead, cbitem, argv);
!   else
!   {
!   /* invoke the channel callback */
!   ch_logs(channel, "Invoking channel callback %s",
!   (char *)callback);
!   invoke_callback(channel, callback, argv);
!   }
}
  }
  else
*** ../vim-7.4.1482/src/testdir/test_channel.vim2016-03-03 
18:09:06.013997633 +0100
--- src/testdir/test_channel.vim2016-03-03 19:21:06.045874189 +0100
***
*** 257,262 
--- 257,264 
call s:run_server('s:server_crash')
  endfunc
  
+ "
+ 
  let s:reply = ""
  func s:Handler(chan, msg)
unlet s:reply
***
*** 290,295 

Patch 7.4.1482

2016-03-03 Fir de Conversatie Bram Moolenaar

Patch 7.4.1482
Problem:"timeout" option not supported on ch_send*() and ch_eval*().
Solution:   Get and use the timeout option from the argument.
Files:  src/eval.c, src/testdir/test_channel.vim


*** ../vim-7.4.1481/src/eval.c  2016-03-03 12:22:48.562554007 +0100
--- src/eval.c  2016-03-03 18:08:18.398490543 +0100
***
*** 10518,10532 
   */
  static channel_T *
  send_common(
!   typval_T *argvars,
!   char_u *text,
!   int id,
!   int eval,
!   char *fun,
!   int *part_read)
  {
  channel_T *channel;
- jobopt_T  opt;
  int   part_send;
  
  channel = get_channel_arg([0]);
--- 10518,10532 
   */
  static channel_T *
  send_common(
!   typval_T*argvars,
!   char_u  *text,
!   int id,
!   int eval,
!   jobopt_T*opt,
!   char*fun,
!   int *part_read)
  {
  channel_T *channel;
  int   part_send;
  
  channel = get_channel_arg([0]);
***
*** 10535,10559 
  part_send = channel_part_send(channel);
  *part_read = channel_part_read(channel);
  
! clear_job_options();
! if (get_job_options([2], , JO_CALLBACK) == FAIL)
return NULL;
  
  /* Set the callback. An empty callback means no callback and not reading
   * the response. With "ch_evalexpr()" and "ch_evalraw()" a callback is not
   * allowed. */
! if (opt.jo_callback != NULL && *opt.jo_callback != NUL)
  {
if (eval)
{
EMSG2(_("E917: Cannot use a callback with %s()"), fun);
return NULL;
}
!   channel_set_req_callback(channel, part_send, opt.jo_callback, id);
  }
  
  if (channel_send(channel, part_send, text, fun) == OK
!  && opt.jo_callback == NULL)
return channel;
  return NULL;
  }
--- 10535,10559 
  part_send = channel_part_send(channel);
  *part_read = channel_part_read(channel);
  
! clear_job_options(opt);
! if (get_job_options([2], opt, JO_CALLBACK + JO_TIMEOUT) == FAIL)
return NULL;
  
  /* Set the callback. An empty callback means no callback and not reading
   * the response. With "ch_evalexpr()" and "ch_evalraw()" a callback is not
   * allowed. */
! if (opt->jo_callback != NULL && *opt->jo_callback != NUL)
  {
if (eval)
{
EMSG2(_("E917: Cannot use a callback with %s()"), fun);
return NULL;
}
!   channel_set_req_callback(channel, part_send, opt->jo_callback, id);
  }
  
  if (channel_send(channel, part_send, text, fun) == OK
! && opt->jo_callback == NULL)
return channel;
  return NULL;
  }
***
*** 10571,10576 
--- 10571,10577 
  ch_mode_T ch_mode;
  int   part_send;
  int   part_read;
+ jobopt_Topt;
  int   timeout;
  
  /* return an empty string by default */
***
*** 10595,10606 
  if (text == NULL)
return;
  
! channel = send_common(argvars, text, id, eval,
eval ? "ch_evalexpr" : "ch_sendexpr", _read);
  vim_free(text);
  if (channel != NULL && eval)
  {
!   /* TODO: timeout from options */
timeout = channel_get_timeout(channel, part_read);
if (channel_read_json_block(channel, part_read, timeout, id, )
== OK)
--- 10596,10610 
  if (text == NULL)
return;
  
! channel = send_common(argvars, text, id, eval, ,
eval ? "ch_evalexpr" : "ch_sendexpr", _read);
  vim_free(text);
  if (channel != NULL && eval)
  {
!   if (opt.jo_set & JO_TIMEOUT)
!   timeout = opt.jo_timeout;
!   else
!   timeout = channel_get_timeout(channel, part_read);
timeout = channel_get_timeout(channel, part_read);
if (channel_read_json_block(channel, part_read, timeout, id, )
== OK)
***
*** 10644,10649 
--- 10648,10654 
  char_u*text;
  channel_T *channel;
  int   part_read;
+ jobopt_Topt;
  int   timeout;
  
  /* return an empty string by default */
***
*** 10651,10662 
  rettv->vval.v_string = NULL;
  
  text = get_tv_string_buf([1], buf);
! channel = send_common(argvars, text, 0, eval,
  eval ? "ch_evalraw" : "ch_sendraw", _read);
  if (channel != NULL && eval)
  {
!   /* TODO: timeout from options */
!   timeout = channel_get_timeout(channel, part_read);
rettv->vval.v_string = channel_read_block(channel, part_read, timeout);
  }
  }
--- 10656,10669 
  rettv->vval.v_string = NULL;
  

Re: Patch 7.4.1478

2016-03-03 Fir de Conversatie Bram Moolenaar

Hirohito Higashi wrote:

> Why is it different in the search pattern at 'runtimepath' and 'packpath' ?
> 
> 'runtimepath': "plugin/**/*.vim"  (in main.c: 633)
> 'packpath': "plugin/*.vim" (in source_packages())
> 
> Is this expected?
> There is no *.vim directly under plugin in the existing plug-in, which
> is under the subfolder is not able to operate in 'packpath'.
> 
> e.g. https://github.com/sgur/vim-textobj-parameter

Yes, this is intentional.  Previously there was no directory above
"plugin/" to group files under, the subdirectory under "plugin/" could
be used to group files together:
.vim/plugin/group/one.vim
.vim/plugin/group/two.vim
.vim/plugin/other/one.vim

With 'packpath' there is a directory above "plugin/" that can be used
for this:

pack/mine/opt/group/plugin/one.vim
pack/mine/opt/group/plugin/two.vim
pack/mine/opt/other/plugin/one.vim

The big advantage is that when there are associated syntax files, for
example, they go in the same subdirectory, instead of being spread out.

-- 
Westheimer's Discovery:
A couple of months in the laboratory can
frequently save a couple of hours in the library.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

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

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


Re: Patch 7.4.1478

2016-03-03 Fir de Conversatie Bram Moolenaar

Tony Mechelynck wrote:

> On Thu, Mar 3, 2016 at 2:23 PM, Bram Moolenaar  wrote:
> >
> > Patch 7.4.1478
> > Problem:":loadplugin" doesn't take care of ftdetect files.
> > Solution:   Also load ftdetect scripts when appropriate.
> > Files:  src/ex_cmds2.c
> 
> After applying this patch (i.e., updating from the previous patchlevel
> to this one), link failure in Tiny but not in Huge:
> 
> link.sh: $LINK_AS_NEEDED set to 'yes': invoking linker directly.
>   gcc   -L/usr/local/lib -Wl,--as-needed-o vi objects/buffer.o
> objects/blowfish.o objects/charset.o objects/crypt.o
> objects/crypt_zip.o objects/diff.o objects/digraph.o objects/edit.o
> objects/eval.o objects/ex_cmds.o objects/ex_cmds2.o objects/ex_docmd.o
> objects/ex_eval.o objects/ex_getln.o objects/fileio.o objects/fold.o
> objects/getchar.o objects/hardcopy.o objects/hashtab.o
> objects/if_cscope.o objects/if_xcmdsrv.o objects/mark.o
> objects/memline.o objects/menu.o objects/message.o objects/misc1.o
> objects/misc2.o objects/move.o objects/mbyte.o objects/normal.o
> objects/ops.o objects/option.o objects/os_unix.o objects/pathdef.o
> objects/popupmnu.o objects/quickfix.o objects/regexp.o
> objects/screen.o objects/search.o objects/sha256.o objects/spell.o
> objects/syntax.o objects/tag.o objects/term.o objects/ui.o
> objects/undo.o objects/version.o objects/window.o
> objects/json.o objects/main.o objects/memfile.o-lSM -lICE -lXpm
> -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo  -lgpm -ldl
> objects/ex_cmds2.o: In function `may_do_filetypes':
> ex_cmds2.c:(.text+0x31f): undefined reference to `eval_to_number'
> collect2: error: ld returned 1 exit status
> link.sh: Linking failed
> Makefile:1805: recipe for target 'vi' failed
> make: *** [vi] Error 1
> exit status 2

Fixed with 7.4.1481.

-- 
BLACK KNIGHT: The Black Knight always triumphs. Have at you!
   ARTHUR takes his last leg off.  The BLACK KNIGHT's body lands upright.
BLACK KNIGHT: All right, we'll call it a draw.
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

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

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


Patch 7.4.1481

2016-03-03 Fir de Conversatie Bram Moolenaar

Patch 7.4.1481
Problem:Can't build with small features.
Solution:   Add #ifdef.
Files:  src/ex_cmds2.c


*** ../vim-7.4.1480/src/ex_cmds2.c  2016-03-03 17:13:00.488910501 +0100
--- src/ex_cmds2.c  2016-03-03 17:20:37.576051611 +0100
***
*** 3057,3062 
--- 3057,3063 
  return do_in_path(p_rtp, name, all ? DIP_ALL : 0, callback, cookie);
  }
  
+ #ifdef FEAT_AUTOCMD
  /*
   * Source filetype detection scripts, if filetype.vim was already done.
   */
***
*** 3075,3080 
--- 3076,3082 
  }
  vim_free(cmd);
  }
+ #endif
  
  static void
  add_pack_plugin(char_u *fname, void *cookie)
***
*** 3160,3166 
--- 3162,3170 
  {
  do_in_path(p_pp, (char_u *)"pack/*/ever/*/plugin/*.vim",
  DIP_ALL, add_pack_plugin, p_pp);
+ #ifdef FEAT_AUTOCMD
  may_do_filetypes((char_u *)"pack/*/ever/*/ftdetect/*.vim");
+ #endif
  }
  
  /*
***
*** 3181,3188 
--- 3185,3194 
  vim_snprintf(pat, len, plugpat, eap->arg);
  do_in_path(p_pp, (char_u *)pat, DIP_ALL, add_pack_plugin, p_pp);
  
+ #ifdef FEAT_AUTOCMD
  vim_snprintf(pat, len, ftpat, eap->arg);
  may_do_filetypes((char_u *)pat);
+ #endif
  
  vim_free(pat);
  }
*** ../vim-7.4.1480/src/version.c   2016-03-03 17:13:00.492910458 +0100
--- src/version.c   2016-03-03 17:21:15.283660629 +0100
***
*** 745,746 
--- 745,748 
  {   /* Add new patch number below this line */
+ /**/
+ 1481,
  /**/

-- 
"Beware of bugs in the above code; I have only proved
it correct, not tried it." -- Donald Knuth

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

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

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


Re: Patch 7.4.1479

2016-03-03 Fir de Conversatie Tony Mechelynck
On Thu, Mar 3, 2016 at 3:47 PM, Bram Moolenaar  wrote:
>
> Patch 7.4.1479
> Problem:No testfor ":loadplugin".
> Solution:   Add a test.  Fix how option is being set.
> Files:  src/ex_cmds2.c, src/testdir/test_loadplugin.vim,
> src/testdir/Make_all.mak

Tiny still fails to link (see my post about 7.4.1478). Missing #ifdef
FEAT_EVAL in ex_cmds2.c I presume.

Best regards,
Tony.

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

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


Patch 7.4.1480

2016-03-03 Fir de Conversatie Bram Moolenaar

Patch 7.4.1480
Problem:Cannot add a pack direcory without loading a plugin.
Solution:   Add the :packadd command.
Files:  src/ex_cmds.h, src/ex_cmds2.c, src/proto/ex_cmds2.pro,
src/testdir/test_loadplugin.vim, runtime/doc/repeat.txt


*** ../vim-7.4.1479/src/ex_cmds.h   2016-02-27 18:13:05.240593068 +0100
--- src/ex_cmds.h   2016-03-03 16:22:54.952674659 +0100
***
*** 1014,1019 
--- 1014,1022 
  EX(CMD_print, "print",ex_print,
RANGE|WHOLEFOLD|COUNT|EXFLAGS|TRLBAR|CMDWIN|SBOXOK,
ADDR_LINES),
+ EX(CMD_packadd,   "packadd",  ex_packadd,
+   BANG|FILE1|TRLBAR|SBOXOK|CMDWIN,
+   ADDR_LINES),
  EX(CMD_pclose,"pclose",   ex_pclose,
BANG|TRLBAR,
ADDR_LINES),
*** ../vim-7.4.1479/src/ex_cmds2.c  2016-03-03 15:46:51.230974004 +0100
--- src/ex_cmds2.c  2016-03-03 17:03:33.098964628 +0100
***
*** 2918,2924 
  /*
   * Source the file "name" from all directories in 'runtimepath'.
   * "name" can contain wildcards.
!  * When "all" is TRUE, source all files, otherwise only the first one.
   * return FAIL when no file could be sourced, OK otherwise.
   */
  int
--- 2918,2926 
  /*
   * Source the file "name" from all directories in 'runtimepath'.
   * "name" can contain wildcards.
!  * When "flags" has DIP_ALL: source all files, otherwise only the first one.
!  * When "flags" has DIP_DIR: find directories instead of files.
!  *
   * return FAIL when no file could be sourced, OK otherwise.
   */
  int
***
*** 2927,2937 
  return do_in_runtimepath(name, all, source_callback, NULL);
  }
  
  static int
  do_in_path(
  char_u*path,
  char_u*name,
! int   all,
  void  (*callback)(char_u *fname, void *ck),
  void  *cookie)
  {
--- 2929,2942 
  return do_in_runtimepath(name, all, source_callback, NULL);
  }
  
+ #define DIP_ALL   1   /* all matches, not just the first one */
+ #define DIP_DIR   2   /* find directories instead of files. */
+ 
  static int
  do_in_path(
  char_u*path,
  char_u*name,
! int   flags,
  void  (*callback)(char_u *fname, void *ck),
  void  *cookie)
  {
***
*** 2968,2974 
  
/* Loop over all entries in 'runtimepath'. */
rtp = rtp_copy;
!   while (*rtp != NUL && (all || !did_one))
{
/* Copy the path from 'runtimepath' to buf[]. */
copy_option_part(, buf, MAXPATHL, ",");
--- 2973,2979 
  
/* Loop over all entries in 'runtimepath'. */
rtp = rtp_copy;
!   while (*rtp != NUL && ((flags & DIP_ALL) || !did_one))
{
/* Copy the path from 'runtimepath' to buf[]. */
copy_option_part(, buf, MAXPATHL, ",");
***
*** 2985,2991 
  
/* Loop over all patterns in "name" */
np = name;
!   while (*np != NUL && (all || !did_one))
{
/* Append the pattern from "name" to buf[]. */
copy_option_part(, tail, (int)(MAXPATHL - (tail - buf)),
--- 2990,2996 
  
/* Loop over all patterns in "name" */
np = name;
!   while (*np != NUL && ((flags & DIP_ALL) || !did_one))
{
/* Append the pattern from "name" to buf[]. */
copy_option_part(, tail, (int)(MAXPATHL - (tail - buf)),
***
*** 3000,3012 
  
/* Expand wildcards, invoke the callback for each match. */
if (gen_expand_wildcards(1, , _files, ,
!  EW_FILE) == OK)
{
for (i = 0; i < num_files; ++i)
{
(*callback)(files[i], cookie);
did_one = TRUE;
!   if (!all)
break;
}
FreeWild(num_files, files);
--- 3005,3017 
  
/* Expand wildcards, invoke the callback for each match. */
if (gen_expand_wildcards(1, , _files, ,
! (flags & DIP_DIR) ? EW_DIR : EW_FILE) == OK)
{
for (i = 0; i < num_files; ++i)
{
(*callback)(files[i], cookie);
did_one = TRUE;
!   if (!(flags & DIP_ALL))
break;
}
FreeWild(num_files, files);
***
*** 3049,3055 
  void  (*callback)(char_u *fname, void *ck),
  void  

Patch 7.4.1479

2016-03-03 Fir de Conversatie Bram Moolenaar

Patch 7.4.1479
Problem:No testfor ":loadplugin".
Solution:   Add a test.  Fix how option is being set.
Files:  src/ex_cmds2.c, src/testdir/test_loadplugin.vim,
src/testdir/Make_all.mak


*** ../vim-7.4.1478/src/ex_cmds2.c  2016-03-03 14:23:06.478991745 +0100
--- src/ex_cmds2.c  2016-03-03 15:41:17.470423310 +0100
***
*** 3058,3071 
  static void
  may_do_filetypes(char_u *pat)
  {
! char_u *cmd = vim_strsave((char_u *)"did_load_filetypes");
  
  /* If runtime/filetype.vim wasn't loaded yet, the scripts will be found
   * when it loads. */
  if (cmd != NULL && eval_to_number(cmd) > 0)
  {
do_cmdline_cmd((char_u *)"augroup filetypedetect");
!   source_runtime(pat, TRUE);
do_cmdline_cmd((char_u *)"augroup END");
  }
  vim_free(cmd);
--- 3058,3071 
  static void
  may_do_filetypes(char_u *pat)
  {
! char_u *cmd = vim_strsave((char_u *)"g:did_load_filetypes");
  
  /* If runtime/filetype.vim wasn't loaded yet, the scripts will be found
   * when it loads. */
  if (cmd != NULL && eval_to_number(cmd) > 0)
  {
do_cmdline_cmd((char_u *)"augroup filetypedetect");
!   do_in_path(p_pp, pat, TRUE, source_callback, NULL);
do_cmdline_cmd((char_u *)"augroup END");
  }
  vim_free(cmd);
***
*** 3125,3132 
if (p_rtp[keep] != NUL)
mch_memmove(new_rtp + keep + 1 + addlen, p_rtp + keep,
   oldlen - keep + 1);
!   free_string_option(p_rtp);
!   p_rtp = new_rtp;
  }
  *p2 = c;
  
--- 3125,3132 
if (p_rtp[keep] != NUL)
mch_memmove(new_rtp + keep + 1 + addlen, p_rtp + keep,
   oldlen - keep + 1);
!   set_option_value((char_u *)"rtp", 0L, new_rtp, 0);
!   vim_free(new_rtp);
  }
  *p2 = c;
  
*** ../vim-7.4.1478/src/testdir/test_loadplugin.vim 2016-03-03 
15:46:20.839288174 +0100
--- src/testdir/test_loadplugin.vim 2016-03-03 14:53:27.960067070 +0100
***
*** 0 
--- 1,25 
+ " Tests for :loadplugin
+ 
+ func Test_loadplugin()
+   let topdir = expand('%:h') . '/Xdir'
+   exe 'set packpath=' . topdir
+   let plugdir = topdir . '/pack/mine/opt/mytest'
+   call mkdir(plugdir . '/plugin', 'p')
+   call mkdir(plugdir . '/ftdetect', 'p')
+   filetype on
+   try
+ exe 'split ' . plugdir . '/plugin/test.vim'
+ call setline(1, 'let g:plugin_works = 42')
+ wq
+ 
+ exe 'split ' . plugdir . '/ftdetect/test.vim'
+ call setline(1, 'let g:ftdetect_works = 17')
+ wq
+ 
+ loadplugin mytest
+ call assert_true(42, g:plugin_works)
+ call assert_true(17, g:ftdetect_works)
+   finally
+ call delete(topdir, 'rf')
+   endtry
+ endfunc
*** ../vim-7.4.1478/src/testdir/Make_all.mak2016-02-28 18:03:55.690659915 
+0100
--- src/testdir/Make_all.mak2016-03-03 14:31:37.933682949 +0100
***
*** 178,183 
--- 178,184 
test_increment.res \
test_json.res \
test_langmap.res \
+   test_loadplugin.res \
test_perl.res \
test_quickfix.res \
test_syntax.res \
*** ../vim-7.4.1478/src/version.c   2016-03-03 14:23:06.482991702 +0100
--- src/version.c   2016-03-03 15:45:41.623693536 +0100
***
*** 745,746 
--- 745,748 
  {   /* Add new patch number below this line */
+ /**/
+ 1479,
  /**/

-- 
Mrs Abbott: I'm a paediatrician.
 Basil: Feet?
Mrs Abbott: Children.
 Sybil: Oh, Basil!
 Basil: Well, children have feet, don't they? That's how they move
around, my dear. You must take a look next time, it's most
interesting.   (Fawlty Towers)

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

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

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


Re: [vim] Long lines make VIM slow but... (#555)

2016-03-03 Fir de Conversatie Charles E Campbell
Hugo Oliveira wrote:
>
> @chrisbra , I can also confirm the
> behaviour of @Deluxo . Using the kludge of
> setting synmaxcol to a high value and calling syntax on again make
> scrolling faster. Can you explain why?
>
> I have syntax on on my vimrc and editing latex files with synmaxcol
> really large make it much slower. doing @deluxo
>  kludge make things much better (not super
> fast but fine for text editing).
>
>
On the off-chance that participants in this "issue" will pay attention
to the mailing list instead of the bugtracker...have any of you read 
:help tex-slow ?  In particular, the hint given about folding.

Apologies for responding to vimdev, because this "issue" really should
have been on the vim mailing list.

Chip Campbell

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

2016-03-03 Fir de Conversatie h_east
Hi Bram and list,

Why is it different in the search pattern at 'runtimepath' and 'packpath' ?

'runtimepath': "plugin/**/*.vim"  (in main.c: 633)
'packpath': "plugin/*.vim" (in source_packages())

Is this expected?
There is no *.vim directly under plugin in the existing plug-in, which is under 
the subfolder is not able to operate in 'packpath'.

e.g. https://github.com/sgur/vim-textobj-parameter

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

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

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


Re: Patch 7.4.1478

2016-03-03 Fir de Conversatie Tony Mechelynck
On Thu, Mar 3, 2016 at 2:23 PM, Bram Moolenaar  wrote:
>
> Patch 7.4.1478
> Problem:":loadplugin" doesn't take care of ftdetect files.
> Solution:   Also load ftdetect scripts when appropriate.
> Files:  src/ex_cmds2.c

After applying this patch (i.e., updating from the previous patchlevel
to this one), link failure in Tiny but not in Huge:

link.sh: $LINK_AS_NEEDED set to 'yes': invoking linker directly.
  gcc   -L/usr/local/lib -Wl,--as-needed-o vi objects/buffer.o
objects/blowfish.o objects/charset.o objects/crypt.o
objects/crypt_zip.o objects/diff.o objects/digraph.o objects/edit.o
objects/eval.o objects/ex_cmds.o objects/ex_cmds2.o objects/ex_docmd.o
objects/ex_eval.o objects/ex_getln.o objects/fileio.o objects/fold.o
objects/getchar.o objects/hardcopy.o objects/hashtab.o
objects/if_cscope.o objects/if_xcmdsrv.o objects/mark.o
objects/memline.o objects/menu.o objects/message.o objects/misc1.o
objects/misc2.o objects/move.o objects/mbyte.o objects/normal.o
objects/ops.o objects/option.o objects/os_unix.o objects/pathdef.o
objects/popupmnu.o objects/quickfix.o objects/regexp.o
objects/screen.o objects/search.o objects/sha256.o objects/spell.o
objects/syntax.o objects/tag.o objects/term.o objects/ui.o
objects/undo.o objects/version.o objects/window.o
objects/json.o objects/main.o objects/memfile.o-lSM -lICE -lXpm
-lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo  -lgpm -ldl
objects/ex_cmds2.o: In function `may_do_filetypes':
ex_cmds2.c:(.text+0x31f): undefined reference to `eval_to_number'
collect2: error: ld returned 1 exit status
link.sh: Linking failed
Makefile:1805: recipe for target 'vi' failed
make: *** [vi] Error 1
exit status 2

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

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


Patch 7.4.1478

2016-03-03 Fir de Conversatie Bram Moolenaar

Patch 7.4.1478
Problem:":loadplugin" doesn't take care of ftdetect files.
Solution:   Also load ftdetect scripts when appropriate.
Files:  src/ex_cmds2.c


*** ../vim-7.4.1477/src/ex_cmds2.c  2016-03-03 12:22:48.562554007 +0100
--- src/ex_cmds2.c  2016-03-03 14:21:48.955797583 +0100
***
*** 3052,3057 
--- 3052,3076 
  return do_in_path(p_rtp, name, all, callback, cookie);
  }
  
+ /*
+  * Source filetype detection scripts, if filetype.vim was already done.
+  */
+ static void
+ may_do_filetypes(char_u *pat)
+ {
+ char_u *cmd = vim_strsave((char_u *)"did_load_filetypes");
+ 
+ /* If runtime/filetype.vim wasn't loaded yet, the scripts will be found
+  * when it loads. */
+ if (cmd != NULL && eval_to_number(cmd) > 0)
+ {
+   do_cmdline_cmd((char_u *)"augroup filetypedetect");
+   source_runtime(pat, TRUE);
+   do_cmdline_cmd((char_u *)"augroup END");
+ }
+ vim_free(cmd);
+ }
+ 
  static void
  source_pack_plugin(char_u *fname, void *cookie UNUSED)
  {
***
*** 3122,3127 
--- 3141,3147 
  {
  do_in_path(p_pp, (char_u *)"pack/*/ever/*/plugin/*.vim",
  TRUE, source_pack_plugin, NULL);
+ may_do_filetypes((char_u *)"pack/*/ever/*/ftdetect/*.vim");
  }
  
  /*
***
*** 3130,3145 
  void
  ex_loadplugin(exarg_T *eap)
  {
! static char *pattern = "pack/*/opt/%s/plugin/*.vim";
  int   len;
  char  *pat;
  
! len = (int)STRLEN(pattern) + (int)STRLEN(eap->arg);
  pat = (char *)alloc(len);
  if (pat == NULL)
return;
! vim_snprintf(pat, len, pattern, eap->arg);
  do_in_path(p_pp, (char_u *)pat, TRUE, source_pack_plugin, NULL);
  vim_free(pat);
  }
  
--- 3150,3170 
  void
  ex_loadplugin(exarg_T *eap)
  {
! static char *plugpat = "pack/*/opt/%s/plugin/*.vim";
! static char *ftpat = "pack/*/opt/%s/ftdetect/*.vim";
  int   len;
  char  *pat;
  
! len = (int)STRLEN(ftpat) + (int)STRLEN(eap->arg);
  pat = (char *)alloc(len);
  if (pat == NULL)
return;
! vim_snprintf(pat, len, plugpat, eap->arg);
  do_in_path(p_pp, (char_u *)pat, TRUE, source_pack_plugin, NULL);
+ 
+ vim_snprintf(pat, len, ftpat, eap->arg);
+ may_do_filetypes((char_u *)pat);
+ 
  vim_free(pat);
  }
  
*** ../vim-7.4.1477/src/version.c   2016-03-03 13:10:41.052418112 +0100
--- src/version.c   2016-03-03 14:06:41.945218029 +0100
***
*** 745,746 
--- 745,748 
  {   /* Add new patch number below this line */
+ /**/
+ 1478,
  /**/

-- 
BLACK KNIGHT: I'm invincible!
ARTHUR:   You're a looney.
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

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

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


Patch 7.4.1477

2016-03-03 Fir de Conversatie Bram Moolenaar

Patch 7.4.1477
Problem:Test_reltime is flaky, it depends on timing.
Solution:   When it fails run it a second time.
Files:  src/testdir/runtest.vim


*** ../vim-7.4.1476/src/testdir/runtest.vim 2016-02-20 14:41:36.503890373 
+0100
--- src/testdir/runtest.vim 2016-03-03 13:06:47.942865806 +0100
***
*** 72,77 
--- 72,95 
return lnum - top - 1
  endfunc
  
+ function RunTheTest(test)
+   echo 'Executing ' . a:test
+   if exists("*SetUp")
+ call SetUp()
+   endif
+ 
+   call add(s:messages, 'Executing ' . a:test)
+   let s:done += 1
+   try
+ exe 'call ' . a:test
+   catch
+ call add(v:errors, 'Caught exception in ' . a:test . ': ' . v:exception . 
' @ ' . v:throwpoint)
+   endtry
+ 
+   if exists("*TearDown")
+ call TearDown()
+   endif
+ endfunc
  
  " Source the test script.  First grab the file name, in case the script
  " navigates away.  g:testname can be used by the tests.
***
*** 92,97 
--- 110,118 
endtry
  endif
  
+ " Names of flaky tests.
+ let s:flaky = ['Test_reltime()']
+ 
  " Locate Test_ functions and execute them.
  set nomore
  redir @q
***
*** 106,123 
  
  " Execute the tests in alphabetical order.
  for s:test in sort(s:tests)
!   echo 'Executing ' . s:test
!   if exists("*SetUp")
! call SetUp()
!   endif
  
!   call add(s:messages, 'Executing ' . s:test)
!   let s:done += 1
!   try
! exe 'call ' . s:test
!   catch
! call add(v:errors, 'Caught exception in ' . s:test . ': ' . v:exception . 
' @ ' . v:throwpoint)
!   endtry
  
if len(v:errors) > 0
  let s:fail += 1
--- 127,139 
  
  " Execute the tests in alphabetical order.
  for s:test in sort(s:tests)
!   call RunTheTest(s:test)
  
!   if len(v:errors) > 0 && index(s:flaky, s:test) >= 0
! call add(s:messages, 'Flaky test failed, running it again')
! let v:errors = []
! call RunTheTest(s:test)
!   endif
  
if len(v:errors) > 0
  let s:fail += 1
***
*** 126,134 
  let v:errors = []
endif
  
-   if exists("*TearDown")
- call TearDown()
-   endif
  endfor
  
  if s:fail == 0
--- 142,147 
*** ../vim-7.4.1476/src/version.c   2016-03-03 12:22:48.570553923 +0100
--- src/version.c   2016-03-03 13:07:28.006444969 +0100
***
*** 745,746 
--- 745,748 
  {   /* Add new patch number below this line */
+ /**/
+ 1477,
  /**/

-- 
ARTHUR: What are you going to do. bleed on me?
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

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

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


Patch 7.4.1476

2016-03-03 Fir de Conversatie Bram Moolenaar

Patch 7.4.1476
Problem:Function arguments marked as unused while they are not.
Solution:   Remove UNUSED. (Yegappan Lakshmanan)
Files:  src/diff.c, src/eval.c, src/ex_cmds2.c, src/ex_docmd.c,
src/window.c


*** ../vim-7.4.1475/src/diff.c  2016-02-23 14:52:31.869232337 +0100
--- src/diff.c  2016-03-03 12:16:48.986312295 +0100
***
*** 641,647 
   */
  void
  ex_diffupdate(
! exarg_T   *eap UNUSED)/* can be NULL */
  {
  buf_T *buf;
  int   idx_orig;
--- 641,647 
   */
  void
  ex_diffupdate(
! exarg_T   *eap)   /* can be NULL */
  {
  buf_T *buf;
  int   idx_orig;
*** ../vim-7.4.1475/src/eval.c  2016-03-02 22:16:28.512450505 +0100
--- src/eval.c  2016-03-03 12:19:02.632915344 +0100
***
*** 9217,9223 
   * "arglistid()" function
   */
  static void
! f_arglistid(typval_T *argvars UNUSED, typval_T *rettv)
  {
  win_T *wp;
  
--- 9217,9223 
   * "arglistid()" function
   */
  static void
! f_arglistid(typval_T *argvars, typval_T *rettv)
  {
  win_T *wp;
  
***
*** 17782,17788 
   * "screenattr()" function
   */
  static void
! f_screenattr(typval_T *argvars UNUSED, typval_T *rettv)
  {
  int   row;
  int   col;
--- 17782,17788 
   * "screenattr()" function
   */
  static void
! f_screenattr(typval_T *argvars, typval_T *rettv)
  {
  int   row;
  int   col;
***
*** 17802,17808 
   * "screenchar()" function
   */
  static void
! f_screenchar(typval_T *argvars UNUSED, typval_T *rettv)
  {
  int   row;
  int   col;
--- 17802,17808 
   * "screenchar()" function
   */
  static void
! f_screenchar(typval_T *argvars, typval_T *rettv)
  {
  int   row;
  int   col;
***
*** 20969,20975 
   * "visualmode()" function
   */
  static void
! f_visualmode(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
  {
  char_ustr[2];
  
--- 20969,20975 
   * "visualmode()" function
   */
  static void
! f_visualmode(typval_T *argvars, typval_T *rettv)
  {
  char_ustr[2];
  
*** ../vim-7.4.1475/src/ex_cmds2.c  2016-02-27 18:13:05.228593194 +0100
--- src/ex_cmds2.c  2016-03-03 12:16:48.994312211 +0100
***
*** 2033,2039 
  static int
  do_arglist(
  char_u*str,
! int   what UNUSED,
  int   after UNUSED)   /* 0 means before first one */
  {
  garray_T  new_ga;
--- 2033,2039 
  static int
  do_arglist(
  char_u*str,
! int   what,
  int   after UNUSED)   /* 0 means before first one */
  {
  garray_T  new_ga;
*** ../vim-7.4.1475/src/ex_docmd.c  2016-02-27 18:13:05.232593151 +0100
--- src/ex_docmd.c  2016-03-03 12:16:48.998312168 +0100
***
*** 9262,9268 
   * ":undo".
   */
  static void
! ex_undo(exarg_T *eap UNUSED)
  {
  if (eap->addr_count == 1) /* :undo 123 */
undo_time(eap->line2, FALSE, FALSE, TRUE);
--- 9262,9268 
   * ":undo".
   */
  static void
! ex_undo(exarg_T *eap)
  {
  if (eap->addr_count == 1) /* :undo 123 */
undo_time(eap->line2, FALSE, FALSE, TRUE);
***
*** 9759,9765 
  #if ((defined(FEAT_SESSION) || defined(FEAT_EVAL)) && defined(vim_mkdir)) \
|| defined(PROTO)
  int
! vim_mkdir_emsg(char_u *name, int prot UNUSED)
  {
  if (vim_mkdir(name, prot) != 0)
  {
--- 9759,9765 
  #if ((defined(FEAT_SESSION) || defined(FEAT_EVAL)) && defined(vim_mkdir)) \
|| defined(PROTO)
  int
! vim_mkdir_emsg(char_u *name, int prot)
  {
  if (vim_mkdir(name, prot) != 0)
  {
*** ../vim-7.4.1475/src/window.c2016-02-23 14:52:31.901232005 +0100
--- src/window.c2016-03-03 12:16:48.998312168 +0100
***
*** 3896,3903 
  enter_tabpage(
  tabpage_T *tp,
  buf_T *old_curbuf UNUSED,
! int   trigger_enter_autocmds UNUSED,
! int   trigger_leave_autocmds UNUSED)
  {
  int   old_off = tp->tp_firstwin->w_winrow;
  win_T *next_prevwin = tp->tp_prevwin;
--- 3896,3903 
  enter_tabpage(
  tabpage_T *tp,
  buf_T *old_curbuf UNUSED,
! int   trigger_enter_autocmds,
! int   trigger_leave_autocmds)
  {
  int   old_off = tp->tp_firstwin->w_winrow;
  win_T *next_prevwin = tp->tp_prevwin;
*** ../vim-7.4.1475/src/version.c   2016-03-03 11:45:11.006143251 +0100
--- src/version.c   2016-03-03 12:17:57.465596499 +0100
***
*** 745,746 
--- 745,748 
  {   /* Add new patch number below this line */
+ /**/
+ 1476,
  /**/

-- 
ARTHUR:   Now stand aside worthy adversary.
BLACK KNIGHT: (Glancing at his shoulder) 'Tis but a scratch.
ARTHUR: 

Re: [PATCH] escaping CSI for hangulinput

2016-03-03 Fir de Conversatie Bram Moolenaar

Namsh -

> if utf-8 encoding is used, converted string can include CSI.

Thanks.  I'll also clean up that code a bit.

- Bram

-- 
Hanson's Treatment of Time:
There are never enough hours in a day, but always too
many days before Saturday.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

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

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


Patch 7.4.1475

2016-03-03 Fir de Conversatie Bram Moolenaar

Patch 7.4.1475
Problem:When using hangulinput with utf-8 a CSI character is
misintepreted.
Solution:   Convert CSI to K_CSI. (SungHyun Nam)
Files:  src/ui.c


*** ../vim-7.4.1474/src/ui.c2016-02-27 18:13:05.240593068 +0100
--- src/ui.c2016-03-03 11:40:32.693060629 +0100
***
*** 1689,1701 
  
  tmpbuf = hangul_string_convert(s, );
  if (tmpbuf != NULL)
s = tmpbuf;
  
! while (len--)
!   inbuf[inbufcount++] = *s++;
! 
! if (tmpbuf != NULL)
vim_free(tmpbuf);
  }
  #endif
  
--- 1689,1709 
  
  tmpbuf = hangul_string_convert(s, );
  if (tmpbuf != NULL)
+ {
s = tmpbuf;
  
!   for (; len--; s++)
!   {
!   inbuf[inbufcount++] = *s;
!   if (*s == CSI)
!   {
!   /* Turn CSI into K_CSI. */
!   inbuf[inbufcount++] = KS_EXTRA;
!   inbuf[inbufcount++] = (int)KE_CSI;
!   }
!   }
vim_free(tmpbuf);
+ }
  }
  #endif
  
*** ../vim-7.4.1474/src/version.c   2016-03-02 22:16:28.512450505 +0100
--- src/version.c   2016-03-03 11:41:56.928177531 +0100
***
*** 745,746 
--- 745,748 
  {   /* Add new patch number below this line */
+ /**/
+ 1475,
  /**/

-- 
DENNIS: You can't expect to wield supreme executive power just 'cause some
watery tart threw a sword at you!
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org///
 \\\help me help AIDS victims -- http://ICCF-Holland.org///

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

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


Re: [vim] Long lines make VIM slow but... (#555)

2016-03-03 Fir de Conversatie Christian Brabandt

Am 2016-03-03 10:25, schrieb Hugo Oliveira:

@chrisbra [1], I can also confirm the behaviour of @Deluxo [2]. Using
the kludge of setting synmaxcol to a high value and calling syntax on
again make scrolling faster. Can you explain why?


Please discuss this on the vim-use ml. This is no user support forum 
here.


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