Patch 8.1.1675
Problem:    Listener list not correctly updated on listener_remove().
Solution:   Only set "prev" when not removing a listener.  Return one if the
            listener was found and removed.
Files:      src/change.c


*** ../vim-8.1.1674/src/change.c        2019-06-08 18:07:17.744161734 +0200
--- src/change.c        2019-07-13 12:56:08.925257292 +0200
***************
*** 325,339 ****
   * listener_remove() function
   */
      void
! f_listener_remove(typval_T *argvars, typval_T *rettv UNUSED)
  {
      listener_T        *lnr;
      listener_T        *next;
!     listener_T        *prev = NULL;
      int               id = tv_get_number(argvars);
      buf_T     *buf;
  
      for (buf = firstbuf; buf != NULL; buf = buf->b_next)
        for (lnr = buf->b_listener; lnr != NULL; lnr = next)
        {
            next = lnr->lr_next;
--- 325,341 ----
   * listener_remove() function
   */
      void
! f_listener_remove(typval_T *argvars, typval_T *rettv)
  {
      listener_T        *lnr;
      listener_T        *next;
!     listener_T        *prev;
      int               id = tv_get_number(argvars);
      buf_T     *buf;
  
      for (buf = firstbuf; buf != NULL; buf = buf->b_next)
+     {
+       prev = NULL;
        for (lnr = buf->b_listener; lnr != NULL; lnr = next)
        {
            next = lnr->lr_next;
***************
*** 345,353 ****
--- 347,358 ----
                    buf->b_listener = lnr->lr_next;
                free_callback(&lnr->lr_callback);
                vim_free(lnr);
+               rettv->vval.v_number = 1;
+               return;
            }
            prev = lnr;
        }
+     }
  }
  
  /*
*** ../vim-8.1.1674/src/version.c       2019-07-12 22:46:26.423091651 +0200
--- src/version.c       2019-07-13 12:57:08.033026455 +0200
***************
*** 779,780 ****
--- 779,782 ----
  {   /* Add new patch number below this line */
+ /**/
+     1675,
  /**/

-- 
ARTHUR: Listen, old crone!  Unless you tell us where we can buy a shrubbery,
        my friend and I will ... we will say "Ni!"
CRONE:  Do your worst!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201907131104.x6DB4OtC021819%40masaka.moolenaar.net.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui