summaryrefslogtreecommitdiffstats
path: root/src/gui_photon.c
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2023-01-08 13:44:24 +0000
committerBram Moolenaar <Bram@vim.org>2023-01-08 13:44:24 +0000
commit7f8b2559a30e2e2a443c35b28e94c6b45ba7ae04 (patch)
tree04c0145c1e3cf9777d58c91fa7b2ad231cfecf8d /src/gui_photon.c
parentdf8f9473596c8fb18ec893de677dba455e8925b3 (diff)
patch 9.0.1158: code is indented more than necessaryv9.0.1158
Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes #11787)
Diffstat (limited to 'src/gui_photon.c')
-rw-r--r--src/gui_photon.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/gui_photon.c b/src/gui_photon.c
index d48a1538fa..5671890470 100644
--- a/src/gui_photon.c
+++ b/src/gui_photon.c
@@ -992,19 +992,19 @@ gui_ph_pg_add_buffer(char *name)
char **new_titles = NULL;
new_titles = ALLOC_MULT(char *, (num_panels + 1));
- if (new_titles != NULL)
- {
- if (num_panels > 0)
- memcpy(new_titles, panel_titles, num_panels * sizeof(char **));
+ if (new_titles == NULL)
+ return;
- new_titles[ num_panels++ ] = name;
+ if (num_panels > 0)
+ memcpy(new_titles, panel_titles, num_panels * sizeof(char **));
- PtSetResource(gui.vimPanelGroup, Pt_ARG_PG_PANEL_TITLES, new_titles,
- num_panels);
+ new_titles[ num_panels++ ] = name;
- vim_free(panel_titles);
- panel_titles = new_titles;
- }
+ PtSetResource(gui.vimPanelGroup, Pt_ARG_PG_PANEL_TITLES, new_titles,
+ num_panels);
+
+ vim_free(panel_titles);
+ panel_titles = new_titles;
}
static void
@@ -1901,21 +1901,21 @@ mch_set_mouse_shape(int shape)
void
gui_mch_mousehide(int hide)
{
- if (gui.pointer_hidden != hide)
- {
- gui.pointer_hidden = hide;
+ if (gui.pointer_hidden == hide)
+ return;
+
+ gui.pointer_hidden = hide;
#ifdef FEAT_MOUSESHAPE
- if (hide)
- PtSetResource(gui.vimTextArea, Pt_ARG_CURSOR_TYPE,
- Ph_CURSOR_NONE, 0);
- else
- mch_set_mouse_shape(last_shape);
-#else
+ if (hide)
PtSetResource(gui.vimTextArea, Pt_ARG_CURSOR_TYPE,
- (hide == MOUSE_SHOW) ? GUI_PH_MOUSE_TYPE : Ph_CURSOR_NONE,
- 0);
+ Ph_CURSOR_NONE, 0);
+ else
+ mch_set_mouse_shape(last_shape);
+#else
+ PtSetResource(gui.vimTextArea, Pt_ARG_CURSOR_TYPE,
+ (hide == MOUSE_SHOW) ? GUI_PH_MOUSE_TYPE : Ph_CURSOR_NONE,
+ 0);
#endif
- }
}
void