Patch 8.2.1193
Problem:    Terminal window not redrawn when dragging a popup window over it.
Solution:   Redraw terminal window. (fixes #6438)
Files:      src/popupwin.c, src/testdir/test_popupwin.vim,
            src/testdir/dumps/Test_popupwin_term_01.dump,
            src/testdir/dumps/Test_popupwin_term_02.dump


*** ../vim-8.2.1192/src/popupwin.c      2020-06-27 18:06:42.152575113 +0200
--- src/popupwin.c      2020-07-12 19:21:40.532826645 +0200
***************
*** 3504,3525 ****
                        wp = mouse_find_win(&line_cp, &col_cp, IGNORE_POPUP);
                        if (wp != NULL)
                        {
!                           if (wp != prev_wp)
!                           {
!                               vim_memset(plines_cache, 0, sizeof(int) * Rows);
!                               prev_wp = wp;
!                           }
! 
!                           if (line_cp >= wp->w_height)
!                               // In (or below) status line
!                               wp->w_redr_status = TRUE;
                            else
                            {
!                               // compute the position in the buffer line from
!                               // the position in the window
!                               mouse_comp_pos(wp, &line_cp, &col_cp,
                                                          &lnum, plines_cache);
!                               redrawWinline(wp, lnum);
                            }
  
                            // This line is going to be redrawn, no need to
--- 3504,3532 ----
                        wp = mouse_find_win(&line_cp, &col_cp, IGNORE_POPUP);
                        if (wp != NULL)
                        {
!                           // A terminal window needs to be redrawn.
!                           if (bt_terminal(wp->w_buffer))
!                               redraw_win_later(wp, NOT_VALID);
                            else
                            {
!                               if (wp != prev_wp)
!                               {
!                                   vim_memset(plines_cache, 0,
!                                                          sizeof(int) * Rows);
!                                   prev_wp = wp;
!                               }
! 
!                               if (line_cp >= wp->w_height)
!                                   // In (or below) status line
!                                   wp->w_redr_status = TRUE;
!                               else
!                               {
!                                   // compute the position in the buffer line
!                                   // from the position in the window
!                                   mouse_comp_pos(wp, &line_cp, &col_cp,
                                                          &lnum, plines_cache);
!                                   redrawWinline(wp, lnum);
!                               }
                            }
  
                            // This line is going to be redrawn, no need to
*** ../vim-8.2.1192/src/testdir/test_popupwin.vim       2020-06-26 
20:41:35.628844696 +0200
--- src/testdir/test_popupwin.vim       2020-07-12 19:19:40.509198063 +0200
***************
*** 577,582 ****
--- 577,616 ----
    call delete('XtestPopupDrag')
  endfunc
  
+ func Test_popup_drag_termwin()
+   CheckUnix
+   CheckScreendump
+   CheckFeature terminal
+ 
+   " create a popup that covers the terminal window
+   let lines =<< trim END
+       set shell=/bin/sh noruler
+         terminal
+       $wincmd w
+       let winid = popup_create(['1111', '2222'], #{
+             \ drag: 1,
+             \ resize: 1,
+             \ border: [],
+             \ line: 3,
+             \ })
+       func Dragit()
+         call feedkeys("\<F3>\<LeftMouse>\<F4>\<LeftDrag>\<LeftRelease>", "xt")
+       endfunc
+       map <silent> <F3> :call test_setmouse(3, &columns / 2)<CR>
+       map <silent> <F4> :call test_setmouse(3, &columns / 2 - 20)<CR>
+   END
+   call writefile(lines, 'XtestPopupTerm')
+   let buf = RunVimInTerminal('-S XtestPopupTerm', #{rows: 10})
+   call VerifyScreenDump(buf, 'Test_popupwin_term_01', {})
+ 
+   call term_sendkeys(buf, ":call Dragit()\<CR>")
+   call VerifyScreenDump(buf, 'Test_popupwin_term_02', {})
+ 
+   " clean up
+   call StopVimInTerminal(buf)
+   call delete('XtestPopupTerm')
+ endfunc
+ 
  func Test_popup_close_with_mouse()
    CheckScreendump
  
*** ../vim-8.2.1192/src/testdir/dumps/Test_popupwin_term_01.dump        
2020-07-12 19:23:33.980645252 +0200
--- src/testdir/dumps/Test_popupwin_term_01.dump        2020-07-12 
19:19:47.545167619 +0200
***************
*** 0 ****
--- 1,10 ----
+ |$+0&#ffffff0| @73
+ @75
+ @34|╔+0#0000001#ffd7ff255|═@3|╗| +0#0000000#ffffff0@34
+ @34|║+0#0000001#ffd7ff255|1@3|║| +0#0000000#ffffff0@34
+ |!+0#ffffff16#00e0003|/|b|i|n|/|s|h| |[|r|u|n@1|i|n|g|]| 
@15|║+0#0000001#ffd7ff255|2@3|║| +0#ffffff16#00e0003@34
+ > +0#0000000#ffffff0@33|╚+0#0000001#ffd7ff255|═@3|⇲| +0#0000000#ffffff0@34
+ |~+0#4040ff13&| @73
+ |~| @73
+ |[+3#0000000&|N|o| |N|a|m|e|]| @65
+ | +0&&@74
*** ../vim-8.2.1192/src/testdir/dumps/Test_popupwin_term_02.dump        
2020-07-12 19:23:33.984645245 +0200
--- src/testdir/dumps/Test_popupwin_term_02.dump        2020-07-12 
19:19:48.593163085 +0200
***************
*** 0 ****
--- 1,10 ----
+ |$+0&#ffffff0| @73
+ @75
+ @14|╔+0#0000001#ffd7ff255|═@3|╗| +0#0000000#ffffff0@54
+ @14|║+0#0000001#ffd7ff255|1@3|║| +0#0000000#ffffff0@54
+ |!+0#ffffff16#00e0003|/|b|i|n|/|s|h| |[|r|u|n@1|║+0#0000001#ffd7ff255|2@3|║| 
+0#ffffff16#00e0003@54
+ > +0#0000000#ffffff0@13|╚+0#0000001#ffd7ff255|═@3|⇲| +0#0000000#ffffff0@54
+ |~+0#4040ff13&| @73
+ |~| @73
+ |[+3#0000000&|N|o| |N|a|m|e|]| @65
+ |:+0&&|c|a|l@1| |D|r|a|g|i|t|(|)| @60
*** ../vim-8.2.1192/src/version.c       2020-07-12 18:33:49.597789885 +0200
--- src/version.c       2020-07-12 19:18:21.989538030 +0200
***************
*** 756,757 ****
--- 756,759 ----
  {   /* Add new patch number below this line */
+ /**/
+     1193,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
16. You step out of your room and realize that your parents have moved and
    you don't have a clue when it happened.

 /// 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/202007121724.06CHOee52546462%40masaka.moolenaar.net.

Raspunde prin e-mail lui