Patch 8.1.2037
Problem:    Can call win_gotoid() in cmdline window.
Solution:   Disallow switching windows. (Yasuhiro Matsumoto, closes #4940)
Files:      src/evalwindow.c, src/testdir/test_cmdline.vim


*** ../vim-8.1.2036/src/evalwindow.c    2019-09-10 21:22:54.876629189 +0200
--- src/evalwindow.c    2019-09-15 17:22:50.801391236 +0200
***************
*** 50,71 ****
      return 0;
  }
  
-     static int
- win_gotoid(typval_T *argvars)
- {
-     win_T     *wp;
-     tabpage_T   *tp;
-     int               id = tv_get_number(&argvars[0]);
- 
-     FOR_ALL_TAB_WINDOWS(tp, wp)
-           if (wp->w_id == id)
-           {
-               goto_tabpage_win(tp, wp);
-               return 1;
-           }
-     return 0;
- }
- 
      static void
  win_id2tabwin(typval_T *argvars, list_T *list)
  {
--- 50,55 ----
***************
*** 705,711 ****
      void
  f_win_gotoid(typval_T *argvars, typval_T *rettv)
  {
!     rettv->vval.v_number = win_gotoid(argvars);
  }
  
  /*
--- 689,712 ----
      void
  f_win_gotoid(typval_T *argvars, typval_T *rettv)
  {
!     win_T     *wp;
!     tabpage_T   *tp;
!     int               id = tv_get_number(&argvars[0]);
! 
! #ifdef FEAT_CMDWIN
!     if (cmdwin_type != 0)
!     {
!       emsg(_(e_cmdwin));
!       return;
!     }
! #endif
!     FOR_ALL_TAB_WINDOWS(tp, wp)
!       if (wp->w_id == id)
!       {
!           goto_tabpage_win(tp, wp);
!           rettv->vval.v_number = 1;
!           return;
!       }
  }
  
  /*
*** ../vim-8.1.2036/src/testdir/test_cmdline.vim        2019-09-09 
18:35:28.119252725 +0200
--- src/testdir/test_cmdline.vim        2019-09-15 17:22:07.685540144 +0200
***************
*** 734,736 ****
--- 734,746 ----
  
    let &encoding = encoding_save
  endfunc
+ 
+ func Test_cmdwin_bug()
+   let winid = win_getid()
+   sp
+   try
+     call feedkeys("q::call win_gotoid(" .. winid .. ")\<CR>:q\<CR>", 'x!')
+   catch /^Vim\%((\a\+)\)\=:E11/
+   endtry
+   bw!
+ endfunc
*** ../vim-8.1.2036/src/version.c       2019-09-15 14:49:49.149286479 +0200
--- src/version.c       2019-09-15 16:56:50.982443502 +0200
***************
*** 759,760 ****
--- 759,762 ----
  {   /* Add new patch number below this line */
+ /**/
+     2037,
  /**/

-- 
Two fish in a tank. One says to the other:
"Do you know how to drive this thing?"

 /// 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201909151527.x8FFRDO0005752%40masaka.moolenaar.net.

Raspunde prin e-mail lui