summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2023-01-09 19:04:23 +0000
committerBram Moolenaar <Bram@vim.org>2023-01-09 19:04:23 +0000
commit1cfb14aa972ccf3235ac67f07b7db1175b7c5384 (patch)
treeb746eda548993b9e0987d7c9c0c543ddddc5758f /src/ex_cmds.c
parent765d82a657c5e42d5d7c88ae410e53f398c34c43 (diff)
patch 9.0.1166: code is indented more than necessaryv9.0.1166
Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes #11792)
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c96
1 files changed, 48 insertions, 48 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index faff4aadaf..32c72879cc 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -5279,67 +5279,67 @@ prepare_tagpreview(
need_mouse_correct = TRUE;
# endif
+ if (curwin->w_p_pvw)
+ return FALSE;
+
/*
* If there is already a preview window open, use that one.
*/
- if (!curwin->w_p_pvw)
- {
# ifdef FEAT_PROP_POPUP
- if (use_previewpopup && *p_pvp != NUL)
- {
- wp = popup_find_preview_window();
- if (wp != NULL)
- popup_set_wantpos_cursor(wp, wp->w_minwidth, NULL);
- }
- else if (use_popup != USEPOPUP_NONE)
+ if (use_previewpopup && *p_pvp != NUL)
+ {
+ wp = popup_find_preview_window();
+ if (wp != NULL)
+ popup_set_wantpos_cursor(wp, wp->w_minwidth, NULL);
+ }
+ else if (use_popup != USEPOPUP_NONE)
+ {
+ wp = popup_find_info_window();
+ if (wp != NULL)
{
- wp = popup_find_info_window();
- if (wp != NULL)
- {
- if (use_popup == USEPOPUP_NORMAL)
- popup_show(wp);
- else
- popup_hide(wp);
- // When the popup moves or resizes it may reveal part of
- // another window. TODO: can this be done more efficiently?
- redraw_all_later(UPD_NOT_VALID);
- }
+ if (use_popup == USEPOPUP_NORMAL)
+ popup_show(wp);
+ else
+ popup_hide(wp);
+ // When the popup moves or resizes it may reveal part of
+ // another window. TODO: can this be done more efficiently?
+ redraw_all_later(UPD_NOT_VALID);
}
- else
+ }
+ else
# endif
- {
- FOR_ALL_WINDOWS(wp)
- if (wp->w_p_pvw)
- break;
- }
- if (wp != NULL)
- win_enter(wp, undo_sync);
- else
- {
- /*
- * There is no preview window open yet. Create one.
- */
+ {
+ FOR_ALL_WINDOWS(wp)
+ if (wp->w_p_pvw)
+ break;
+ }
+ if (wp != NULL)
+ {
+ win_enter(wp, undo_sync);
+ return FALSE;
+ }
+
+ /*
+ * There is no preview window open yet. Create one.
+ */
# ifdef FEAT_PROP_POPUP
- if ((use_previewpopup && *p_pvp != NUL)
- || use_popup != USEPOPUP_NONE)
- return popup_create_preview_window(use_popup != USEPOPUP_NONE);
+ if ((use_previewpopup && *p_pvp != NUL)
+ || use_popup != USEPOPUP_NONE)
+ return popup_create_preview_window(use_popup != USEPOPUP_NONE);
# endif
- if (win_split(g_do_tagpreview > 0 ? g_do_tagpreview : 0, 0) == FAIL)
- return FALSE;
- curwin->w_p_pvw = TRUE;
- curwin->w_p_wfh = TRUE;
- RESET_BINDING(curwin); // don't take over 'scrollbind'
- // and 'cursorbind'
+ if (win_split(g_do_tagpreview > 0 ? g_do_tagpreview : 0, 0) == FAIL)
+ return FALSE;
+ curwin->w_p_pvw = TRUE;
+ curwin->w_p_wfh = TRUE;
+ RESET_BINDING(curwin); // don't take over 'scrollbind'
+ // and 'cursorbind'
# ifdef FEAT_DIFF
- curwin->w_p_diff = FALSE; // no 'diff'
+ curwin->w_p_diff = FALSE; // no 'diff'
# endif
# ifdef FEAT_FOLDING
- curwin->w_p_fdc = 0; // no 'foldcolumn'
+ curwin->w_p_fdc = 0; // no 'foldcolumn'
# endif
- return TRUE;
- }
- }
- return FALSE;
+ return TRUE;
}
#endif