comparison src/gui_xim.c @ 31651:e5ee2ffd826a v9.0.1158

patch 9.0.1158: code is indented more than necessary Commit: https://github.com/vim/vim/commit/7f8b2559a30e2e2a443c35b28e94c6b45ba7ae04 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Sun Jan 8 13:44:24 2023 +0000 patch 9.0.1158: code is indented more than necessary Problem: Code is indented more than necessary. Solution: Use an early return where it makes sense. (Yegappan Lakshmanan, closes #11787)
author Bram Moolenaar <Bram@vim.org>
date Sun, 08 Jan 2023 14:45:05 +0100
parents b1c66bff0a66
children 8b15e4161605
comparison
equal deleted inserted replaced
31650:0f3310ec8487 31651:e5ee2ffd826a
197 } 197 }
198 198
199 void 199 void
200 xim_set_focus(int focus) 200 xim_set_focus(int focus)
201 { 201 {
202 if (xic != NULL) 202 if (xic == NULL)
203 { 203 return;
204 if (focus) 204
205 gtk_im_context_focus_in(xic); 205 if (focus)
206 else 206 gtk_im_context_focus_in(xic);
207 gtk_im_context_focus_out(xic); 207 else
208 } 208 gtk_im_context_focus_out(xic);
209 } 209 }
210 210
211 void 211 void
212 im_set_position(int row, int col) 212 im_set_position(int row, int col)
213 { 213 {
214 if (xic != NULL) 214 if (xic == NULL)
215 { 215 return;
216 GdkRectangle area; 216
217 217 GdkRectangle area;
218 area.x = FILL_X(col); 218
219 area.y = FILL_Y(row); 219 area.x = FILL_X(col);
220 area.width = gui.char_width * (mb_lefthalve(row, col) ? 2 : 1); 220 area.y = FILL_Y(row);
221 area.height = gui.char_height; 221 area.width = gui.char_width * (mb_lefthalve(row, col) ? 2 : 1);
222 222 area.height = gui.char_height;
223 gtk_im_context_set_cursor_location(xic, &area); 223
224 224 gtk_im_context_set_cursor_location(xic, &area);
225 if (p_imst == IM_OVER_THE_SPOT) 225
226 im_preedit_window_set_position(); 226 if (p_imst == IM_OVER_THE_SPOT)
227 } 227 im_preedit_window_set_position();
228 } 228 }
229 229
230 # if 0 || defined(PROTO) // apparently only used in gui_x11.c 230 # if 0 || defined(PROTO) // apparently only used in gui_x11.c
231 void 231 void
232 xim_set_preedit(void) 232 xim_set_preedit(void)