Re: Please enable auto cancellation on travis CI

2017-08-05 Fir de Conversatie Yasuhiro MATSUMOTO
Thank you

On 8/6/17, Christian Brabandt  wrote:
>
> On Fr, 04 Aug 2017, Bram Moolenaar wrote:
>
>>
>> Yasuhiro wrote:
>>
>> > Bram and Christian.
>> >
>> > Could you please enable auto-cancellation on travis CI?
>> >
>> > http://go-gyazo.appspot.com/f6562f1f487205aa.png
>> >
>> > When send pull-request to vim/vim, travis CI start tests. If I notice
>> > a problem of last commit, I will push next commit. Or push --force.
>> > This feature cancel the previous tests. So we can get faster results.
>>
>> I think Christian needs to do that.
>>
>> Please only do this for pull requests.  For each patch it is good to
>> know whether it passed or failed, to be able to pinpoint where a failure
>> started.
>
> Okay, I enabled only Auto cancel pull request builds
>
>> I would like to be able to cancel individual builds though, when I know
>> it will fail anyway and the queue is getting long.  This is even more
>> useful on AppVeyor, where a stuck build runs for an hour before giving
>> up.
>
> I think you can do so by logging in to the travis-ci site and cancelling
> individual builds. The same is true for Appveyor.
>
>
> Best,
> Christian
> --
> Laut Statistik ist die Ehe, die Hauptursache aller Scheidungen.
>
> --
> --
> 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.
>


-- 
- Yasuhiro Matsumoto

-- 
-- 
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: ^\^N in terminal

2017-08-05 Fir de Conversatie Nikolay Aleksandrovich Pavlov
2017-08-06 0:17 GMT+03:00 Christian J. Robinson :
> On Sat, 5 Aug 2017, Christian Brabandt wrote:
>
>> What I mean is when in Insert Mode and pressing CTRL-\ CTRL-N we can enter
>> a normal mode command. In what mode is Vim afterwards? It is back in insert
>> mode, isn't it? And that's why I think it should behave the same for the
>> terminal.
>
>
> No, CTRL-\ CTRL-N is not temporary. Once it causes Vim to leave a mode you
> have to enter the mode again manually.

What you are replying to looks like a sarcasm. And I also think that
 must not be temporary for terminal mode as well.

>
> - Christian
>
> --
> Christian J. Robinson 
> Sorry, a fatal error has occurred.  You're dead.
>
>
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> --- You received this message because you are subscribed to the Google
> Groups "vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vim_dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

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

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


Re: ^\^N in terminal

2017-08-05 Fir de Conversatie Christian J. Robinson

On Sat, 5 Aug 2017, Christian Brabandt wrote:

What I mean is when in Insert Mode and pressing CTRL-\ CTRL-N we can 
enter a normal mode command. In what mode is Vim afterwards? It is 
back in insert mode, isn't it? And that's why I think it should 
behave the same for the terminal.


No, CTRL-\ CTRL-N is not temporary. Once it causes Vim to leave a mode 
you have to enter the mode again manually.


- Christian

--
Christian J. Robinson 
Sorry, a fatal error has occurred.  You're dead.

--
--
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: ^\^N in terminal

2017-08-05 Fir de Conversatie Christian Brabandt

On Sa, 05 Aug 2017, Bram Moolenaar wrote:

> 
> Christian Brabandt wrote:
> 
> > On Sa, 05 Aug 2017, Bram Moolenaar wrote:
> > 
> > > We can start by making CTRL-\ CTRL-N work as a prefix for one Normal
> > > mode command.
> > 
> > How does it work for other modes? Use whatever makes it consistent.
> 
> What do you mean?  From Normal mode you can also use ":" commands.
> Insert mode is not relevant.  You can also start Visual mode, but that
> doesn't work yet...

What I mean is when in Insert Mode and pressing CTRL-\ CTRL-N we can 
enter a normal mode command. In what mode is Vim afterwards? It is back 
in insert mode, isn't it? And that's why I think it should behave the 
same for the terminal.

Best,
Christian
-- 
Vegetarier leben nicht länger, sie sehen nur älter aus.

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

2017-08-05 Fir de Conversatie Bram Moolenaar

Patch 8.0.0876
Problem:MS-Windows: Backslashes and wildcards in backticks don't work.
Solution:   Do not handle backslashes inside backticks in the wrong place.
(Yasuhiro Matsumoto, closes #1942)
Files:  src/os_mswin.c, src/os_win32.c


*** ../vim-8.0.0875/src/os_mswin.c  2017-08-03 20:44:43.194297497 +0200
--- src/os_mswin.c  2017-08-05 23:06:31.719734658 +0200
***
*** 450,455 
--- 450,464 
  {
  if (path_with_url(p))
return;
+ 
+ if (*p == '`')
+ {
+   /* don't replace backslash in backtick quoted strings */
+   int len = STRLEN(p);
+   if (len > 2 && *(p + len - 1) == '`')
+   return;
+ }
+ 
  while (*p)
  {
if (*p == psepcN)
*** ../vim-8.0.0875/src/os_win32.c  2017-08-03 20:44:43.190297526 +0200
--- src/os_win32.c  2017-08-05 23:06:31.719734658 +0200
***
*** 7004,7009 
--- 7004,7011 
str = utf16_to_enc(ArglistW[idx], NULL);
if (str != NULL)
{
+   int literal = used_file_literal;
+ 
  #ifdef FEAT_DIFF
/* When using diff mode may need to concatenate file name to
 * directory name.  Just like it's done in main(). */
***
*** 7025,7031 
if (used_file_literal)
buf_set_name(fnum_list[i], str);
  
!   alist_add(_alist, str, used_file_literal ? 2 : 0);
}
  }
  
--- 7027,7041 
if (used_file_literal)
buf_set_name(fnum_list[i], str);
  
!   /* Check backtick literal. backtick literal is already expanded in
!* main.c, so this part add str as literal. */
!   if (literal == FALSE)
!   {
!   int len = STRLEN(str);
!   if (len > 2 && *str == '`' && *(str + len - 1) == '`')
!   literal = TRUE;
!   }
!   alist_add(_alist, str, literal ? 2 : 0);
}
  }
  
*** ../vim-8.0.0875/src/version.c   2017-08-05 23:00:49.690238118 +0200
--- src/version.c   2017-08-05 23:05:47.972054974 +0200
***
*** 771,772 
--- 771,774 
  {   /* Add new patch number below this line */
+ /**/
+ 876,
  /**/

-- 
Vi beats Emacs to death, and then again!
http://linuxtoday.com/stories/5764.html

 /// 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] fixed crash in home_replace()

2017-08-05 Fir de Conversatie Bram Moolenaar

Dominique wrote:

> Vim-8.0.873 and older crash with the attached
> non nonsensical "crash.vim" script:
> 
> $ vim -u NONE -S crash.vim
> Vim: Caught deadly signal SEGV
> Vim: Finished.
> Segmentation fault (core dumped)
> 
> Running with valgrind gives:
> 
> ==4446== Memcheck, a memory error detector
> ==4446== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
> ==4446== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
> ==4446== Command: vim -u NONE -S crash.vim
> ==4446==
> ==4446== Invalid write of size 1
> ==4446==at 0x4C31060: strcpy (in
> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==4446==by 0x4BD91E: strcpy (string3.h:110)
> ==4446==by 0x4BD91E: home_replace (misc1.c:4644)
> ==4446==by 0x47E67F: msg_add_fname (fileio.c:5269)
> ==4446==by 0x47E67F: filemess (fileio.c:165)
> ==4446==by 0x48246A: readfile (fileio.c:659)
> ==4446==by 0x40A060: open_buffer (buffer.c:236)
> ==4446==by 0x44FA97: do_ecmd (ex_cmds.c:4185)
> ==4446==by 0x466023: do_exedit (ex_docmd.c:8744)
> ==4446==by 0x461A47: do_one_cmd (ex_docmd.c:2952)
> ==4446==by 0x45DC8D: do_cmdline (ex_docmd.c:1089)
> ==4446==by 0x4526C0: global_exe (ex_cmds.c:5914)
> ==4446==by 0x4525AA: ex_global (ex_cmds.c:6054)
> ==4446==by 0x461A47: do_one_cmd (ex_docmd.c:2952)
> ==4446==  Address 0x84cc4f1 is 0 bytes after a block of size 1,025 alloc'd
> ==4446==at 0x4C2DB8F: malloc (in
> /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==4446==by 0x4CB857: lalloc (misc2.c:942)
> ==4446==by 0x5F034B: common_init (main.c:953)
> ==4446==by 0x5EDFE3: main (main.c:177)
> (followed by other errors)
> 
> The attached patch fixes it, but it might be
> only a workaround, as I don't think that the
> script should cause to have a long string.
> 
> Bug was found using afl-fuzz.

Thanks for finding this.
The solution looks a bit over the top.
I tried using strncpy() instead, but then splitting a multi-byte
character causes using uninitialized memory.  Using vim_snprintf() works
better.

-- 
TALL KNIGHT:   Firstly.  You must get us another shrubbery!
OTHER KNIGHTS: More shrubberies!  More shrubberies for the ex-Knights of Ni!
ARTHUR:Not another shrubbery -
 "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 8.0.0875

2017-08-05 Fir de Conversatie Bram Moolenaar

Patch 8.0.0875
Problem:Crash with weird command sequence. (Dominique Pelle)
Solution:   Use vim_snprintf() instead of STRCPY(). 
Files:  src/misc1.c


*** ../vim-8.0.0874/src/misc1.c 2017-08-03 17:53:59.296577109 +0200
--- src/misc1.c 2017-08-05 22:58:09.691408526 +0200
***
*** 4641,4647 
   */
  if (buf != NULL && buf->b_help)
  {
!   STRCPY(dst, gettail(src));
return;
  }
  
--- 4641,4647 
   */
  if (buf != NULL && buf->b_help)
  {
!   vim_snprintf((char *)dst, dstlen, "%s", gettail(src));
return;
  }
  
*** ../vim-8.0.0874/src/version.c   2017-08-05 21:13:32.716908729 +0200
--- src/version.c   2017-08-05 22:50:35.898725467 +0200
***
*** 771,772 
--- 771,774 
  {   /* Add new patch number below this line */
+ /**/
+ 875,
  /**/

-- 
The war between Emacs and Vi is over.  Vi has won with 3 to 1.
http://m.linuxjournal.com/files/linuxjournal.com/linuxjournal/articles/030/3044/3044s1.html

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

2017-08-05 Fir de Conversatie Bram Moolenaar

Dominique wrote:

> > Patch 8.0.0873
> > Problem:In a terminal window cannot use CTRL-\ CTRL-N to start Visual
> > mode.
> > Solution:   After CTRL-\ CTRL-N enter Terminal-Normal mode for one command.
> > Files:  src/main.c, src/terminal.c, src/proto/terminal.pro
> 
> This patch is causing a compilation error when
> I configure vim with:
> 
> $ ./configure --with-features=huge --enable-gui=none
> --enable-terminal --enable-python3interp
> $ make
> ...
> normal.c: In function 'nv_mousescroll':
> normal.c:4642:6: error: too few arguments to function 'term_use_loop'
>   if (term_use_loop())
>   ^
> In file included from proto.h:167:0,
>  from vim.h:2119,
>  from normal.c:15:
> proto/terminal.pro:9:5: note: declared here
>  int term_use_loop(int once);
>  ^
> 
> I suppose that it should be fixed like this:
> 
> diff --git a/src/normal.c b/src/normal.c
> index 25ab2d3..88f604d 100644
> --- a/src/normal.c
> +++ b/src/normal.c
> @@ -4639,7 +4639,7 @@ nv_mousescroll(cmdarg_T *cap)
>  if (cap->arg == MSCR_UP || cap->arg == MSCR_DOWN)
>  {
>  # ifdef FEAT_TERMINAL
> -   if (term_use_loop())
> +   if (term_use_loop(FALSE))
> send_keys_to_term(curbuf->b_term, cap->cmdchar, TRUE);
> else
>  # endif

Yes, sorry, I forgot to include that change in the patch.

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

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  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 8.0.0874

2017-08-05 Fir de Conversatie Bram Moolenaar

Patch 8.0.0874 (after 8.0.0873)
Problem:Can't build with terminal feature.
Solution:   Include change to term_use_loop(). (Dominique Pelle)
Files:  src/normal.c


*** ../vim-8.0.0873/src/normal.c2017-08-05 19:34:43.344410036 +0200
--- src/normal.c2017-08-05 19:55:10.283258002 +0200
***
*** 4639,4645 
  if (cap->arg == MSCR_UP || cap->arg == MSCR_DOWN)
  {
  # ifdef FEAT_TERMINAL
!   if (term_use_loop())
send_keys_to_term(curbuf->b_term, cap->cmdchar, TRUE);
else
  # endif
--- 4639,4645 
  if (cap->arg == MSCR_UP || cap->arg == MSCR_DOWN)
  {
  # ifdef FEAT_TERMINAL
!   if (term_use_loop(FALSE))
send_keys_to_term(curbuf->b_term, cap->cmdchar, TRUE);
else
  # endif
*** ../vim-8.0.0873/src/version.c   2017-08-05 20:16:55.861771375 +0200
--- src/version.c   2017-08-05 21:13:09.269076226 +0200
***
*** 771,772 
--- 771,774 
  {   /* Add new patch number below this line */
+ /**/
+ 874,
  /**/

-- 
ARTHUR: Did you say shrubberies?
ROGER:  Yes.  Shrubberies are my trade.  I am a shrubber.  My name is Roger
the Shrubber.  I arrange, design, and sell shrubberies.
 "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: Patch 8.0.0873

2017-08-05 Fir de Conversatie Dominique Pellé
Bram Moolenaar  wrote:

> Patch 8.0.0873
> Problem:In a terminal window cannot use CTRL-\ CTRL-N to start Visual
> mode.
> Solution:   After CTRL-\ CTRL-N enter Terminal-Normal mode for one command.
> Files:  src/main.c, src/terminal.c, src/proto/terminal.pro

This patch is causing a compilation error when
I configure vim with:

$ ./configure --with-features=huge --enable-gui=none
--enable-terminal --enable-python3interp
$ make
...
normal.c: In function 'nv_mousescroll':
normal.c:4642:6: error: too few arguments to function 'term_use_loop'
  if (term_use_loop())
  ^
In file included from proto.h:167:0,
 from vim.h:2119,
 from normal.c:15:
proto/terminal.pro:9:5: note: declared here
 int term_use_loop(int once);
 ^

I suppose that it should be fixed like this:

diff --git a/src/normal.c b/src/normal.c
index 25ab2d3..88f604d 100644
--- a/src/normal.c
+++ b/src/normal.c
@@ -4639,7 +4639,7 @@ nv_mousescroll(cmdarg_T *cap)
 if (cap->arg == MSCR_UP || cap->arg == MSCR_DOWN)
 {
 # ifdef FEAT_TERMINAL
-   if (term_use_loop())
+   if (term_use_loop(FALSE))
send_keys_to_term(curbuf->b_term, cap->cmdchar, TRUE);
else
 # endif

Dominique

-- 
-- 
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] fixed crash in home_replace()

2017-08-05 Fir de Conversatie Dominique Pellé
Hi

Vim-8.0.873 and older crash with the attached
non nonsensical "crash.vim" script:

$ vim -u NONE -S crash.vim
Vim: Caught deadly signal SEGV
Vim: Finished.
Segmentation fault (core dumped)

Running with valgrind gives:

==4446== Memcheck, a memory error detector
==4446== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==4446== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==4446== Command: vim -u NONE -S crash.vim
==4446==
==4446== Invalid write of size 1
==4446==at 0x4C31060: strcpy (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4446==by 0x4BD91E: strcpy (string3.h:110)
==4446==by 0x4BD91E: home_replace (misc1.c:4644)
==4446==by 0x47E67F: msg_add_fname (fileio.c:5269)
==4446==by 0x47E67F: filemess (fileio.c:165)
==4446==by 0x48246A: readfile (fileio.c:659)
==4446==by 0x40A060: open_buffer (buffer.c:236)
==4446==by 0x44FA97: do_ecmd (ex_cmds.c:4185)
==4446==by 0x466023: do_exedit (ex_docmd.c:8744)
==4446==by 0x461A47: do_one_cmd (ex_docmd.c:2952)
==4446==by 0x45DC8D: do_cmdline (ex_docmd.c:1089)
==4446==by 0x4526C0: global_exe (ex_cmds.c:5914)
==4446==by 0x4525AA: ex_global (ex_cmds.c:6054)
==4446==by 0x461A47: do_one_cmd (ex_docmd.c:2952)
==4446==  Address 0x84cc4f1 is 0 bytes after a block of size 1,025 alloc'd
==4446==at 0x4C2DB8F: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4446==by 0x4CB857: lalloc (misc2.c:942)
==4446==by 0x5F034B: common_init (main.c:953)
==4446==by 0x5EDFE3: main (main.c:177)
(followed by other errors)

The attached patch fixes it, but it might be
only a workaround, as I don't think that the
script should cause to have a long string.

Bug was found using afl-fuzz.

Regards
Dominique

-- 
-- 
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.vim
Description: Binary data
diff --git a/src/misc1.c b/src/misc1.c
index f19c2dc..ac2ce24 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -4641,7 +4641,13 @@ home_replace(
  */
 if (buf != NULL && buf->b_help)
 {
-	STRCPY(dst, gettail(src));
+	char_u *tail = gettail(src);
+	int	taillen = STRLEN(tail);
+
+	if (taillen < dstlen)
+	mch_memmove(dst, tail, taillen + 1);
+	else
+	*dst = NUL;
 	return;
 }
 


Re: ^\^N in terminal

2017-08-05 Fir de Conversatie Bram Moolenaar

Christian Brabandt wrote:

> On Sa, 05 Aug 2017, Bram Moolenaar wrote:
> 
> > We can start by making CTRL-\ CTRL-N work as a prefix for one Normal
> > mode command.
> 
> How does it work for other modes? Use whatever makes it consistent.

What do you mean?  From Normal mode you can also use ":" commands.
Insert mode is not relevant.  You can also start Visual mode, but that
doesn't work yet...

-- 
When I look deep into your eyes, I see JPEG artifacts.
I can tell by the pixels that we're wrong for each other.  (xkcd)

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

2017-08-05 Fir de Conversatie Bram Moolenaar

Patch 8.0.0873
Problem:In a terminal window cannot use CTRL-\ CTRL-N to start Visual
mode.
Solution:   After CTRL-\ CTRL-N enter Terminal-Normal mode for one command.
Files:  src/main.c, src/terminal.c, src/proto/terminal.pro


*** ../vim-8.0.0872/src/main.c  2017-07-30 16:51:35.622144012 +0200
--- src/main.c  2017-08-05 19:44:58.247829235 +0200
***
*** 1356,1362 
else
{
  #ifdef FEAT_TERMINAL
!   if (term_use_loop() && oa.op_type == OP_NOP && oa.regname == NUL)
{
/* If terminal_loop() returns OK we got a key that is handled
 * in Normal model.  With FAIL the terminal was closed and the
--- 1356,1364 
else
{
  #ifdef FEAT_TERMINAL
!   if (term_use_loop(TRUE)
!   && oa.op_type == OP_NOP && oa.regname == NUL
!   && !VIsual_active)
{
/* If terminal_loop() returns OK we got a key that is handled
 * in Normal model.  With FAIL the terminal was closed and the
*** ../vim-8.0.0872/src/terminal.c  2017-08-05 19:34:43.344410036 +0200
--- src/terminal.c  2017-08-05 20:12:44.503603800 +0200
***
*** 115,121 
  int   tl_tty_fd;
  char_u*tl_tty_name;
  
! int   tl_terminal_mode;
  int   tl_channel_closed;
  
  #ifdef WIN3264
--- 115,121 
  int   tl_tty_fd;
  char_u*tl_tty_name;
  
! int   tl_terminal_mode; /* 0, TMODE_ONCE or TMODE_LOOP */
  int   tl_channel_closed;
  
  #ifdef WIN3264
***
*** 144,149 
--- 144,152 
  int   tl_cursor_visible;
  };
  
+ #define TMODE_ONCE 1  /* CTRL-\ CTRL-N used */
+ #define TMODE_LOOP 2  /* CTRL-W N used */
+ 
  /*
   * List of all active terminals.
   */
***
*** 459,465 
  static void
  update_cursor(term_T *term, int redraw)
  {
! if (term->tl_terminal_mode)
return;
  setcursor();
  if (redraw && term->tl_buffer == curbuf)
--- 462,468 
  static void
  update_cursor(term_T *term, int redraw)
  {
! if (term->tl_terminal_mode != 0)
return;
  setcursor();
  if (redraw && term->tl_buffer == curbuf)
***
*** 492,498 
  ch_log(channel, "writing %d bytes to terminal", (int)len);
  term_write_job_output(term, msg, len);
  
! if (!term->tl_terminal_mode)
  {
/* TODO: only update once in a while. */
update_screen(0);
--- 495,501 
  ch_log(channel, "writing %d bytes to terminal", (int)len);
  term_write_job_output(term, msg, len);
  
! if (term->tl_terminal_mode == 0)
  {
/* TODO: only update once in a while. */
update_screen(0);
***
*** 805,813 
  }
  
  static void
! set_terminal_mode(term_T *term, int on)
  {
! term->tl_terminal_mode = on;
  vim_free(term->tl_status_text);
  term->tl_status_text = NULL;
  if (term->tl_buffer == curbuf)
--- 808,816 
  }
  
  static void
! set_terminal_mode(term_T *term, int mode)
  {
! term->tl_terminal_mode = mode;
  vim_free(term->tl_status_text);
  term->tl_status_text = NULL;
  if (term->tl_buffer == curbuf)
***
*** 823,844 
  {
  move_terminal_to_buffer(term);
  term_free_vterm(term);
! set_terminal_mode(term, FALSE);
  }
  
  /*
!  * Switch from sending keys to the job to Terminal-Normal mode.
   * Suspends updating the terminal window.
   */
  static void
! term_enter_terminal_mode()
  {
  term_T *term = curbuf->b_term;
  
  /* Append the current terminal contents to the buffer. */
  move_terminal_to_buffer(term);
  
! set_terminal_mode(term, TRUE);
  }
  
  /*
--- 826,860 
  {
  move_terminal_to_buffer(term);
  term_free_vterm(term);
! set_terminal_mode(term, 0);
  }
  
  /*
!  * Switch from Terminal-Job mode to Terminal-Normal mode.
   * Suspends updating the terminal window.
   */
  static void
! term_enter_terminal_mode(int mode)
  {
  term_T *term = curbuf->b_term;
  
  /* Append the current terminal contents to the buffer. */
  move_terminal_to_buffer(term);
  
! set_terminal_mode(term, mode);
! 
! if (mode == TMODE_ONCE)
! {
!   /* Move the window cursor to the position of the cursor in the
!* terminal. */
!   curwin->w_cursor.lnum = term->tl_scrollback_scrolled
!+ term->tl_cursor_pos.row + 1;
!   check_cursor();
!   coladvance(term->tl_cursor_pos.col);
! 
!   /* Display the same lines as in the terminal. */
!   curwin->w_topline = term->tl_scrollback_scrolled + 1;
! }
  }
  
  /*
***
*** 850,860 
  {
  term_T *term = curbuf->b_term;
  
! return term != NULL && term->tl_terminal_mode;
  }
  
  /*
!  * Switch from Terminal-Normal mode to sending keys to the 

Patch 8.0.0872

2017-08-05 Fir de Conversatie Bram Moolenaar

Patch 8.0.0872
Problem:Using mouse scroll while a terminal window has focus and the mouse
pointer is on another window does not work.  Same for focus in a
non-terminal window ahd the mouse pointer is over a terminal
window.
Solution:   Send the scroll action to the right window.
Files:  src/terminal.c, src/normal.c, src/proto/terminal.pro


*** ../vim-8.0.0871/src/terminal.c  2017-08-05 18:02:17.158202722 +0200
--- src/terminal.c  2017-08-05 18:46:05.134202653 +0200
***
*** 37,43 
   *
   * TODO:
   * - MS-Windows: no redraw for 'updatetime'  #1915
-  * - mouse scroll: when over other window, scroll that window.
   * - add argument to term_wait() for waiting time.
   * - For the scrollback buffer store lines in the buffer, only attributes in
   *   tl_scrollback.
--- 37,42 
***
*** 909,915 
   * Return FAIL when the key needs to be handled in Normal mode.
   * Return OK when the key was dropped or sent to the terminal.
   */
! static int
  send_keys_to_term(term_T *term, int c, int typed)
  {
  char  msg[KEY_BUF_LEN];
--- 908,914 
   * Return FAIL when the key needs to be handled in Normal mode.
   * Return OK when the key was dropped or sent to the terminal.
   */
! int
  send_keys_to_term(term_T *term, int c, int typed)
  {
  char  msg[KEY_BUF_LEN];
***
*** 948,960 
case K_X1RELEASE:
case K_X2MOUSE:
case K_X2RELEASE:
if (mouse_row < W_WINROW(curwin)
|| mouse_row >= (W_WINROW(curwin) + curwin->w_height)
|| mouse_col < W_WINCOL(curwin)
|| mouse_col >= W_ENDCOL(curwin)
|| dragging_outside)
{
!   /* click outside the current window */
if (typed)
{
stuffcharReadbuff(c);
--- 947,964 
case K_X1RELEASE:
case K_X2MOUSE:
case K_X2RELEASE:
+ 
+   case K_MOUSEUP:
+   case K_MOUSEDOWN:
+   case K_MOUSELEFT:
+   case K_MOUSERIGHT:
if (mouse_row < W_WINROW(curwin)
|| mouse_row >= (W_WINROW(curwin) + curwin->w_height)
|| mouse_col < W_WINCOL(curwin)
|| mouse_col >= W_ENDCOL(curwin)
|| dragging_outside)
{
!   /* click or scroll outside the current window */
if (typed)
{
stuffcharReadbuff(c);
*** ../vim-8.0.0871/src/normal.c2017-08-03 22:44:51.046797665 +0200
--- src/normal.c2017-08-05 18:44:54.750732074 +0200
***
*** 4638,4643 
--- 4638,4648 
  
  if (cap->arg == MSCR_UP || cap->arg == MSCR_DOWN)
  {
+ # ifdef FEAT_TERMINAL
+   if (term_use_loop())
+   send_keys_to_term(curbuf->b_term, cap->cmdchar, TRUE);
+   else
+ # endif
if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))
{
(void)onepage(cap->arg ? FORWARD : BACKWARD, 1L);
*** ../vim-8.0.0871/src/proto/terminal.pro  2017-08-03 13:51:02.384784816 
+0200
--- src/proto/terminal.pro  2017-08-05 18:45:14.482583262 +0200
***
*** 5,10 
--- 5,11 
  int term_job_running(term_T *term);
  int term_in_terminal_mode(void);
  void term_leave_terminal_mode(void);
+ int send_keys_to_term(term_T *term, int c, int typed);
  int term_use_loop(void);
  int terminal_loop(void);
  void term_job_ended(job_T *job);
*** ../vim-8.0.0871/src/version.c   2017-08-05 18:19:51.050143054 +0200
--- src/version.c   2017-08-05 19:34:05.656690367 +0200
***
*** 771,772 
--- 771,774 
  {   /* Add new patch number below this line */
+ /**/
+ 872,
  /**/

-- 
Time flies like an arrow.
Fruit flies like a banana.

 /// 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: ^\^N in terminal

2017-08-05 Fir de Conversatie Christian J. Robinson

On Sat, 5 Aug 2017, Bram Moolenaar wrote:

I assume what follows is not specific for the current window but 
something global.


Christian wrote:

I know ^W: exists, but I can't think of any good way to detect 
whether I should be sending that instead (under Windows, 
--remote-expr "" only gives me an error window from the 
running vim instance and fails to return anything, which doesn't 
look like correct behavior).


I think my parenthetical statement here should have been a separate 
bug report.  Basically, --remote-expr doesn't seem to work properly 
under Windows right now.  It shows the result in an error dialog, and 
fails to return that result to the "vim --remote-expr ..." command 
instance.


It does work for me in other OSes (and under Cygwin).

I don't know how long this has been an issue since I so rarely need to 
use --remote-expr.


With your remote command you most likely don't want to change the 
mode in the terminal window.  So we would support only one Normal 
mode command.  Would that work?  Or do you expect to be in Normal 
mode, where a sequence of commands can be used?


I send the ^\^N each time since it's not safe to assume that the 
remote Vim instance is in normal mode, so executing one normal mode 
command and returning to the previous mode is not a problem for me, 
and I think closer to what users would expect for a terminal window.



We can start by making CTRL-\ CTRL-N work as a prefix for one Normal
mode command.


I have tested the patch and I can confirm it solves my use case 
problem.


Thank you.

- Christian

--
Christian J. Robinson 
A balanced diet is a cookie in each hand.

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

2017-08-05 Fir de Conversatie Bram Moolenaar

Patch 8.0.0871
Problem:The status line for a terminal window always has "[+]".
Solution:   Do make the status line include "[+]" for a terminal window.
Files:  src/screen.c


*** ../vim-8.0.0870/src/screen.c2017-08-01 20:53:25.928774497 +0200
--- src/screen.c2017-08-05 18:17:22.175272575 +0200
***
*** 6893,6899 
len += (int)STRLEN(p + len);
}
  #endif
!   if (bufIsChanged(wp->w_buffer))
{
STRCPY(p + len, "[+]");
len += 3;
--- 6893,6903 
len += (int)STRLEN(p + len);
}
  #endif
!   if (bufIsChanged(wp->w_buffer)
! #ifdef FEAT_TERMINAL
!   && !bt_terminal(wp->w_buffer)
! #endif
!   )
{
STRCPY(p + len, "[+]");
len += 3;
*** ../vim-8.0.0870/src/version.c   2017-08-05 18:02:17.162202692 +0200
--- src/version.c   2017-08-05 18:19:14.546420012 +0200
***
*** 771,772 
--- 771,774 
  {   /* Add new patch number below this line */
+ /**/
+ 871,
  /**/

-- 
Q: What's orange and sounds like a parrot?
A: A carrot

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

2017-08-05 Fir de Conversatie Bram Moolenaar

Patch 8.0.0870
Problem:Mouse escape codes sent to terminal unintentionally.
Solution:   Fix libvterm to send mouse codes only when enabled.
Files:  src/terminal.c, src/libvterm/src/mouse.c


*** ../vim-8.0.0869/src/terminal.c  2017-08-05 17:40:34.212173943 +0200
--- src/terminal.c  2017-08-05 17:59:16.327589343 +0200
***
*** 37,43 
   *
   * TODO:
   * - MS-Windows: no redraw for 'updatetime'  #1915
-  * - in bash mouse clicks are inserting characters.
   * - mouse scroll: when over other window, scroll that window.
   * - add argument to term_wait() for waiting time.
   * - For the scrollback buffer store lines in the buffer, only attributes in
--- 37,42 
*** ../vim-8.0.0869/src/libvterm/src/mouse.c2017-07-25 21:34:42.061132703 
+0200
--- src/libvterm/src/mouse.c2017-08-05 17:58:14.260065416 +0200
***
*** 86,91 
--- 86,93 
/* Most of the time we don't get button releases from 4/5 */
if(state->mouse_buttons == old_buttons && button < 4)
  return;
+   if (!(state->mouse_flags & MOUSE_WANT_CLICK))
+ return;
  
if(button < 4) {
  output_mouse(state, button-1, pressed, mod, state->mouse_col, 
state->mouse_row);
*** ../vim-8.0.0869/src/version.c   2017-08-05 17:40:34.212173943 +0200
--- src/version.c   2017-08-05 18:01:26.562590636 +0200
***
*** 771,772 
--- 771,774 
  {   /* Add new patch number below this line */
+ /**/
+ 870,
  /**/

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

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  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: ^\^N in terminal

2017-08-05 Fir de Conversatie Christian Brabandt

On Sa, 05 Aug 2017, Bram Moolenaar wrote:

> We can start by making CTRL-\ CTRL-N work as a prefix for one Normal
> mode command.

How does it work for other modes? Use whatever makes it consistent.

Best,
Christian
-- 
In der Praxis ist vielen Menschen die Theorie doch lieber als die 
Praxis.
-- Ernst Ferstl

-- 
-- 
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: Please enable auto cancellation on travis CI

2017-08-05 Fir de Conversatie Christian Brabandt

On Fr, 04 Aug 2017, Bram Moolenaar wrote:

> 
> Yasuhiro wrote:
> 
> > Bram and Christian.
> > 
> > Could you please enable auto-cancellation on travis CI?
> > 
> > http://go-gyazo.appspot.com/f6562f1f487205aa.png
> > 
> > When send pull-request to vim/vim, travis CI start tests. If I notice
> > a problem of last commit, I will push next commit. Or push --force.
> > This feature cancel the previous tests. So we can get faster results.
> 
> I think Christian needs to do that.
> 
> Please only do this for pull requests.  For each patch it is good to
> know whether it passed or failed, to be able to pinpoint where a failure
> started.

Okay, I enabled only Auto cancel pull request builds

> I would like to be able to cancel individual builds though, when I know
> it will fail anyway and the queue is getting long.  This is even more
> useful on AppVeyor, where a stuck build runs for an hour before giving
> up.

I think you can do so by logging in to the travis-ci site and cancelling 
individual builds. The same is true for Appveyor.


Best,
Christian
-- 
Laut Statistik ist die Ehe, die Hauptursache aller Scheidungen.

-- 
-- 
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: include seoul256 colorscheme with Vim

2017-08-05 Fir de Conversatie Christian Brabandt

On Fr, 04 Aug 2017, LCD 47 wrote:

> Not sure a popularity contest is the best idea here.  Take f.i.
> the solarized scheme: it's probably the most popular scheme out there,
> but it's also the scheme generating the most requests for support, for
> reasons related to terminals, curses, X configuration etc.  Do you
> really want all these requests redirected to Vim?

There is a reason, I did not chose solarized.

Best,
Christian
-- 
Es ist mir sehr wahrscheinlich daß die meisten Irrtümer des Pöbels
aus der Sprache stammen.
-- Georg Christoph Lichtenberg

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


For issue #1665, here is the vim-monokai

2017-08-05 Fir de Conversatie Xia Crusoe
Hi Bram,

According to #1665 chrisbra asked me to send this file to you. I'm really glad 
that since years I loved Vim and finally can do something for it. vim-monokai 
uses the MIT license so feel free to use it.

Thanks,
Crusoe.Xia 

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


monokai.vim
Description: Binary data


Patch 8.0.0869

2017-08-05 Fir de Conversatie Bram Moolenaar

Patch 8.0.0869
Problem:Job output is sometimes not displayed in a terminal.
Solution:   Flush output before closing the channel.
Files:  src/channel.c, src/terminal.c


*** ../vim-8.0.0868/src/channel.c   2017-08-05 15:02:00.811606320 +0200
--- src/channel.c   2017-08-05 17:34:46.062836026 +0200
***
*** 2817,2841 
  ch_close_part(channel, PART_OUT);
  ch_close_part(channel, PART_ERR);
  
! if (invoke_close_cb && channel->ch_close_cb != NULL)
  {
! typval_T  argv[1];
! typval_T  rettv;
! int   dummy;
! ch_part_T part;
! 
! /* Invoke callbacks before the close callback, since it's weird to
!  * first invoke the close callback.  Increment the refcount to avoid
!  * the channel being freed halfway. */
! ++channel->ch_refcount;
! ch_log(channel, "Invoking callbacks before closing");
! for (part = PART_SOCK; part < PART_IN; ++part)
! while (may_invoke_callback(channel, part))
! ;
! 
! /* Invoke the close callback, if still set. */
! if (channel->ch_close_cb != NULL)
! {
  ch_log(channel, "Invoking close callback %s",
(char *)channel->ch_close_cb);
  argv[0].v_type = VAR_CHANNEL;
--- 2817,2856 
  ch_close_part(channel, PART_OUT);
  ch_close_part(channel, PART_ERR);
  
! if (invoke_close_cb)
  {
!   ch_part_T   part;
! 
!   /* Invoke callbacks and flush buffers before the close callback. */
!   if (channel->ch_close_cb != NULL)
!   ch_log(channel,
!"Invoking callbacks and flushing buffers before closing");
!   for (part = PART_SOCK; part < PART_IN; ++part)
!   {
!   if (channel->ch_close_cb != NULL
!   || channel->ch_part[part].ch_bufref.br_buf != NULL)
!   {
!   /* Increment the refcount to avoid the channel being freed
!* halfway. */
!   ++channel->ch_refcount;
!   if (channel->ch_close_cb == NULL)
!   ch_log(channel, "flushing %s buffers before closing",
!part_names[part]);
!   while (may_invoke_callback(channel, part))
!   ;
!   --channel->ch_refcount;
!   }
!   }
! 
!   if (channel->ch_close_cb != NULL)
!   {
! typval_T  argv[1];
! typval_T  rettv;
! int   dummy;
! 
! /* Increment the refcount to avoid the channel being freed
!  * halfway. */
! ++channel->ch_refcount;
  ch_log(channel, "Invoking close callback %s",
(char *)channel->ch_close_cb);
  argv[0].v_type = VAR_CHANNEL;
***
*** 2845,2869 
   channel->ch_close_partial, NULL);
  clear_tv();
  channel_need_redraw = TRUE;
- }
  
! /* the callback is only called once */
! free_callback(channel->ch_close_cb, channel->ch_close_partial);
! channel->ch_close_cb = NULL;
! channel->ch_close_partial = NULL;
! 
! --channel->ch_refcount;
! 
! if (channel_need_redraw)
! {
! channel_need_redraw = FALSE;
! redraw_after_callback();
! }
! 
! if (!channel->ch_drop_never)
! /* any remaining messages are useless now */
! for (part = PART_SOCK; part < PART_IN; ++part)
! drop_messages(channel, part);
  }
  
  channel->ch_nb_close_cb = NULL;
--- 2860,2884 
   channel->ch_close_partial, NULL);
  clear_tv();
  channel_need_redraw = TRUE;
  
! /* the callback is only called once */
! free_callback(channel->ch_close_cb, channel->ch_close_partial);
! channel->ch_close_cb = NULL;
! channel->ch_close_partial = NULL;
! 
! --channel->ch_refcount;
! 
! if (channel_need_redraw)
! {
! channel_need_redraw = FALSE;
! redraw_after_callback();
! }
! 
! if (!channel->ch_drop_never)
! /* any remaining messages are useless now */
! for (part = PART_SOCK; part < PART_IN; ++part)
! drop_messages(channel, part);
!   }
  }
  
  channel->ch_nb_close_cb = NULL;
*** ../vim-8.0.0868/src/terminal.c  2017-08-05 17:13:43.928522117 +0200
--- src/terminal.c  2017-08-05 17:39:32.372646592 +0200
***
*** 36,42 
   * that buffer, attributes come from the scrollback buffer tl_scrollback.
   *
   * TODO:
-  * - job_start('ls') sometimes does not work.
   * - MS-Windows: no redraw for 'updatetime'  #1915
   * - 

Patch 8.0.0868

2017-08-05 Fir de Conversatie Bram Moolenaar

Patch 8.0.0868
Problem:Cannot specify the terminal size on the command line.
Solution:   Use the address range for the terminal size. (Yasuhiro Matsumoto,
closes #1941)
Files:  src/terminal.c, src/testdir/test_terminal.vim


*** ../vim-8.0.0867/src/terminal.c  2017-08-05 15:16:28.169244309 +0200
--- src/terminal.c  2017-08-05 17:04:51.668645281 +0200
***
*** 257,262 
--- 257,273 
  split_ea.cmdidx = CMD_new;
  split_ea.cmd = (char_u *)"new";
  split_ea.arg = (char_u *)"";
+ if (opt->jo_term_rows > 0 && !(cmdmod.split & WSP_VERT))
+ {
+   split_ea.line2 = opt->jo_term_rows;
+   split_ea.addr_count = 1;
+ }
+ if (opt->jo_term_cols > 0 && (cmdmod.split & WSP_VERT))
+ {
+   split_ea.line2 = opt->jo_term_cols;
+   split_ea.addr_count = 1;
+ }
+ 
  ex_splitview(_ea);
  if (curwin == old_curwin)
  {
***
*** 267,272 
--- 278,289 
  term->tl_buffer = curbuf;
  curbuf->b_term = term;
  
+ /* only one size was taken care of with :new, do the other one */
+ if (opt->jo_term_rows > 0 && (cmdmod.split & WSP_VERT))
+   win_setheight(opt->jo_term_rows);
+ if (opt->jo_term_cols > 0 && !(cmdmod.split & WSP_VERT))
+   win_setwidth(opt->jo_term_cols);
+ 
  /* Link the new terminal in the list of active terminals. */
  term->tl_next = first_term;
  first_term = term;
***
*** 338,344 
  jobopt_T opt;
  
  init_job_options();
! /* TODO: get options from before the command */
  
  term_start(eap->arg, );
  }
--- 355,374 
  jobopt_T opt;
  
  init_job_options();
! 
! if (eap->addr_count == 2)
! {
!   opt.jo_term_rows = eap->line1;
!   opt.jo_term_cols = eap->line2;
! }
! else if (eap->addr_count == 1)
! {
!   if (cmdmod.split & WSP_VERT)
!   opt.jo_term_cols = eap->line2;
!   else
!   opt.jo_term_rows = eap->line2;
! }
! /* TODO: get more options from before the command */
  
  term_start(eap->arg, );
  }
*** ../vim-8.0.0867/src/testdir/test_terminal.vim   2017-08-05 
16:33:52.530755674 +0200
--- src/testdir/test_terminal.vim   2017-08-05 17:03:23.869326756 +0200
***
*** 171,173 
--- 171,199 
exe buf . 'bwipe'
call delete('Xtext')
  endfunc
+ 
+ func Test_terminal_size()
+   let cmd = Get_cat_cmd()
+ 
+   exe '5terminal ' . cmd
+   let size = term_getsize('')
+   bwipe!
+   call assert_equal(5, size[0])
+ 
+   vsplit
+   exe '5,33terminal ' . cmd
+   let size = term_getsize('')
+   bwipe!
+   call assert_equal([5, 33], size)
+ 
+   exe 'vertical 20terminal ' . cmd
+   let size = term_getsize('')
+   bwipe!
+   call assert_equal(20, size[1])
+ 
+   split
+   exe 'vertical 6,20terminal ' . cmd
+   let size = term_getsize('')
+   bwipe!
+   call assert_equal([6, 20], size)
+ endfunc
*** ../vim-8.0.0867/src/version.c   2017-08-05 16:33:52.530755674 +0200
--- src/version.c   2017-08-05 17:06:06.040068338 +0200
***
*** 771,772 
--- 771,774 
  {   /* Add new patch number below this line */
+ /**/
+ 868,
  /**/

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

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  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 8.0.0867

2017-08-05 Fir de Conversatie Bram Moolenaar

Patch 8.0.0867
Problem:When using a job or channel value as a dict value, when turning it
into a string the quotes are missing.
Solution:   Add quotes to the job and channel values. (Yasuhiro Matsumoto,
closes #1930)
Files:  src/list.c, src/eval.c, src/testdir/test_terminal.vim


*** ../vim-8.0.0866/src/list.c  2017-04-30 20:12:53.378810666 +0200
--- src/list.c  2017-08-05 16:02:34.836783879 +0200
***
*** 740,746 
  for (item = l->lv_first; item != NULL && !got_int; item = item->li_next)
  {
s = echo_string_core(>li_tv, , numbuf, copyID,
!  echo_style, restore_copyID, FALSE);
if (s == NULL)
return FAIL;
  
--- 740,746 
  for (item = l->lv_first; item != NULL && !got_int; item = item->li_next)
  {
s = echo_string_core(>li_tv, , numbuf, copyID,
! echo_style, restore_copyID, !echo_style);
if (s == NULL)
return FAIL;
  
*** ../vim-8.0.0866/src/eval.c  2017-07-29 20:11:34.726999121 +0200
--- src/eval.c  2017-08-05 16:10:13.645376430 +0200
***
*** 5683,5691 
   * If the memory is allocated "tofree" is set to it, otherwise NULL.
   * "numbuf" is used for a number.
   * When "copyID" is not NULL replace recursive lists and dicts with "...".
!  * When both "echo_style" and "dict_val" are FALSE, put quotes around stings 
as
!  * "string()", otherwise does not put quotes around strings, as ":echo"
!  * displays values.
   * When "restore_copyID" is FALSE, repeated items in dictionaries and lists
   * are replaced with "...".
   * May return NULL.
--- 5683,5691 
   * If the memory is allocated "tofree" is set to it, otherwise NULL.
   * "numbuf" is used for a number.
   * When "copyID" is not NULL replace recursive lists and dicts with "...".
!  * When both "echo_style" and "composite_val" are FALSE, put quotes around
!  * stings as "string()", otherwise does not put quotes around strings, as
!  * ":echo" displays values.
   * When "restore_copyID" is FALSE, repeated items in dictionaries and lists
   * are replaced with "...".
   * May return NULL.
***
*** 5698,5704 
  int   copyID,
  int   echo_style,
  int   restore_copyID,
! int   dict_val)
  {
  static intrecurse = 0;
  char_u*r = NULL;
--- 5698,5704 
  int   copyID,
  int   echo_style,
  int   restore_copyID,
! int   composite_val)
  {
  static intrecurse = 0;
  char_u*r = NULL;
***
*** 5721,5730 
  switch (tv->v_type)
  {
case VAR_STRING:
!   if (echo_style && !dict_val)
{
*tofree = NULL;
!   r = get_tv_string_buf(tv, numbuf);
}
else
{
--- 5721,5732 
  switch (tv->v_type)
  {
case VAR_STRING:
!   if (echo_style && !composite_val)
{
*tofree = NULL;
!   r = tv->vval.v_string;
!   if (r == NULL)
!   r = (char_u *)"";
}
else
{
***
*** 5841,5850 
--- 5843,5861 
  
case VAR_NUMBER:
case VAR_UNKNOWN:
+   *tofree = NULL;
+   r = get_tv_string_buf(tv, numbuf);
+   break;
+ 
case VAR_JOB:
case VAR_CHANNEL:
*tofree = NULL;
r = get_tv_string_buf(tv, numbuf);
+   if (composite_val)
+   {
+   *tofree = string_quote(r, FALSE);
+   r = *tofree;
+   }
break;
  
case VAR_FLOAT:
*** ../vim-8.0.0866/src/testdir/test_terminal.vim   2017-08-03 
22:44:51.046797665 +0200
--- src/testdir/test_terminal.vim   2017-08-05 16:16:14.190701327 +0200
***
*** 18,23 
--- 18,26 
let g:job = term_getjob(buf)
call assert_equal(v:t_job, type(g:job))
  
+   let string = string({'job': term_getjob(buf)})
+   call assert_match("{'job': 'process \\d\\+ run'}", string)
+ 
return buf
  endfunc
  
*** ../vim-8.0.0866/src/version.c   2017-08-05 15:16:28.169244309 +0200
--- src/version.c   2017-08-05 16:31:30.139834390 +0200
***
*** 771,772 
--- 771,774 
  {   /* Add new patch number below this line */
+ /**/
+ 867,
  /**/

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

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

Patch 8.0.0866

2017-08-05 Fir de Conversatie Bram Moolenaar

Patch 8.0.0866
Problem:Solaris also doesn't have MIN and MAX.
Solution:   Define MIN and MAX whenever they are not defined. (Ozaki Kiichi,
closes #1939)
Files:  src/terminal.c


*** ../vim-8.0.0865/src/terminal.c  2017-08-05 14:49:37.405044311 +0200
--- src/terminal.c  2017-08-05 15:13:24.746589348 +0200
***
*** 92,100 
  
  #if defined(FEAT_TERMINAL) || defined(PROTO)
  
! #ifdef WIN3264
! # define MIN(x,y) (x < y ? x : y)
! # define MAX(x,y) (x > y ? x : y)
  #endif
  
  #include "libvterm/include/vterm.h"
--- 92,102 
  
  #if defined(FEAT_TERMINAL) || defined(PROTO)
  
! #ifndef MIN
! # define MIN(x,y) ((x) < (y) ? (x) : (y))
! #endif
! #ifndef MAX
! # define MAX(x,y) ((x) > (y) ? (x) : (y))
  #endif
  
  #include "libvterm/include/vterm.h"
*** ../vim-8.0.0865/src/version.c   2017-08-05 15:02:00.811606320 +0200
--- src/version.c   2017-08-05 15:14:10.082256884 +0200
***
*** 771,772 
--- 771,774 
  {   /* Add new patch number below this line */
+ /**/
+ 866,
  /**/

-- 
Be nice to your kids...  they'll be the ones choosing your nursing home.

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

2017-08-05 Fir de Conversatie Bram Moolenaar

Patch 8.0.0865
Problem:Cannot build with channel but without terminal feature.
Solution:   Add #ifdef
Files:  src/channel.c


*** ../vim-8.0.0864/src/channel.c   2017-08-05 14:49:37.405044311 +0200
--- src/channel.c   2017-08-05 15:00:53.056103493 +0200
***
*** 4391,4396 
--- 4391,4397 
return FAIL;
}
}
+ #ifdef FEAT_TERMINAL
else if (STRCMP(hi->hi_key, "term_name") == 0)
{
if (!(supported & JO2_TERM_NAME))
***
*** 4403,4408 
--- 4404,4410 
return FAIL;
}
}
+ #endif
else if (STRCMP(hi->hi_key, "waittime") == 0)
{
if (!(supported & JO_WAITTIME))
*** ../vim-8.0.0864/src/version.c   2017-08-05 14:49:37.409044282 +0200
--- src/version.c   2017-08-05 15:01:28.839840917 +0200
***
*** 771,772 
--- 771,774 
  {   /* Add new patch number below this line */
+ /**/
+ 865,
  /**/

-- 
Mental Floss prevents moral decay!

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

2017-08-05 Fir de Conversatie Bram Moolenaar

Patch 8.0.0864
Problem:Cannot specify the name of a terminal.
Solution:   Add the "term_name" option. (Yasuhiro Matsumoto, closes #1936)
Files:  src/channel.c, src/structs.h, src/terminal.c, runtime/doc/eval.txt


*** ../vim-8.0.0863/src/channel.c   2017-08-04 21:37:48.732574980 +0200
--- src/channel.c   2017-08-05 14:17:09.295291400 +0200
***
*** 4391,4396 
--- 4391,4408 
return FAIL;
}
}
+   else if (STRCMP(hi->hi_key, "term_name") == 0)
+   {
+   if (!(supported & JO2_TERM_NAME))
+   break;
+   opt->jo_set2 |= JO2_TERM_NAME;
+   opt->jo_term_name = get_tv_string_chk(item);
+   if (opt->jo_term_name == NULL)
+   {
+   EMSG2(_(e_invarg2), "term_name");
+   return FAIL;
+   }
+   }
else if (STRCMP(hi->hi_key, "waittime") == 0)
{
if (!(supported & JO_WAITTIME))
*** ../vim-8.0.0863/src/structs.h   2017-08-03 13:51:02.384784816 +0200
--- src/structs.h   2017-08-05 14:23:39.028437596 +0200
***
*** 1656,1662 
  #define JO_CALLBACK   0x0010  /* channel callback */
  #define JO_OUT_CALLBACK   0x0020  /* stdout callback */
  #define JO_ERR_CALLBACK   0x0040  /* stderr callback */
! #define JO_CLOSE_CALLBACK   0x0080/* close callback */
  #define JO_WAITTIME   0x0100  /* only for ch_open() */
  #define JO_TIMEOUT0x0200  /* all timeouts */
  #define JO_OUT_TIMEOUT0x0400  /* stdout timeouts */
--- 1656,1662 
  #define JO_CALLBACK   0x0010  /* channel callback */
  #define JO_OUT_CALLBACK   0x0020  /* stdout callback */
  #define JO_ERR_CALLBACK   0x0040  /* stderr callback */
! #define JO_CLOSE_CALLBACK   0x0080/* "close_cb" */
  #define JO_WAITTIME   0x0100  /* only for ch_open() */
  #define JO_TIMEOUT0x0200  /* all timeouts */
  #define JO_OUT_TIMEOUT0x0400  /* stdout timeouts */
***
*** 1684,1690 
  
  #define JO2_OUT_MSG   0x0001  /* "out_msg" */
  #define JO2_ERR_MSG   0x0002  /* "err_msg" (JO_OUT_ << 1) */
! #define JO2_ALL   0x0003
  
  #define JO_MODE_ALL   (JO_MODE + JO_IN_MODE + JO_OUT_MODE + JO_ERR_MODE)
  #define JO_CB_ALL \
--- 1684,1691 
  
  #define JO2_OUT_MSG   0x0001  /* "out_msg" */
  #define JO2_ERR_MSG   0x0002  /* "err_msg" (JO_OUT_ << 1) */
! #define JO2_TERM_NAME 0x0004  /* "term_name" */
! #define JO2_ALL   0x0007
  
  #define JO_MODE_ALL   (JO_MODE + JO_IN_MODE + JO_OUT_MODE + JO_ERR_MODE)
  #define JO_CB_ALL \
***
*** 1741,1746 
--- 1742,1748 
  /* when non-zero run the job in a terminal window of this size */
  int   jo_term_rows;
  int   jo_term_cols;
+ char_u*jo_term_name;
  #endif
  } jobopt_T;
  
*** ../vim-8.0.0863/src/terminal.c  2017-08-05 14:10:44.750107642 +0200
--- src/terminal.c  2017-08-05 14:45:07.959010643 +0200
***
*** 36,41 
--- 36,42 
   * that buffer, attributes come from the scrollback buffer tl_scrollback.
   *
   * TODO:
+  * - job_start('ls') sometimes does not work.
   * - MS-Windows: no redraw for 'updatetime'  #1915
   * - in bash mouse clicks are inserting characters.
   * - mouse scroll: when over other window, scroll that window.
***
*** 67,74 
   * - support minimal size when 'termsize' is "rows*cols".
   * - support minimal size when 'termsize' is empty?
   * - implement "term" for job_start(): more job options when starting a
!  *   terminal.  Might allow reading stdin from a file or buffer, sending 
stderr
!  *   to a file or /dev/null, but something must be connected to the terminal.
   * - support ":term NONE" to open a terminal with a pty but not running a job
   *   in it.  The pty can be passed to gdb to run the executable in.
   * - if the job in the terminal does not support the mouse, we can use the
--- 68,81 
   * - support minimal size when 'termsize' is "rows*cols".
   * - support minimal size when 'termsize' is empty?
   * - implement "term" for job_start(): more job options when starting a
!  *   terminal.  Allow:
!  *"in_io", "in_top", "in_bot", "in_name", "in_buf"
!   "out_io", "out_name", "out_buf", "out_modifiable", "out_msg"
!   "err_io", "err_name", "err_buf", "err_modifiable", "err_msg"
!  *   Check that something is connected to the terminal.
!  *   Test: "cat" reading from a file or buffer
!  * "ls" writing stdout to a file or buffer
!  * shell writing stderr to a file or buffer
   * - support ":term NONE" to open a terminal with a pty but not running a job
   *   in it.  The pty can be passed to gdb to run the executable in.
   * - if the job in the terminal does not 

Re: ^\^N in terminal

2017-08-05 Fir de Conversatie Bram Moolenaar

Christian J. Robinson wrote:

> I remotely send ^\^N to Vim to invoke a user-defined command on a 
> regular basis.  Unfortunately, when the cursor is in a terminal window 
> it just sends the control characters directly to the shell (along with 
> the command).

I suppose you don't run Vim in the terminal window.  Or, if you did, you
would sent the keys to that Vim instance.

I was hoping to keep the number of exceptions minimal, but you have a
good point that for remote commands you need C-\ C-N to work.  I assume
what follows is not specific for the current window but something
global.

> I know ^W: exists, but I can't think of any good way to detect whether 
> I should be sending that instead (under Windows, --remote-expr 
> "" only gives me an error window from the running vim instance 
> and fails to return anything, which doesn't look like correct 
> behavior).

We can accept CTRL-\ CTRL-N to execute a Normal mode command, but what
happens next?  Does the terminal go back to send keys to the terminal,
or would it be in Terminal Normal mode, where you execute more Vim
commands until "i" is typed.

With your remote command you most likely don't want to change the mode
in the terminal window.  So we would support only one Normal mode
command.  Would that work?  Or do you expect to be in Normal mode, where
a sequence of commands can be used?

We can start by making CTRL-\ CTRL-N work as a prefix for one Normal
mode command.

-- 
CRONE:  Who sent you?
ARTHUR: The Knights Who Say Ni!
CRONE:  Aaaagh!  (she looks around in rear) No!  We have no shrubberies here.
 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  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 8.0.0863

2017-08-05 Fir de Conversatie Bram Moolenaar

Patch 8.0.0863
Problem:A remote command starting with CTRL-\ CTRL-N does not work in the
terminal window. (Christian J. Robinson)
Solution:   Use CTRL-\ CTRL-N as a prefix or a Normal mode command.
Files:  src/terminal.c, runtime/doc/terminal.txt


*** ../vim-8.0.0862/src/terminal.c  2017-08-04 20:29:49.048411601 +0200
--- src/terminal.c  2017-08-05 14:03:35.897234103 +0200
***
*** 52,57 
--- 52,60 
   * - make term_getcursor() return type (none/block/bar/underline) and
   *   attributes (color, blink, etc.)
   * - To set BS correctly, check get_stty(); Pass the fd of the pty.
+  *   For the GUI fill termios with default values, perhaps like pangoterm:
+  *   
http://bazaar.launchpad.net/~leonerd/pangoterm/trunk/view/head:/main.c#L134
+  *   Also get the NL behavior from there.
   * - do not store terminal window in viminfo.  Or prefix term:// ?
   * - add a character in :ls output
   * - add 't' to mode()
***
*** 64,70 
   * - support minimal size when 'termsize' is "rows*cols".
   * - support minimal size when 'termsize' is empty?
   * - implement "term" for job_start(): more job options when starting a
!  *   terminal.
   * - support ":term NONE" to open a terminal with a pty but not running a job
   *   in it.  The pty can be passed to gdb to run the executable in.
   * - if the job in the terminal does not support the mouse, we can use the
--- 67,74 
   * - support minimal size when 'termsize' is "rows*cols".
   * - support minimal size when 'termsize' is empty?
   * - implement "term" for job_start(): more job options when starting a
!  *   terminal.  Might allow reading stdin from a file or buffer, sending 
stderr
!  *   to a file or /dev/null, but something must be connected to the terminal.
   * - support ":term NONE" to open a terminal with a pty but not running a job
   *   in it.  The pty can be passed to gdb to run the executable in.
   * - if the job in the terminal does not support the mouse, we can use the
***
*** 862,867 
--- 866,873 
  
  /*
   * Send keys to terminal.
+  * Return FAIL when the key needs to be handled in Normal mode.
+  * Return OK when the key was dropped or sent to the terminal.
   */
  static int
  send_keys_to_term(term_T *term, int c, int typed)
***
*** 1038,1044 
mch_stop_job(curbuf->b_term->tl_job, (char_u *)"quit");
  #endif
  
!   if (c == (termkey == 0 ? Ctrl_W : termkey))
{
int prev_c = c;
  
--- 1044,1050 
mch_stop_job(curbuf->b_term->tl_job, (char_u *)"quit");
  #endif
  
!   if (c == (termkey == 0 ? Ctrl_W : termkey) || c == Ctrl_BSL)
{
int prev_c = c;
  
***
*** 1054,1060 
/* job finished while waiting for a character */
break;
  
!   if (termkey == 0 && c == '.')
{
/* "CTRL-W .": send CTRL-W to the job */
c = Ctrl_W;
--- 1060,1074 
/* job finished while waiting for a character */
break;
  
!   if (prev_c == Ctrl_BSL)
!   {
!   if (c == Ctrl_N)
!   /* CTRL-\ CTRL-N : execute one Normal mode command. */
!   return OK;
!   /* Send both keys to the terminal. */
!   send_keys_to_term(curbuf->b_term, prev_c, TRUE);
!   }
!   else if (termkey == 0 && c == '.')
{
/* "CTRL-W .": send CTRL-W to the job */
c = Ctrl_W;
*** ../vim-8.0.0862/runtime/doc/terminal.txt2017-07-30 16:51:35.630143954 
+0200
--- runtime/doc/terminal.txt2017-08-05 14:07:41.843441746 +0200
***
*** 1,4 
! *terminal.txt*For Vim version 8.0.  Last change: 2017 Jul 30
  
  
  VIM REFERENCE MANUALby Bram Moolenaar
--- 1,4 
! *terminal.txt*For Vim version 8.0.  Last change: 2017 Aug 05
  
  
  VIM REFERENCE MANUALby Bram Moolenaar
***
*** 48,53 
--- 48,56 
  Special in the terminal window:   *CTRL-W_.*  *CTRL-W_N* 
CTRL-W .send a CTRL-W to the job in the terminal
CTRL-W Ngo to Terminal Normal mode, see |Terminal-mode|
+   CTRL-W " {reg}  paste register {reg}*CTRL-W_quote*
+   Also works with the = register to insert the result of
+   evaluating an expression.
  
  See option 'termkey' for specifying another key instead of CTRL-W that
  will work like CTRL-W.  However, typing 'termkey' twice sends 'termkey' to
***
*** 58,63 
--- 61,71 
'termkey' . send a CTRL-W to the job in the terminal
'termkey' N go to terminal Normal mode, see below
'termkey' CTRL-Nsame as CTRL-W N
+   *t_CTRL-\_CTRL-N*
+ The special key 

Re: For issue #1665, here is the vim-monokai

2017-08-05 Fir de Conversatie Bram Moolenaar

Xia Crusoe wrote:

> According to #1665 chrisbra asked me to send this file to you. I'm
> really glad that since years I loved Vim and finally can do something
> for it. vim-monokai uses the MIT license so feel free to use it.

Thanks.  I'm making a list and will decide later what to include.

-- 
MESKIMEN'S LAW
There's never time to do it right, but always time to do it over.

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


Trouble with autoloaded self functions in dict

2017-08-05 Fir de Conversatie Björn Linse

Place the following in the autoload path:

function dictautotest#doit() dict
endfunction

And the following in a separate test script:

let mydict = { 'doit': function('dictautotest#doit') }
let Mypartial = mydict.doit
call Mypartial()

This script will fail first time it is run. The reason is at partial 
construction time, the function will not be autoloaded, and treated by default 
as a non-dict function, and thus the partial will not store the self dict. 
However at call time the function is loaded, and suddenly treated as a dict 
function, and now vim complains that the function is called without Dictionary, 
because the partial lacks the self attribute.

Either the partial construction code should probably autoload the function, or 
somehow construct it as a "maybe-self" partial, that silently will discard the 
self if it turned out not to be a dict function.

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