Patch 8.1.2307
Problem:    Positioning popup doesn't work for buffer-local textprop.
Solution:   Make it work. (closes #5225)
Files:      src/popupwin.c, src/testdir/test_popupwin_textprop.vim


*** ../vim-8.1.2306/src/popupwin.c      2019-11-16 18:21:57.990848019 +0100
--- src/popupwin.c      2019-11-16 20:01:36.578171590 +0100
***************
*** 452,475 ****
        wp->w_popup_prop_type = 0;
        if (*str != NUL)
        {
!           nr = find_prop_type_id(str, wp->w_buffer);
            if (nr <= 0)
                nr = find_prop_type_id(str, NULL);
            if (nr <= 0)
                semsg(_(e_invarg2), str);
            else
-           {
                wp->w_popup_prop_type = nr;
-               wp->w_popup_prop_win = curwin;
- 
-               di = dict_find(d, (char_u *)"textpropwin", -1);
-               if (di != NULL)
-               {
-                   wp->w_popup_prop_win = find_win_by_nr_or_id(&di->di_tv);
-                   if (win_valid(wp->w_popup_prop_win))
-                       wp->w_popup_prop_win = curwin;
-               }
-           }
        }
      }
  
--- 452,473 ----
        wp->w_popup_prop_type = 0;
        if (*str != NUL)
        {
!           wp->w_popup_prop_win = curwin;
!           di = dict_find(d, (char_u *)"textpropwin", -1);
!           if (di != NULL)
!           {
!               wp->w_popup_prop_win = find_win_by_nr_or_id(&di->di_tv);
!               if (!win_valid(wp->w_popup_prop_win))
!                   wp->w_popup_prop_win = curwin;
!           }
! 
!           nr = find_prop_type_id(str, wp->w_popup_prop_win->w_buffer);
            if (nr <= 0)
                nr = find_prop_type_id(str, NULL);
            if (nr <= 0)
                semsg(_(e_invarg2), str);
            else
                wp->w_popup_prop_type = nr;
        }
      }
  
*** ../vim-8.1.2306/src/testdir/test_popupwin_textprop.vim      2019-08-29 
20:01:42.582771699 +0200
--- src/testdir/test_popupwin_textprop.vim      2019-11-16 20:02:46.809456487 
+0100
***************
*** 13,22 ****
        50
        normal zz
        set scrolloff=0
!       call prop_type_add('popupMarker', #{highlight: 'DiffAdd'})
        call prop_add(50, 11, #{
                \ length: 7,
                \ type: 'popupMarker',
                \ })
        let winid = popup_create('the text', #{
              \ pos: 'botleft', 
--- 13,23 ----
        50
        normal zz
        set scrolloff=0
!       call prop_type_add('popupMarker', #{highlight: 'DiffAdd', bufnr: 
bufnr('%')})
        call prop_add(50, 11, #{
                \ length: 7,
                \ type: 'popupMarker',
+               \ bufnr: bufnr('%'),
                \ })
        let winid = popup_create('the text', #{
              \ pos: 'botleft', 
***************
*** 68,73 ****
--- 69,75 ----
        let winid = popup_create('bottom left', #{
              \ pos: 'botleft', 
              \ textprop: 'popupMarker',
+             \ textpropwin: win_getid(),
              \ padding: [0,1,0,1],
              \ })
        let winid = popup_create('bottom right', #{
*** ../vim-8.1.2306/src/version.c       2019-11-16 18:57:12.577165165 +0100
--- src/version.c       2019-11-16 19:49:28.540787736 +0100
***************
*** 743,744 ****
--- 743,746 ----
  {   /* Add new patch number below this line */
+ /**/
+     2307,
  /**/

-- 
>From "know your smileys":
 (:-#   Said something he shouldn't have

 /// 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/201911161903.xAGJ3vEV022913%40masaka.moolenaar.net.

Raspunde prin e-mail lui