comparison src/mouse.c @ 30645:101f08b49ed3 v9.0.0657

patch 9.0.0657: too many #ifdefs Commit: https://github.com/vim/vim/commit/7904fa420eb577274c4c3711295240100167d495 Author: Martin Tournoij <martin@arp242.net> Date: Tue Oct 4 16:28:45 2022 +0100 patch 9.0.0657: too many #ifdefs Problem: Too many #ifdefs. Solution: Graduate the +cmdwin feature. Now the tiny and small builds are equal, drop the small build. (Martin Tournoij, closes #11268)
author Bram Moolenaar <Bram@vim.org>
date Tue, 04 Oct 2022 17:30:06 +0200
parents b37b74ea8dee
children ffdb7a6785af
comparison
equal deleted inserted replaced
30644:0c102a723b9a 30645:101f08b49ed3
480 { 480 {
481 if (in_tab_line) 481 if (in_tab_line)
482 { 482 {
483 c1 = TabPageIdxs[mouse_col]; 483 c1 = TabPageIdxs[mouse_col];
484 tabpage_move(c1 <= 0 ? 9999 : c1 < tabpage_index(curtab) 484 tabpage_move(c1 <= 0 ? 9999 : c1 < tabpage_index(curtab)
485 ? c1 - 1 : c1); 485 ? c1 - 1 : c1);
486 } 486 }
487 return FALSE; 487 return FALSE;
488 } 488 }
489 489
490 // click in a tab selects that tab page 490 // click in a tab selects that tab page
491 if (is_click 491 if (is_click && cmdwin_type == 0 && mouse_col < Columns)
492 # ifdef FEAT_CMDWIN
493 && cmdwin_type == 0
494 # endif
495 && mouse_col < Columns)
496 { 492 {
497 in_tab_line = TRUE; 493 in_tab_line = TRUE;
498 c1 = TabPageIdxs[mouse_col]; 494 c1 = TabPageIdxs[mouse_col];
499 if (c1 >= 0) 495 if (c1 >= 0)
500 { 496 {
743 if (curwin == old_curwin) 739 if (curwin == old_curwin)
744 curwin->w_cursor = save_cursor; 740 curwin->w_cursor = save_cursor;
745 } 741 }
746 #endif 742 #endif
747 743
748 #if defined(FEAT_CLIPBOARD) && defined(FEAT_CMDWIN) 744 #if defined(FEAT_CLIPBOARD)
749 if ((jump_flags & IN_OTHER_WIN) && !VIsual_active && clip_star.available) 745 if ((jump_flags & IN_OTHER_WIN) && !VIsual_active && clip_star.available)
750 { 746 {
751 clip_modeless(which_button, is_click, is_drag); 747 clip_modeless(which_button, is_click, is_drag);
752 return FALSE; 748 return FALSE;
753 } 749 }
1600 if (flags & MOUSE_MAY_STOP_VIS) 1596 if (flags & MOUSE_MAY_STOP_VIS)
1601 { 1597 {
1602 end_visual_mode_keep_button(); 1598 end_visual_mode_keep_button();
1603 redraw_curbuf_later(UPD_INVERTED); // delete the inversion 1599 redraw_curbuf_later(UPD_INVERTED); // delete the inversion
1604 } 1600 }
1605 #if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD) 1601 #if defined(FEAT_CLIPBOARD)
1606 // Continue a modeless selection in another window. 1602 // Continue a modeless selection in another window.
1607 if (cmdwin_type != 0 && row < curwin->w_winrow) 1603 if (cmdwin_type != 0 && row < curwin->w_winrow)
1608 return IN_OTHER_WIN; 1604 return IN_OTHER_WIN;
1609 #endif 1605 #endif
1610 #ifdef FEAT_PROP_POPUP 1606 #ifdef FEAT_PROP_POPUP
1730 #ifdef FEAT_FOLDING 1726 #ifdef FEAT_FOLDING
1731 && ( 1727 && (
1732 # ifdef FEAT_RIGHTLEFT 1728 # ifdef FEAT_RIGHTLEFT
1733 wp->w_p_rl ? col < wp->w_width - wp->w_p_fdc : 1729 wp->w_p_rl ? col < wp->w_width - wp->w_p_fdc :
1734 # endif 1730 # endif
1735 col >= wp->w_p_fdc 1731 col >= wp->w_p_fdc + (cmdwin_type == 0 && wp == curwin ? 0 : 1)
1736 # ifdef FEAT_CMDWIN
1737 + (cmdwin_type == 0 && wp == curwin ? 0 : 1)
1738 # endif
1739 ) 1732 )
1740 #endif 1733 #endif
1741 && (flags & MOUSE_MAY_STOP_VIS)))) 1734 && (flags & MOUSE_MAY_STOP_VIS))))
1742 { 1735 {
1743 end_visual_mode_keep_button(); 1736 end_visual_mode_keep_button();
1744 redraw_curbuf_later(UPD_INVERTED); // delete the inversion 1737 redraw_curbuf_later(UPD_INVERTED); // delete the inversion
1745 } 1738 }
1746 #ifdef FEAT_CMDWIN
1747 if (cmdwin_type != 0 && wp != curwin) 1739 if (cmdwin_type != 0 && wp != curwin)
1748 { 1740 {
1749 // A click outside the command-line window: Use modeless 1741 // A click outside the command-line window: Use modeless
1750 // selection if possible. Allow dragging the status lines. 1742 // selection if possible. Allow dragging the status lines.
1751 on_sep_line = 0; 1743 on_sep_line = 0;
1757 row = 0; 1749 row = 0;
1758 col += wp->w_wincol; 1750 col += wp->w_wincol;
1759 wp = curwin; 1751 wp = curwin;
1760 # endif 1752 # endif
1761 } 1753 }
1762 #endif
1763 #if defined(FEAT_PROP_POPUP) && defined(FEAT_TERMINAL) 1754 #if defined(FEAT_PROP_POPUP) && defined(FEAT_TERMINAL)
1764 if (popup_is_popup(curwin) && curbuf->b_term != NULL) 1755 if (popup_is_popup(curwin) && curbuf->b_term != NULL)
1765 // terminal in popup window: don't jump to another window 1756 // terminal in popup window: don't jump to another window
1766 return IN_OTHER_WIN; 1757 return IN_OTHER_WIN;
1767 #endif 1758 #endif
1846 { 1837 {
1847 end_visual_mode_keep_button(); 1838 end_visual_mode_keep_button();
1848 redraw_curbuf_later(UPD_INVERTED); // delete the inversion 1839 redraw_curbuf_later(UPD_INVERTED); // delete the inversion
1849 } 1840 }
1850 1841
1851 #if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD) 1842 #if defined(FEAT_CLIPBOARD)
1852 // Continue a modeless selection in another window. 1843 // Continue a modeless selection in another window.
1853 if (cmdwin_type != 0 && row < curwin->w_winrow) 1844 if (cmdwin_type != 0 && row < curwin->w_winrow)
1854 return IN_OTHER_WIN; 1845 return IN_OTHER_WIN;
1855 #endif 1846 #endif
1856 #ifdef FEAT_PROP_POPUP 1847 #ifdef FEAT_PROP_POPUP
1984 // Check for position outside of the fold column. 1975 // Check for position outside of the fold column.
1985 if ( 1976 if (
1986 # ifdef FEAT_RIGHTLEFT 1977 # ifdef FEAT_RIGHTLEFT
1987 curwin->w_p_rl ? col < curwin->w_width - curwin->w_p_fdc : 1978 curwin->w_p_rl ? col < curwin->w_width - curwin->w_p_fdc :
1988 # endif 1979 # endif
1989 col >= curwin->w_p_fdc 1980 col >= curwin->w_p_fdc + (cmdwin_type == 0 ? 0 : 1)
1990 # ifdef FEAT_CMDWIN
1991 + (cmdwin_type == 0 ? 0 : 1)
1992 # endif
1993 ) 1981 )
1994 mouse_char = ' '; 1982 mouse_char = ' ';
1995 #endif 1983 #endif
1996 1984
1997 // compute the position in the buffer line from the posn on the screen 1985 // compute the position in the buffer line from the posn on the screen