comparison src/popupmenu.c @ 18763:49b78d6465e5 v8.1.2371

patch 8.1.2371: FEAT_TEXT_PROP is a confusing name Commit: https://github.com/vim/vim/commit/05ad5ff0ab34ed9a5296dedd420ca81698b8ce22 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 30 22:48:27 2019 +0100 patch 8.1.2371: FEAT_TEXT_PROP is a confusing name Problem: FEAT_TEXT_PROP is a confusing name. Solution: Use FEAT_PROP_POPUP. (Naruhiko Nishino, closes https://github.com/vim/vim/issues/5291)
author Bram Moolenaar <Bram@vim.org>
date Sat, 30 Nov 2019 23:00:05 +0100
parents 592c7b56db69
children 068337e86133
comparison
equal deleted inserted replaced
18762:19582783e5ad 18763:49b78d6465e5
427 thumb_pos = (pum_first * (pum_height - thumb_height) 427 thumb_pos = (pum_first * (pum_height - thumb_height)
428 + (pum_size - pum_height) / 2) 428 + (pum_size - pum_height) / 2)
429 / (pum_size - pum_height); 429 / (pum_size - pum_height);
430 } 430 }
431 431
432 #ifdef FEAT_TEXT_PROP 432 #ifdef FEAT_PROP_POPUP
433 // The popup menu is drawn over popup menus with zindex under 433 // The popup menu is drawn over popup menus with zindex under
434 // POPUPMENU_ZINDEX. 434 // POPUPMENU_ZINDEX.
435 screen_zindex = POPUPMENU_ZINDEX; 435 screen_zindex = POPUPMENU_ZINDEX;
436 #endif 436 #endif
437 437
614 } 614 }
615 615
616 ++row; 616 ++row;
617 } 617 }
618 618
619 #ifdef FEAT_TEXT_PROP 619 #ifdef FEAT_PROP_POPUP
620 screen_zindex = 0; 620 screen_zindex = 0;
621 #endif 621 #endif
622 } 622 }
623 623
624 #if defined(FEAT_TEXT_PROP) && defined(FEAT_QUICKFIX) 624 #if defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX)
625 /* 625 /*
626 * Position the info popup relative to the popup menu item. 626 * Position the info popup relative to the popup menu item.
627 */ 627 */
628 void 628 void
629 pum_position_info_popup(win_T *wp) 629 pum_position_info_popup(win_T *wp)
681 int resized = FALSE; 681 int resized = FALSE;
682 int context = pum_height / 2; 682 int context = pum_height / 2;
683 #ifdef FEAT_QUICKFIX 683 #ifdef FEAT_QUICKFIX
684 int prev_selected = pum_selected; 684 int prev_selected = pum_selected;
685 #endif 685 #endif
686 #ifdef FEAT_TEXT_PROP 686 #ifdef FEAT_PROP_POPUP
687 int has_info = FALSE; 687 int has_info = FALSE;
688 #endif 688 #endif
689 689
690 pum_selected = n; 690 pum_selected = n;
691 691
756 && vim_strchr(p_cot, 'p') != NULL) 756 && vim_strchr(p_cot, 'p') != NULL)
757 { 757 {
758 win_T *curwin_save = curwin; 758 win_T *curwin_save = curwin;
759 tabpage_T *curtab_save = curtab; 759 tabpage_T *curtab_save = curtab;
760 int res = OK; 760 int res = OK;
761 # ifdef FEAT_TEXT_PROP 761 # ifdef FEAT_PROP_POPUP
762 use_popup_T use_popup; 762 use_popup_T use_popup;
763 # else 763 # else
764 # define use_popup USEPOPUP_NONE 764 # define use_popup USEPOPUP_NONE
765 # endif 765 # endif
766 # ifdef FEAT_TEXT_PROP 766 # ifdef FEAT_PROP_POPUP
767 has_info = TRUE; 767 has_info = TRUE;
768 if (strstr((char *)p_cot, "popuphidden") != NULL) 768 if (strstr((char *)p_cot, "popuphidden") != NULL)
769 use_popup = USEPOPUP_HIDDEN; 769 use_popup = USEPOPUP_HIDDEN;
770 else if (strstr((char *)p_cot, "popup") != NULL) 770 else if (strstr((char *)p_cot, "popup") != NULL)
771 use_popup = USEPOPUP_NORMAL; 771 use_popup = USEPOPUP_NORMAL;
785 --no_u_sync; 785 --no_u_sync;
786 --RedrawingDisabled; 786 --RedrawingDisabled;
787 g_do_tagpreview = 0; 787 g_do_tagpreview = 0;
788 788
789 if (curwin->w_p_pvw 789 if (curwin->w_p_pvw
790 # ifdef FEAT_TEXT_PROP 790 # ifdef FEAT_PROP_POPUP
791 || (curwin->w_popup_flags & POPF_INFO) 791 || (curwin->w_popup_flags & POPF_INFO)
792 # endif 792 # endif
793 ) 793 )
794 { 794 {
795 if (!resized 795 if (!resized
860 860
861 curbuf->b_changed = 0; 861 curbuf->b_changed = 0;
862 curbuf->b_p_ma = FALSE; 862 curbuf->b_p_ma = FALSE;
863 if (pum_selected != prev_selected) 863 if (pum_selected != prev_selected)
864 { 864 {
865 # ifdef FEAT_TEXT_PROP 865 # ifdef FEAT_PROP_POPUP
866 curwin->w_firstline = 1; 866 curwin->w_firstline = 1;
867 # endif 867 # endif
868 curwin->w_topline = 1; 868 curwin->w_topline = 1;
869 } 869 }
870 else if (curwin->w_topline > curbuf->b_ml.ml_line_count) 870 else if (curwin->w_topline > curbuf->b_ml.ml_line_count)
871 curwin->w_topline = curbuf->b_ml.ml_line_count; 871 curwin->w_topline = curbuf->b_ml.ml_line_count;
872 curwin->w_cursor.lnum = curwin->w_topline; 872 curwin->w_cursor.lnum = curwin->w_topline;
873 curwin->w_cursor.col = 0; 873 curwin->w_cursor.col = 0;
874 # ifdef FEAT_TEXT_PROP 874 # ifdef FEAT_PROP_POPUP
875 if (use_popup != USEPOPUP_NONE) 875 if (use_popup != USEPOPUP_NONE)
876 { 876 {
877 pum_position_info_popup(curwin); 877 pum_position_info_popup(curwin);
878 if (win_valid(curwin_save)) 878 if (win_valid(curwin_save))
879 redraw_win_later(curwin_save, SOME_VALID); 879 redraw_win_later(curwin_save, SOME_VALID);
914 update_screen(0); 914 update_screen(0);
915 pum_do_redraw = FALSE; 915 pum_do_redraw = FALSE;
916 916
917 if (!resized && win_valid(curwin_save)) 917 if (!resized && win_valid(curwin_save))
918 { 918 {
919 # ifdef FEAT_TEXT_PROP 919 # ifdef FEAT_PROP_POPUP
920 win_T *wp = curwin; 920 win_T *wp = curwin;
921 # endif 921 # endif
922 ++no_u_sync; 922 ++no_u_sync;
923 win_enter(curwin_save, TRUE); 923 win_enter(curwin_save, TRUE);
924 --no_u_sync; 924 --no_u_sync;
925 # ifdef FEAT_TEXT_PROP 925 # ifdef FEAT_PROP_POPUP
926 if (use_popup == USEPOPUP_HIDDEN && win_valid(wp)) 926 if (use_popup == USEPOPUP_HIDDEN && win_valid(wp))
927 popup_hide(wp); 927 popup_hide(wp);
928 # endif 928 # endif
929 } 929 }
930 930
935 pum_do_redraw = FALSE; 935 pum_do_redraw = FALSE;
936 call_update_screen = FALSE; 936 call_update_screen = FALSE;
937 } 937 }
938 } 938 }
939 } 939 }
940 # if defined(FEAT_TEXT_PROP) && defined(FEAT_QUICKFIX) 940 # if defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX)
941 if (WIN_IS_POPUP(curwin)) 941 if (WIN_IS_POPUP(curwin))
942 // can't keep focus in a popup window 942 // can't keep focus in a popup window
943 win_enter(firstwin, TRUE); 943 win_enter(firstwin, TRUE);
944 # endif 944 # endif
945 } 945 }
946 #endif 946 #endif
947 } 947 }
948 #if defined(FEAT_TEXT_PROP) && defined(FEAT_QUICKFIX) 948 #if defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX)
949 if (!has_info) 949 if (!has_info)
950 // hide any popup info window 950 // hide any popup info window
951 popup_hide_info(); 951 popup_hide_info();
952 #endif 952 #endif
953 953
965 { 965 {
966 pum_array = NULL; 966 pum_array = NULL;
967 redraw_all_later(NOT_VALID); 967 redraw_all_later(NOT_VALID);
968 redraw_tabline = TRUE; 968 redraw_tabline = TRUE;
969 status_redraw_all(); 969 status_redraw_all();
970 #if defined(FEAT_TEXT_PROP) && defined(FEAT_QUICKFIX) 970 #if defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX)
971 // hide any popup info window 971 // hide any popup info window
972 popup_hide_info(); 972 popup_hide_info();
973 #endif 973 #endif
974 } 974 }
975 975