Yegappan Lakshmanan | 29 May 05:34 2016

[vim/vim] Not able to use a function reference as the job exit callback (#839)

Not able to use a function reference to set the exit_cb of a job. Other job
callback functions can be set using function references.

Use get_callback() instead of get_tv_string_buf_chk() to set the job exit_cb.

You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/839

Commit Summary

  • Use get_callback() to set the job exit callback

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

--
--
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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Bram Moolenaar | 28 May 22:47 2016
Picon
Picon

Patch 7.4.1856


Patch 7.4.1856 (after 7.4.1855)
Problem:    failing job test fails on MS-Windows.
Solution:   Expect "fail" status instead of "dead".
Files:      src/testdir/test_partial.vim

*** ../vim-7.4.1855/src/testdir/test_partial.vim	2016-05-28 22:22:28.830213562 +0200
--- src/testdir/test_partial.vim	2016-05-28 22:43:30.530196207 +0200
***************
*** 254,265 ****
    if has('job')
      let job = job_start('axdfxsdf')
      for i in range(100)
!       if job_status(job) == 'dead'
  	break
        endif
        sleep 10m
      endfor
!     call assert_equal('dead', job_status(job))
      unlet job
    endif
  endfunc
--- 254,270 ----
    if has('job')
      let job = job_start('axdfxsdf')
      for i in range(100)
!       let status = job_status(job)
!       if status == 'dead' || status == 'fail'
  	break
        endif
        sleep 10m
      endfor
!     if has('unix')
!       call assert_equal('dead', job_status(job))
!     else
!       call assert_equal('fail', job_status(job))
!     endif
      unlet job
    endif
  endfunc
*** ../vim-7.4.1855/src/version.c	2016-05-28 22:22:28.834213562 +0200
--- src/version.c	2016-05-28 22:44:55.286195041 +0200
***************
*** 755,756 ****
--- 755,758 ----
  {   /* Add new patch number below this line */
+ /**/
+     1856,
  /**/

-- 
How To Keep A Healthy Level Of Insanity:
3. Every time someone asks you to do something, ask if they want fries
   with that.

 /// Bram Moolenaar -- Bram <at> 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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bram Moolenaar | 28 May 22:22 2016
Picon
Picon

Patch 7.4.1855


Patch 7.4.1855
Problem:    Valgrind reports memory leak for job that is not freed.
Solution:   Free all jobs on exit.  Add test for failing job.
Files:      src/channel.c, src/misc2.c, src/proto/channel.pro,
            src/testdir/test_partial.vim

*** ../vim-7.4.1854/src/channel.c	2016-05-28 14:16:05.290615005 +0200
--- src/channel.c	2016-05-28 21:10:42.582272798 +0200
***************
*** 1285,1290 ****
--- 1285,1291 ----
      int	    len = (int)STRLEN(line);
      char_u  *p;

+     /* Need to make a copy to be able to append a NL. */
      if ((p = alloc(len + 2)) == NULL)
  	return;
      STRCPY(p, line);
***************
*** 2888,2894 ****
  /*
   * Read from channel "channel" for as long as there is something to read.
   * "part" is PART_SOCK, PART_OUT or PART_ERR.
!  * The data is put in the read queue.
   */
      static void
  channel_read(channel_T *channel, int part, char *func)
--- 2889,2895 ----
  /*
   * Read from channel "channel" for as long as there is something to read.
   * "part" is PART_SOCK, PART_OUT or PART_ERR.
!  * The data is put in the read queue.  No callbacks are invoked here.
   */
      static void
  channel_read(channel_T *channel, int part, char *func)
***************
*** 4184,4189 ****
--- 4185,4199 ----
      }
  }

+ #if defined(EXITFREE) || defined(PROTO)
+     void
+ job_free_all(void)
+ {
+     while (first_job != NULL)
+ 	job_free(first_job);
+ }
+ #endif
+ 
  /*
   * Return TRUE if the job should not be freed yet.  Do not free the job when
   * it has not ended yet and there is a "stoponexit" flag, an exit callback
*** ../vim-7.4.1854/src/misc2.c	2016-03-28 19:16:15.665846533 +0200
--- src/misc2.c	2016-05-28 21:54:49.954236381 +0200
***************
*** 1127,1135 ****
  # ifdef FEAT_DIFF
      diff_clear(curtab);
  # endif
- # ifdef FEAT_JOB_CHANNEL
-     channel_free_all();
- # endif
      clear_sb_text();	      /* free any scrollback text */

      /* Free some global vars. */
--- 1127,1132 ----
***************
*** 1221,1226 ****
--- 1218,1227 ----
  # ifdef FEAT_EVAL
      eval_clear();
  # endif
+ # ifdef FEAT_JOB_CHANNEL
+     channel_free_all();
+     job_free_all();
+ # endif

      free_termoptions();

*** ../vim-7.4.1854/src/proto/channel.pro	2016-05-09 20:38:48.580112142 +0200
--- src/proto/channel.pro	2016-05-28 21:56:12.034235252 +0200
***************
*** 50,55 ****
--- 50,56 ----
  void free_job_options(jobopt_T *opt);
  int get_job_options(typval_T *tv, jobopt_T *opt, int supported);
  channel_T *get_channel_arg(typval_T *tv, int check_open, int reading, int part);
+ void job_free_all(void);
  int set_ref_in_job(int copyID);
  void job_unref(job_T *job);
  int free_unused_jobs_contents(int copyID, int mask);
*** ../vim-7.4.1854/src/testdir/test_partial.vim	2016-05-24 22:29:45.038961566 +0200
--- src/testdir/test_partial.vim	2016-05-28 22:17:17.030217851 +0200
***************
*** 250,255 ****
--- 250,269 ----
    endif
  endfunc

+ func Test_job_start_fails()
+   if has('job')
+     let job = job_start('axdfxsdf')
+     for i in range(100)
+       if job_status(job) == 'dead'
+ 	break
+       endif
+       sleep 10m
+     endfor
+     call assert_equal('dead', job_status(job))
+     unlet job
+   endif
+ endfunc
+ 
  func Test_ref_job_partial_dict()
    if has('job')
      let g:ref_job = job_start('echo')
*** ../vim-7.4.1854/src/version.c	2016-05-28 15:53:45.874534388 +0200
--- src/version.c	2016-05-28 22:17:58.406217282 +0200
***************
*** 755,756 ****
--- 755,758 ----
  {   /* Add new patch number below this line */
+ /**/
+     1855,
  /**/

-- 
How To Keep A Healthy Level Of Insanity:
2. Page yourself over the intercom. Don't disguise your voice.

 /// Bram Moolenaar -- Bram <at> 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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Yegappan Lakshmanan | 28 May 21:19 2016
Picon

Vim git cheat sheet

Hi all,

I was looking for a Git cheat sheet for a Vim developer last week.
I couldn't find one. I have put together the following list of commands
(just in case someone is looking for it in the future).

Fork the Vim repository
    1. Fork the Vim repository from the github WebUI
    2. Clone the Vim repository:
             $ cd <some-directory>
             $ git clone https://github.com/<your-name>/vim/vim.git
             $ cd vim
    3. Configure the upstream branch:
             $ git remote add --track master upstream
git://github.com/vim/vim.git
             $ git push origin master

Synchronizing a fork with the upstream
    $ git checkout master
    $ git fetch upstream
    $ git rebase upstream/master
    $ git push origin master

Creating a branch
    1. Clone the Vim repository:
            $ cd <some-directory>
            $ git clone https://github.com/<your-name>/vim/vim.git
    2. Create a child branch for the feature/bug fix:
            $ git checkout -b <child-branch-name>
    3. Push the new child branch to remote master:
            $ git push origin <child-branch-name>

Committing changes to a child branch
    1. Commit the changes:
             $ git commit -m "Commit comment"
    2. Push the changes to the child branch:
             $ git push origin <child-branch-name>

Creating a pull request
    Go to github.com and create a pull request for the child branch to submit
    the changes for merging into the main Vim repository

Synchronizing a branch with the master
    $ git checkout master
    $ git fetch upstream
    $ git rebase upstream/master
    $ git checkout <child-branch-name>
    $ git rebase master
    $ git push --force

Cloning a child branch
    $ cd <some-directory>
    $ git clone https://github.com/<your-name>/vim/vim.git
    $ git checkout <child-branch-name>

Pulling in latest changes from master
    $ git stash
    $ git pull
    $ git stash pop

Misc Commands
    $ git status
    $ git diff origin/master
    $ git log -v
    $ git branch

- Yegappan

-- 
--

-- 
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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bram Moolenaar | 28 May 15:54 2016
Picon
Picon

Patch 7.4.1854


Patch 7.4.1854
Problem:    When setting 'termguicolors' the Ignore highlighting doesn't work.
            (Charles Campbell)
Solution:   Handle the color names "fg" and "bg" when the GUI isn't running
            and no colors are speficied, fall back to black and white.
Files:      src/syntax.c

*** ../vim-7.4.1853/src/syntax.c	2016-05-01 13:09:53.862174566 +0200
--- src/syntax.c	2016-05-28 15:45:09.006541498 +0200
***************
*** 8486,8496 ****
  #ifdef FEAT_GUI
  	    return gui.norm_pixel;
  #endif
- #if defined(FEAT_TERMGUICOLORS) && defined(FEAT_GUI)
- 	else
- #endif
  #ifdef FEAT_TERMGUICOLORS
  	    return cterm_normal_fg_gui_color;
  #endif
      }
      if (STRICMP(name, "bg") == 0 || STRICMP(name, "background") == 0)
--- 8486,8496 ----
  #ifdef FEAT_GUI
  	    return gui.norm_pixel;
  #endif
  #ifdef FEAT_TERMGUICOLORS
+ 	if (cterm_normal_fg_gui_color != (long_u)INVALCOLOR)
  	    return cterm_normal_fg_gui_color;
+ 	/* Guess that the foreground is black or white. */
+ 	return GUI_GET_COLOR((char_u *)(*p_bg == 'l' ? "black" : "white"));
  #endif
      }
      if (STRICMP(name, "bg") == 0 || STRICMP(name, "background") == 0)
***************
*** 8501,8511 ****
  #ifdef FEAT_GUI
  	    return gui.back_pixel;
  #endif
- #if defined(FEAT_TERMGUICOLORS) && defined(FEAT_GUI)
- 	else
- #endif
  #ifdef FEAT_TERMGUICOLORS
  	    return cterm_normal_bg_gui_color;
  #endif
      }

--- 8501,8511 ----
  #ifdef FEAT_GUI
  	    return gui.back_pixel;
  #endif
  #ifdef FEAT_TERMGUICOLORS
+ 	if (cterm_normal_bg_gui_color != (long_u)INVALCOLOR)
  	    return cterm_normal_bg_gui_color;
+ 	/* Guess that the background is white or black. */
+ 	return GUI_GET_COLOR((char_u *)(*p_bg == 'l' ? "white" : "black"));
  #endif
      }

***************
*** 8595,8601 ****
  			    && aep->ae_u.cterm.bg_rgb
  						    == taep->ae_u.cterm.bg_rgb
  #endif
- 						
  		       )))

  	return i + ATTR_OFF;
--- 8595,8600 ----
*** ../vim-7.4.1853/src/version.c	2016-05-28 14:16:05.290615005 +0200
--- src/version.c	2016-05-28 15:52:59.014535033 +0200
***************
*** 755,756 ****
--- 755,758 ----
  {   /* Add new patch number below this line */
+ /**/
+     1854,
  /**/

-- 
If they don't keep on exercising their lips, he thought, their brains
start working.
		-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

 /// Bram Moolenaar -- Bram <at> 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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bram Moolenaar | 28 May 14:16 2016
Picon
Picon

Patch 7.4.1853


Patch 7.4.1853
Problem:    Crash when job and channel are in the same dict while using
            partials. (Luc Hermitte)
Solution:   Do not decrement the channel reference count too early.
Files:      src/channel.c

*** ../vim-7.4.1852/src/channel.c	2016-05-28 13:20:26.706660930 +0200
--- src/channel.c	2016-05-28 14:13:02.026617526 +0200
***************
*** 2566,2572 ****
  	      clear_tv(&rettv);
  	      channel_need_redraw = TRUE;
  	  }
- 	  --channel-≥ch_refcount;

  	  /* the callback is only called once */
  	  vim_free(channel->ch_close_cb);
--- 2566,2571 ----
***************
*** 2574,2579 ****
--- 2573,2580 ----
  	  partial_unref(channel->ch_close_partial);
  	  channel->ch_close_partial = NULL;

+ 	  --channel-≥ch_refcount;
+ 
  	  if (channel_need_redraw)
  	  {
  	      channel_need_redraw = FALSE;
*** ../vim-7.4.1852/src/version.c	2016-05-28 13:40:06.586644700 +0200
--- src/version.c	2016-05-28 14:15:25.286615555 +0200
***************
*** 755,756 ****
--- 755,758 ----
  {   /* Add new patch number below this line */
+ /**/
+     1853,
  /**/

-- 
For a moment, nothing happened.
Then, after a second or so, nothing continued to happen.
		-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

 /// Bram Moolenaar -- Bram <at> 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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bram Moolenaar | 28 May 13:40 2016
Picon
Picon

Patch 7.4.1852


Patch 7.4.1852
Problem:    Unix: Cannot run all tests with the GUI.
Solution:   Add the "testgui" target.
Files:      src/Makefile, src/testdir/Makefile

*** ../vim-7.4.1851/src/Makefile	2016-04-30 15:08:12.095333714 +0200
--- src/Makefile	2016-05-28 13:38:58.842645632 +0200
***************
*** 582,588 ****
  #CFLAGS = -g -O2 '-DSTARTUPTIME="vimstartup"' -fno-strength-reduce -Wall -Wmissing-prototypes

  # Use this with GCC to check for mistakes, unused arguments, etc.
! #CFLAGS = -g -Wall -Wextra -Wmissing-prototypes -Wunreachable-code -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
  #CFLAGS = -g -O2 -Wall -Wextra -Wmissing-prototypes -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DU_DEBUG
  #PYTHON_CFLAGS_EXTRA = -Wno-missing-field-initializers
  #MZSCHEME_CFLAGS_EXTRA = -Wno-unreachable-code -Wno-unused-parameter
--- 582,588 ----
  #CFLAGS = -g -O2 '-DSTARTUPTIME="vimstartup"' -fno-strength-reduce -Wall -Wmissing-prototypes

  # Use this with GCC to check for mistakes, unused arguments, etc.
! #CFLAGS = -g -Wall -Wextra -Wshadow -Wmissing-prototypes -Wunreachable-code -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
  #CFLAGS = -g -O2 -Wall -Wextra -Wmissing-prototypes -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DU_DEBUG
  #PYTHON_CFLAGS_EXTRA = -Wno-missing-field-initializers
  #MZSCHEME_CFLAGS_EXTRA = -Wno-unreachable-code -Wno-unused-parameter
***************
*** 1943,1948 ****
--- 1943,1952 ----
  	cd testdir; $(MAKE) -f Makefile $(GUI_TESTTARGET) VIMPROG=../$(VIMTARGET) $(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
  	$(MAKE) -f Makefile unittest

+ # Run the tests with the GUI.  Assumes vim/gvim was already built
+ testgui:
+ 	cd testdir; $(MAKE) -f Makefile $(GUI_TESTTARGET) VIMPROG=../$(VIMTARGET) GUI_FLAG=-g
$(GUI_TESTARG) SCRIPTSOURCE=../$(SCRIPTSOURCE)
+ 
  benchmark:
  	cd testdir; $(MAKE) -f Makefile benchmark VIMPROG=../$(VIMTARGET) SCRIPTSOURCE=../$(SCRIPTSOURCE)

***************
*** 2057,2062 ****
--- 2061,2067 ----
  	test_viminfo \
  	test_viml \
  	test_visual \
+ 	test_window_cmd \
  	test_window_id \
  	test_alot_latin \
  	test_alot_utf8 \
*** ../vim-7.4.1851/src/testdir/Makefile	2016-02-25 21:21:47.985840901 +0100
--- src/testdir/Makefile	2016-05-28 13:31:32.750651768 +0200
***************
*** 12,18 ****
  #   The output goes into a file "valgrind.testN"
  #   Vim should be compiled with EXITFREE to avoid false warnings.
  #   This will make testing about 10 times as slow.
! # VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=15 --log-file=valgrind.$*

  default: nongui

--- 12,18 ----
  #   The output goes into a file "valgrind.testN"
  #   Vim should be compiled with EXITFREE to avoid false warnings.
  #   This will make testing about 10 times as slow.
! # VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=25 --log-file=valgrind.$*

  default: nongui

***************
*** 52,58 ****

  RM_ON_RUN = test.out X* viminfo
  RM_ON_START = tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim test.ok benchmark.out
! RUN_VIM = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(VIMPROG) -f -u unix.vim
$(NO_PLUGIN) -s dotest.in

  clean:
  	-rm -rf *.out *.failed *.res *.rej *.orig test.log messages $(RM_ON_RUN) $(RM_ON_START) valgrind.*
--- 52,58 ----

  RM_ON_RUN = test.out X* viminfo
  RM_ON_START = tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim test.ok benchmark.out
! RUN_VIM = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(VIMPROG) -f $(GUI_FLAG) -u
unix.vim $(NO_PLUGIN) -s dotest.in

  clean:
  	-rm -rf *.out *.failed *.res *.rej *.orig test.log messages $(RM_ON_RUN) $(RM_ON_START) valgrind.*
***************
*** 118,124 ****
  # New style of tests uses Vim script with assert calls.  These are easier
  # to write and a lot easier to read and debug.
  # Limitation: Only works with the +eval feature.
! RUN_VIMTEST = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(VIMPROG) -f -u unix.vim $(NO_PLUGIN)

  newtests: newtestssilent
  	 <at> /bin/sh -c "if test -f messages && grep -q 'FAILED' messages; then cat messages && cat test.log; fi"
--- 118,124 ----
  # New style of tests uses Vim script with assert calls.  These are easier
  # to write and a lot easier to read and debug.
  # Limitation: Only works with the +eval feature.
! RUN_VIMTEST = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND) $(VIMPROG) -f
$(GUI_FLAG) -u unix.vim $(NO_PLUGIN)

  newtests: newtestssilent
  	 <at> /bin/sh -c "if test -f messages && grep -q 'FAILED' messages; then cat messages && cat test.log; fi"
*** ../vim-7.4.1851/src/version.c	2016-05-28 13:28:06.330654608 +0200
--- src/version.c	2016-05-28 13:38:30.554646021 +0200
***************
*** 755,756 ****
--- 755,758 ----
  {   /* Add new patch number below this line */
+ /**/
+     1852,
  /**/

-- 
Far out in the uncharted backwaters of the unfashionable end of the
Western Spiral arm of the Galaxy lies a small unregarded yellow sun.
Orbiting this at a distance of roughly ninety-eight million miles is an
utterly insignificant little blue-green planet whose ape-descended life
forms are so amazingly primitive that they still think digital watches
are a pretty neat idea ...
		-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

 /// Bram Moolenaar -- Bram <at> 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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bram Moolenaar | 28 May 13:28 2016
Picon
Picon

Patch 7.4.1851


Patch 7.4.1851
Problem:    test_syn_attr failes when using the GUI. (Dominique Pelle)
Solution:   Escape the font name properly.
Files:      src/testdir/test_syn_attr.vim

*** ../vim-7.4.1850/src/testdir/test_syn_attr.vim	2016-03-12 20:15:17.636359015 +0100
--- src/testdir/test_syn_attr.vim	2016-05-28 13:26:49.466655665 +0200
***************
*** 27,33 ****
      if fontname == ''
        let fontname = 'something'
      endif
!     exe 'hi Mine guifg=blue guibg=red font=' . escape(fontname, ' \')
      call assert_equal('blue', synIDattr(hlID("Mine"), "fg", 'gui'))
      call assert_equal('red', synIDattr(hlID("Mine"), "bg", 'gui'))
      call assert_equal(fontname, synIDattr(hlID("Mine"), "font", 'gui'))
--- 27,33 ----
      if fontname == ''
        let fontname = 'something'
      endif
!     exe "hi Mine guifg=blue guibg=red font='" . fontname . "'"
      call assert_equal('blue', synIDattr(hlID("Mine"), "fg", 'gui'))
      call assert_equal('red', synIDattr(hlID("Mine"), "bg", 'gui'))
      call assert_equal(fontname, synIDattr(hlID("Mine"), "font", 'gui'))
*** ../vim-7.4.1850/src/version.c	2016-05-28 13:20:26.710660930 +0200
--- src/version.c	2016-05-28 13:27:05.538655444 +0200
***************
*** 755,756 ****
--- 755,758 ----
  {   /* Add new patch number below this line */
+ /**/
+     1851,
  /**/

-- 
Far back in the mists of ancient time, in the great and glorious days of the
former Galactic Empire, life was wild, rich and largely tax free.
Mighty starships plied their way between exotic suns, seeking adventure and
reward among the furthest reaches of Galactic space.  In those days, spirits
were brave, the stakes were high, men were real men, women were real women
and small furry creatures from Alpha Centauri were real small furry creatures
from Alpha Centauri.  And all dared to brave unknown terrors, to do mighty
deeds, to boldly split infinitives that no man had split before -- and thus
was the Empire forged.
		-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

 /// Bram Moolenaar -- Bram <at> 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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bram Moolenaar | 28 May 13:22 2016
Picon
Picon

Re: [vim/vim] Vim 7.4.1826 breaks channel feature on GVim (#838)


Dominique Pellé wrote:

> > > After 7.4.1826, GVim freezes if use channel/job feature.
> > > I have detected it using "git bisect" command.
> > > It cannot reproduce on console Vim.
> > > I can reproduce it in Vim 7.4.1848.
> > >
> > > I think it is the same issue with it.
> > > https://groups.google.com/d/msg/vim_dev/LlSrz0w8xzk/tQ4ph8OnHwAJ
> >
> > Is there a simple way to reproduce this?
> 
> I can reproduce it when running tests after changing the
> vim/src/testdir/Makefile so that all tests run gvim as follows:
> 
> 
> diff --git a/src/testdir/Makefile b/src/testdir/Makefile
> index 49a817a..6198ccd 100644
> --- a/src/testdir/Makefile
> +++ b/src/testdir/Makefile
>  <at>  <at>  -52,7 +52,7  <at>  <at>  $(SCRIPTS) $(SCRIPTS_GUI) $(NEW_TESTS): $(SCRIPTS_FIRST)
> 
>  RM_ON_RUN = test.out X* viminfo
>  RM_ON_START = tiny.vim small.vim mbyte.vim mzscheme.vim lua.vim
> test.ok benchmark.out
> -RUN_VIM = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND)
> $(VIMPROG) -f -u unix.vim $(NO_PLUGIN) -s dotest.in
> +RUN_VIM = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME; $(VALGRIND)
> $(VIMPROG) -f -g -u unix.vim $(NO_PLUGIN) -s dotest.in
> 
>  clean:
>         -rm -rf *.out *.failed *.res *.rej *.orig test.log messages
> $(RM_ON_RUN) $(RM_ON_START) valgrind.*
>  <at>  <at>  -118,7 +118,7  <at>  <at>  nolog:
>  # New style of tests uses Vim script with assert calls.  These are easier
>  # to write and a lot easier to read and debug.
>  # Limitation: Only works with the +eval feature.
> -RUN_VIMTEST = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME;
> $(VALGRIND) $(VIMPROG) -f -u unix.vim $(NO_PLUGIN)
> +RUN_VIMTEST = VIMRUNTIME=$(SCRIPTSOURCE); export VIMRUNTIME;
> $(VALGRIND) $(VIMPROG) -f -g -u unix.vim $(NO_PLUGIN)
> 
>  newtests: newtestssilent
>          <at> /bin/sh -c "if test -f messages && grep -q 'FAILED' messages;
> then cat messages && cat test.log; fi"
> 
> 
> The this hangs and shows:
> 
> "test_channel.vim" 1311 lines, 36597 characters
> Executing Test_call()
> Executing Test_channel_handler()
> 
> 
> I tried vim-7.4.1748 and vim-7.4.1449 (gtk2) and both hang.
> 
> 
> > I sent out 7.4.1849, but I don't know if this fixes the problem.
> 
> It does not fix it.
> 
> 
> > Another thing, since this apparently only fails in the GUI,
> > would be to call channel_gui_unregister() right away, when setting
> > ch_to_be_closed. Perhaps you can try this patch:
> >
> > *** ../vim-7.4.1849/src/channel.c 2016-05-27 19:59:43.823519882 +0200
> > --- src/channel.c 2016-05-27 21:34:17.451441836 +0200
> > ***************
> > *** 2868,2873 ****
> > --- 2868,2878 ----
> > * died. Don't close the channel right away, it may be the wrong moment
> > * to invoke callbacks. */
> > channel->ch_to_be_closed = TRUE;
> > +
> > + /* Stop listening to GUI events right away. */
> > + #ifdef FEAT_GUI
> > + channel_gui_unregister(channel);
> > + #endif
> > }
> >
> > static void
> 
> With that patch, the test no longer hang.

I'm glad I could guess the problem.  I'll send out that patch.

> However, when I run all tests, I see this (using
> modified src/testdir/Makefile to run all tests with gvim):
> 
> === BEGIN QUOTE ===
> >From test_alot.vim:
> Found errors in Test_missing_attr():
> Caught exception in Test_missing_attr(): Vim(highlight):E416: missing
> equal sign: 10  <at>  function RunTheTest[9]..Test_missing_attr, line 27
> TEST FAILURE
> make: *** [report] Error 1
> === END QUOTE ===
> 
> If I run tests in the terminal  (canceling my change to
> src/testdir/Makefile) then all test pass.

That's a separate problem.  Escaping the font name isn't done properly.

-- 
Don't Panic!
		-- The Hitchhiker's Guide to the Galaxy

 /// Bram Moolenaar -- Bram <at> 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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bram Moolenaar | 28 May 13:20 2016
Picon
Picon

Patch 7.4.1850


Patch 7.4.1850
Problem:    GUI freezes when using a job. (Shougo)
Solution:   Unregister the channel when there is an input error.
Files:      src/channel.c

*** ../vim-7.4.1849/src/channel.c	2016-05-27 19:59:43.823519882 +0200
--- src/channel.c	2016-05-28 13:10:38.622669020 +0200
***************
*** 2868,2873 ****
--- 2868,2878 ----
       * died.  Don't close the channel right away, it may be the wrong moment
       * to invoke callbacks. */
      channel->ch_to_be_closed = TRUE;
+ 
+ #ifdef FEAT_GUI
+     /* Stop listening to GUI events right away. */
+     channel_gui_unregister(channel);
+ #endif
  }

      static void
*** ../vim-7.4.1849/src/version.c	2016-05-27 19:59:43.823519882 +0200
--- src/version.c	2016-05-28 13:19:58.846661313 +0200
***************
*** 755,756 ****
--- 755,758 ----
  {   /* Add new patch number below this line */
+ /**/
+     1850,
  /**/

-- 
Bypasses are devices that allow some people to dash from point A to
point B very fast while other people dash from point B to point A very
fast.  People living at point C, being a point directly in between, are
often given to wonder what's so great about point A that so many people
from point B are so keen to get there and what's so great about point B
that so many people from point A are so keen to get there.  They often
wish that people would just once and for all work out where the hell
they wanted to be.
		-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

 /// Bram Moolenaar -- Bram <at> 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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bram Moolenaar | 27 May 20:00 2016
Picon
Picon

Patch 7.4.1849


Patch 7.4.1849
Problem:    Still trying to read from channel that is going to be closed.
            (Ramel Eshed)
Solution:   Check if ch_to_be_closed is set.
Files:      src/channel.c

*** ../vim-7.4.1848/src/channel.c	2016-05-25 21:48:07.397807422 +0200
--- src/channel.c	2016-05-27 19:53:16.391525211 +0200
***************
*** 2893,2898 ****
--- 2893,2902 ----
      sock_T		fd;
      int			use_socket = FALSE;

+     /* If we detected a read error don't try reading again. */
+     if (channel->ch_to_be_closed)
+ 	return;
+ 
      fd = channel->ch_part[part].ch_fd;
      if (fd == INVALID_FD)
      {
***************
*** 3193,3198 ****
--- 3197,3206 ----

      for (channel = first_channel; channel != NULL; channel = channel->ch_next)
      {
+ 	/* If we detected a read error don't try reading again. */
+ 	if (channel->ch_to_be_closed)
+ 	    continue;
+ 
  	/* check the socket and pipes */
  	for (part = PART_SOCK; part <= PART_ERR; ++part)
  	{
*** ../vim-7.4.1848/src/version.c	2016-05-26 22:09:56.088600919 +0200
--- src/version.c	2016-05-27 19:54:47.207523962 +0200
***************
*** 755,756 ****
--- 755,758 ----
  {   /* Add new patch number below this line */
+ /**/
+     1849,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
20. When looking at a pageful of someone else's links, you notice all of them
    are already highlighted in purple.

 /// Bram Moolenaar -- Bram <at> 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+unsubscribe <at> googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Gmane