diff src/popupwin.c @ 18629:15fe2bd478b0 v8.1.2307

patch 8.1.2307: positioning popup doesn't work for buffer-local textprop Commit: https://github.com/vim/vim/commit/a37cb55da6ba44c5e85a22b03a91e1b663aceddf Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 16 20:03:31 2019 +0100 patch 8.1.2307: positioning popup doesn't work for buffer-local textprop Problem: Positioning popup doesn't work for buffer-local textprop. Solution: Make it work. (closes https://github.com/vim/vim/issues/5225)
author Bram Moolenaar <Bram@vim.org>
date Sat, 16 Nov 2019 20:15:03 +0100
parents 3089b422b9dc
children ff4174f1ed3a
line wrap: on
line diff
--- a/src/popupwin.c
+++ b/src/popupwin.c
@@ -452,24 +452,22 @@ apply_move_options(win_T *wp, dict_T *d)
 	wp->w_popup_prop_type = 0;
 	if (*str != NUL)
 	{
-	    nr = find_prop_type_id(str, wp->w_buffer);
+	    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;
-		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;
-		}
-	    }
 	}
     }