diff 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
line wrap: on
line diff
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -482,17 +482,13 @@ do_mouse(
 		{
 		    c1 = TabPageIdxs[mouse_col];
 		    tabpage_move(c1 <= 0 ? 9999 : c1 < tabpage_index(curtab)
-								    ? c1 - 1 : c1);
+								? c1 - 1 : c1);
 		}
 		return FALSE;
 	    }
 
 	    // click in a tab selects that tab page
-	    if (is_click
-# ifdef FEAT_CMDWIN
-		    && cmdwin_type == 0
-# endif
-		    && mouse_col < Columns)
+	    if (is_click && cmdwin_type == 0 && mouse_col < Columns)
 	    {
 		in_tab_line = TRUE;
 		c1 = TabPageIdxs[mouse_col];
@@ -745,7 +741,7 @@ do_mouse(
     }
 #endif
 
-#if defined(FEAT_CLIPBOARD) && defined(FEAT_CMDWIN)
+#if defined(FEAT_CLIPBOARD)
     if ((jump_flags & IN_OTHER_WIN) && !VIsual_active && clip_star.available)
     {
 	clip_modeless(which_button, is_click, is_drag);
@@ -1602,7 +1598,7 @@ retnomove:
 	    end_visual_mode_keep_button();
 	    redraw_curbuf_later(UPD_INVERTED);	// delete the inversion
 	}
-#if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD)
+#if defined(FEAT_CLIPBOARD)
 	// Continue a modeless selection in another window.
 	if (cmdwin_type != 0 && row < curwin->w_winrow)
 	    return IN_OTHER_WIN;
@@ -1732,10 +1728,7 @@ retnomove:
 # ifdef FEAT_RIGHTLEFT
 			    wp->w_p_rl ? col < wp->w_width - wp->w_p_fdc :
 # endif
-			    col >= wp->w_p_fdc
-# ifdef FEAT_CMDWIN
-				  + (cmdwin_type == 0 && wp == curwin ? 0 : 1)
-# endif
+			    col >= wp->w_p_fdc + (cmdwin_type == 0 && wp == curwin ? 0 : 1)
 			    )
 #endif
 			&& (flags & MOUSE_MAY_STOP_VIS))))
@@ -1743,7 +1736,6 @@ retnomove:
 	    end_visual_mode_keep_button();
 	    redraw_curbuf_later(UPD_INVERTED);	// delete the inversion
 	}
-#ifdef FEAT_CMDWIN
 	if (cmdwin_type != 0 && wp != curwin)
 	{
 	    // A click outside the command-line window: Use modeless
@@ -1759,7 +1751,6 @@ retnomove:
 	    wp = curwin;
 # endif
 	}
-#endif
 #if defined(FEAT_PROP_POPUP) && defined(FEAT_TERMINAL)
 	if (popup_is_popup(curwin) && curbuf->b_term != NULL)
 	    // terminal in popup window: don't jump to another window
@@ -1848,7 +1839,7 @@ retnomove:
 	    redraw_curbuf_later(UPD_INVERTED);	// delete the inversion
 	}
 
-#if defined(FEAT_CMDWIN) && defined(FEAT_CLIPBOARD)
+#if defined(FEAT_CLIPBOARD)
 	// Continue a modeless selection in another window.
 	if (cmdwin_type != 0 && row < curwin->w_winrow)
 	    return IN_OTHER_WIN;
@@ -1986,10 +1977,7 @@ retnomove:
 # ifdef FEAT_RIGHTLEFT
 	    curwin->w_p_rl ? col < curwin->w_width - curwin->w_p_fdc :
 # endif
-	    col >= curwin->w_p_fdc
-#  ifdef FEAT_CMDWIN
-				+ (cmdwin_type == 0 ? 0 : 1)
-#  endif
+	    col >= curwin->w_p_fdc + (cmdwin_type == 0 ? 0 : 1)
        )
 	mouse_char = ' ';
 #endif