mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -05:00
move "auto" to default instead
This commit is contained in:
parent
b95ce3e812
commit
3ef0b9b3d0
@ -37,7 +37,6 @@
|
|||||||
#define UNICODE_IRSSI_LOGO 0x1F525
|
#define UNICODE_IRSSI_LOGO 0x1F525
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
WCWIDTH_IMPL_AUTO = 0,
|
|
||||||
WCWIDTH_IMPL_OLD,
|
WCWIDTH_IMPL_OLD,
|
||||||
WCWIDTH_IMPL_SYSTEM
|
WCWIDTH_IMPL_SYSTEM
|
||||||
#ifdef HAVE_LIBUTF8PROC
|
#ifdef HAVE_LIBUTF8PROC
|
||||||
@ -86,19 +85,6 @@ static void read_settings(void)
|
|||||||
choice = newchoice;
|
choice = newchoice;
|
||||||
|
|
||||||
switch (choice) {
|
switch (choice) {
|
||||||
case WCWIDTH_IMPL_AUTO:
|
|
||||||
/* Test against characters that have wcwidth=2
|
|
||||||
* since unicode 5.2 and 9.0 respectively */
|
|
||||||
|
|
||||||
if (system_wcwidth(UNICODE_SQUARE_HIRAGANA_HOKA) == 2 ||
|
|
||||||
system_wcwidth(UNICODE_IRSSI_LOGO) == 2) {
|
|
||||||
wcwidth_impl_func = &system_wcwidth;
|
|
||||||
} else {
|
|
||||||
/* Fall back to our own (which implements 5.0) */
|
|
||||||
wcwidth_impl_func = &mk_wcwidth;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case WCWIDTH_IMPL_OLD:
|
case WCWIDTH_IMPL_OLD:
|
||||||
wcwidth_impl_func = &mk_wcwidth;
|
wcwidth_impl_func = &mk_wcwidth;
|
||||||
break;
|
break;
|
||||||
@ -118,10 +104,22 @@ static void read_settings(void)
|
|||||||
|
|
||||||
void wcwidth_wrapper_init(void)
|
void wcwidth_wrapper_init(void)
|
||||||
{
|
{
|
||||||
|
int wcwidth_impl_default = 0;
|
||||||
|
/* Test against characters that have wcwidth=2
|
||||||
|
* since unicode 5.2 and 9.0 respectively */
|
||||||
|
|
||||||
|
if (system_wcwidth(UNICODE_SQUARE_HIRAGANA_HOKA) == 2 ||
|
||||||
|
system_wcwidth(UNICODE_IRSSI_LOGO) == 2) {
|
||||||
|
wcwidth_impl_default = WCWIDTH_IMPL_SYSTEM;
|
||||||
|
} else {
|
||||||
|
/* Fall back to our own (which implements 5.0) */
|
||||||
|
wcwidth_impl_default = WCWIDTH_IMPL_OLD;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBUTF8PROC
|
#ifdef HAVE_LIBUTF8PROC
|
||||||
settings_add_choice("misc", "wcwidth_implementation", WCWIDTH_IMPL_AUTO, "auto;old;system;julia");
|
settings_add_choice("misc", "wcwidth_implementation", wcwidth_impl_default, "old;system;julia");
|
||||||
#else
|
#else
|
||||||
settings_add_choice("misc", "wcwidth_implementation", WCWIDTH_IMPL_AUTO, "auto;old;system");
|
settings_add_choice("misc", "wcwidth_implementation", wcwidth_impl_default, "old;system");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
read_settings();
|
read_settings();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user