Mercurial > vim
comparison src/popupwin.c @ 17348:d82b0cfb1e82 v8.1.1673
patch 8.1.1673: cannot easily find the popup window at a certain position
commit https://github.com/vim/vim/commit/b4f0628fc5892e1bb9f0f780af782ff47ef277ed
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jul 12 21:07:54 2019 +0200
patch 8.1.1673: cannot easily find the popup window at a certain position
Problem: Cannot easily find the popup window at a certain position.
Solution: Add popup_locate().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 12 Jul 2019 21:15:04 +0200 |
parents | 1ac1d34bbdbf |
children | 102ed3a26a5d |
comparison
equal
deleted
inserted
replaced
17347:21b9633e27d1 | 17348:d82b0cfb1e82 |
---|---|
1887 dict_add_number(dict, "scrollbar", wp->w_has_scrollbar); | 1887 dict_add_number(dict, "scrollbar", wp->w_has_scrollbar); |
1888 dict_add_number(dict, "firstline", wp->w_topline); | 1888 dict_add_number(dict, "firstline", wp->w_topline); |
1889 dict_add_number(dict, "visible", | 1889 dict_add_number(dict, "visible", |
1890 win_valid(wp) && (wp->w_popup_flags & POPF_HIDDEN) == 0); | 1890 win_valid(wp) && (wp->w_popup_flags & POPF_HIDDEN) == 0); |
1891 } | 1891 } |
1892 } | |
1893 /* | |
1894 * popup_locate({row}, {col}) | |
1895 */ | |
1896 void | |
1897 f_popup_locate(typval_T *argvars, typval_T *rettv) | |
1898 { | |
1899 int row = tv_get_number(&argvars[0]) - 1; | |
1900 int col = tv_get_number(&argvars[1]) - 1; | |
1901 win_T *wp; | |
1902 | |
1903 wp = mouse_find_win(&row, &col, FIND_POPUP); | |
1904 if (WIN_IS_POPUP(wp)) | |
1905 rettv->vval.v_number = wp->w_id; | |
1892 } | 1906 } |
1893 | 1907 |
1894 /* | 1908 /* |
1895 * For popup_getoptions(): add a "border" or "padding" entry to "dict". | 1909 * For popup_getoptions(): add a "border" or "padding" entry to "dict". |
1896 */ | 1910 */ |