Mercurial > vim
comparison src/gui_xim.c @ 26897:d02d40f0261c v8.2.3977
patch 8.2.3977: error messages are spread out
Commit: https://github.com/vim/vim/commit/9a846fbaa569b3690d70606f2a86e97f77a05496
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 1 21:59:18 2022 +0000
patch 8.2.3977: error messages are spread out
Problem: Error messages are spread out.
Solution: Move more error messages to errors.h.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 01 Jan 2022 23:00:04 +0100 |
parents | 13ba00ef7687 |
children | 268f6a3511df |
comparison
equal
deleted
inserted
replaced
26896:e58f8c38545d | 26897:d02d40f0261c |
---|---|
1322 XNBackground, (Pixel) xim_bg_color, | 1322 XNBackground, (Pixel) xim_bg_color, |
1323 XNArea, &spot_area, | 1323 XNArea, &spot_area, |
1324 XNLineSpace, line_space, | 1324 XNLineSpace, line_space, |
1325 NULL); | 1325 NULL); |
1326 if (XSetICValues(xic, XNPreeditAttributes, attr_list, NULL)) | 1326 if (XSetICValues(xic, XNPreeditAttributes, attr_list, NULL)) |
1327 emsg(_("E284: Cannot set IC values")); | 1327 emsg(_(e_cannot_set_ic_values)); |
1328 XFree(attr_list); | 1328 XFree(attr_list); |
1329 } | 1329 } |
1330 } | 1330 } |
1331 | |
1332 # if defined(FEAT_GUI_X11) | |
1333 static char e_xim[] = N_("E285: Failed to create input context"); | |
1334 # endif | |
1335 | 1331 |
1336 # if defined(FEAT_GUI_X11) || defined(PROTO) | 1332 # if defined(FEAT_GUI_X11) || defined(PROTO) |
1337 # if defined(XtSpecificationRelease) && XtSpecificationRelease >= 6 && !defined(SUN_SYSTEM) | 1333 # if defined(XtSpecificationRelease) && XtSpecificationRelease >= 6 && !defined(SUN_SYSTEM) |
1338 # define USE_X11R6_XIM | 1334 # define USE_X11R6_XIM |
1339 # endif | 1335 # endif |
1481 // Only give this message when verbose is set, because too many people | 1477 // Only give this message when verbose is set, because too many people |
1482 // got this message when they didn't want to use a XIM. | 1478 // got this message when they didn't want to use a XIM. |
1483 if (p_verbose > 0) | 1479 if (p_verbose > 0) |
1484 { | 1480 { |
1485 verbose_enter(); | 1481 verbose_enter(); |
1486 emsg(_("E286: Failed to open input method")); | 1482 emsg(_(e_failed_to_open_input_method)); |
1487 verbose_leave(); | 1483 verbose_leave(); |
1488 } | 1484 } |
1489 return FALSE; | 1485 return FALSE; |
1490 } | 1486 } |
1491 | 1487 |
1494 XIMCallback destroy_cb; | 1490 XIMCallback destroy_cb; |
1495 | 1491 |
1496 destroy_cb.callback = xim_destroy_cb; | 1492 destroy_cb.callback = xim_destroy_cb; |
1497 destroy_cb.client_data = NULL; | 1493 destroy_cb.client_data = NULL; |
1498 if (XSetIMValues(xim, XNDestroyCallback, &destroy_cb, NULL)) | 1494 if (XSetIMValues(xim, XNDestroyCallback, &destroy_cb, NULL)) |
1499 emsg(_("E287: Warning: Could not set destroy callback to IM")); | 1495 emsg(_(e_warning_could_not_set_destroy_callback_to_im)); |
1500 } | 1496 } |
1501 # endif | 1497 # endif |
1502 | 1498 |
1503 if (XGetIMValues(xim, XNQueryInputStyle, &xim_styles, NULL) || !xim_styles) | 1499 if (XGetIMValues(xim, XNQueryInputStyle, &xim_styles, NULL) || !xim_styles) |
1504 { | 1500 { |
1505 emsg(_("E288: input method doesn't support any style")); | 1501 emsg(_(e_input_method_doesnt_support_any_style)); |
1506 XCloseIM(xim); | 1502 XCloseIM(xim); |
1507 return FALSE; | 1503 return FALSE; |
1508 } | 1504 } |
1509 | 1505 |
1510 found = False; | 1506 found = False; |
1559 // Only give this message when verbose is set, because too many people | 1555 // Only give this message when verbose is set, because too many people |
1560 // got this message when they didn't want to use a XIM. | 1556 // got this message when they didn't want to use a XIM. |
1561 if (p_verbose > 0) | 1557 if (p_verbose > 0) |
1562 { | 1558 { |
1563 verbose_enter(); | 1559 verbose_enter(); |
1564 emsg(_("E289: input method doesn't support my preedit type")); | 1560 emsg(_(e_input_method_doesnt_support_my_preedit_type)); |
1565 verbose_leave(); | 1561 verbose_leave(); |
1566 } | 1562 } |
1567 XCloseIM(xim); | 1563 XCloseIM(xim); |
1568 return FALSE; | 1564 return FALSE; |
1569 } | 1565 } |
1623 gui_set_shellsize(FALSE, FALSE, RESIZE_BOTH); | 1619 gui_set_shellsize(FALSE, FALSE, RESIZE_BOTH); |
1624 } | 1620 } |
1625 else | 1621 else |
1626 { | 1622 { |
1627 if (!is_not_a_term()) | 1623 if (!is_not_a_term()) |
1628 emsg(_(e_xim)); | 1624 emsg(_(e_failed_to_create_input_context)); |
1629 XCloseIM(xim); | 1625 XCloseIM(xim); |
1630 return FALSE; | 1626 return FALSE; |
1631 } | 1627 } |
1632 | 1628 |
1633 return TRUE; | 1629 return TRUE; |