0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

Added 'colorcolumn' option. Partly by Gregor Uhlenheuer.

This commit is contained in:
Bram Moolenaar
2010-07-14 19:53:30 +02:00
parent b28ebbca84
commit 1a38442dbc
13 changed files with 257 additions and 105 deletions

View File

@@ -544,75 +544,6 @@ iconv_errno()
}
#endif /* MACOS_X_ICONVEMU */
#ifdef USE_MCH_GETTEXT
#define GETTEXT_BUFNUM 64
#define GETTEXT_BUFSIZE 256
char *
mch_gettext(const char *msgid)
{
static char buf[GETTEXT_BUFNUM][GETTEXT_BUFSIZE];
static int bufnum = 0;
const char *msg = NULL;
CFStringRef strkey = NULL, strmsg = NULL;
CFStringEncoding enc;
if (!msgid)
goto MCH_GETTEXT_FINISH;
enc = CFStringGetSystemEncoding();
TRACE("mch_gettext(%s)\n", msgid);
strkey = CFStringCreateWithCString(NULL, msgid, enc);
if (!strkey)
{
TRACE(" Can't create a CFString for msgid.\n");
goto MCH_GETTEXT_FINISH;
}
strmsg = CFCopyLocalizedString(strkey, NULL);
if (!strmsg)
{
TRACE(" No localized strings for msgid.\n");
goto MCH_GETTEXT_FINISH;
}
msg = CFStringGetCStringPtr(strmsg, enc);
if (!msg)
{
/* This is as backup when CFStringGetCStringPtr was failed */
CFStringGetCString(strmsg, buf[bufnum], GETTEXT_BUFSIZE, enc);
msg = buf[bufnum];
if (++bufnum >= GETTEXT_BUFNUM)
bufnum = 0;
}
TRACE(" Localized to: %s\n", msg);
MCH_GETTEXT_FINISH:
if (strkey)
CFRelease(strkey);
if (strmsg)
CFRelease(strmsg);
return (char *)(msg ? msg : msgid);
}
char *
mch_bindtextdomain(const char *domain, const char *dirname)
{
TRACE("mch_bindtextdomain(%s, %s)\n", domain, dirname);
return (char*)dirname;
}
char *
mch_textdomain(const char *domain)
{
TRACE("mch_textdomain(%s)\n", domain);
return (char*)domain;
}
#endif
#ifdef FEAT_CLIPBOARD
void