diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2023-01-08 13:44:24 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-01-08 13:44:24 +0000 |
commit | 7f8b2559a30e2e2a443c35b28e94c6b45ba7ae04 (patch) | |
tree | 04c0145c1e3cf9777d58c91fa7b2ad231cfecf8d /src/gui_xim.c | |
parent | df8f9473596c8fb18ec893de677dba455e8925b3 (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_xim.c')
-rw-r--r-- | src/gui_xim.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/gui_xim.c b/src/gui_xim.c index 6998f0c436..163cbdaa0f 100644 --- a/src/gui_xim.c +++ b/src/gui_xim.c @@ -199,32 +199,32 @@ im_set_active(int active) void xim_set_focus(int focus) { - if (xic != NULL) - { - if (focus) - gtk_im_context_focus_in(xic); - else - gtk_im_context_focus_out(xic); - } + if (xic == NULL) + return; + + if (focus) + gtk_im_context_focus_in(xic); + else + gtk_im_context_focus_out(xic); } void im_set_position(int row, int col) { - if (xic != NULL) - { - GdkRectangle area; + if (xic == NULL) + return; - area.x = FILL_X(col); - area.y = FILL_Y(row); - area.width = gui.char_width * (mb_lefthalve(row, col) ? 2 : 1); - area.height = gui.char_height; + GdkRectangle area; - gtk_im_context_set_cursor_location(xic, &area); + area.x = FILL_X(col); + area.y = FILL_Y(row); + area.width = gui.char_width * (mb_lefthalve(row, col) ? 2 : 1); + area.height = gui.char_height; - if (p_imst == IM_OVER_THE_SPOT) - im_preedit_window_set_position(); - } + gtk_im_context_set_cursor_location(xic, &area); + + if (p_imst == IM_OVER_THE_SPOT) + im_preedit_window_set_position(); } # if 0 || defined(PROTO) // apparently only used in gui_x11.c |