Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
18628:cab958d39c1c | 18629:15fe2bd478b0 |
---|---|
450 if (str != NULL) | 450 if (str != NULL) |
451 { | 451 { |
452 wp->w_popup_prop_type = 0; | 452 wp->w_popup_prop_type = 0; |
453 if (*str != NUL) | 453 if (*str != NUL) |
454 { | 454 { |
455 nr = find_prop_type_id(str, wp->w_buffer); | 455 wp->w_popup_prop_win = curwin; |
456 di = dict_find(d, (char_u *)"textpropwin", -1); | |
457 if (di != NULL) | |
458 { | |
459 wp->w_popup_prop_win = find_win_by_nr_or_id(&di->di_tv); | |
460 if (!win_valid(wp->w_popup_prop_win)) | |
461 wp->w_popup_prop_win = curwin; | |
462 } | |
463 | |
464 nr = find_prop_type_id(str, wp->w_popup_prop_win->w_buffer); | |
456 if (nr <= 0) | 465 if (nr <= 0) |
457 nr = find_prop_type_id(str, NULL); | 466 nr = find_prop_type_id(str, NULL); |
458 if (nr <= 0) | 467 if (nr <= 0) |
459 semsg(_(e_invarg2), str); | 468 semsg(_(e_invarg2), str); |
460 else | 469 else |
461 { | |
462 wp->w_popup_prop_type = nr; | 470 wp->w_popup_prop_type = nr; |
463 wp->w_popup_prop_win = curwin; | |
464 | |
465 di = dict_find(d, (char_u *)"textpropwin", -1); | |
466 if (di != NULL) | |
467 { | |
468 wp->w_popup_prop_win = find_win_by_nr_or_id(&di->di_tv); | |
469 if (win_valid(wp->w_popup_prop_win)) | |
470 wp->w_popup_prop_win = curwin; | |
471 } | |
472 } | |
473 } | 471 } |
474 } | 472 } |
475 | 473 |
476 di = dict_find(d, (char_u *)"textpropid", -1); | 474 di = dict_find(d, (char_u *)"textpropid", -1); |
477 if (di != NULL) | 475 if (di != NULL) |