From: Benno Schulenberg Date: Sun, 16 Mar 2014 13:19:41 +0000 (+0000) Subject: Using prettier whitespace characters when in a UTF-8 locale. X-Git-Tag: v2.3.3~286 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=c85dc05965a52ab5f29501a436c69cbaf79b907b;p=nano.git Using prettier whitespace characters when in a UTF-8 locale. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4644 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index c55a2c4b..7a61a293 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-03-14 Benno Schulenberg + * src/nano.c (main) - When in a UTF-8 locale, use prettier characters + (»·) for indicating whitespace, and for similarity use ">." instead of + ":." when not in a UTF-8 locale. Changes suggested by Mike Frysinger. + 2014-03-05 Benno Schulenberg * src/move.c (do_down) - Initialize the correct variable to zero. Solves jumpy scrolling behaviour reported by Chris Allegretta . diff --git a/src/nano.c b/src/nano.c index 297376dc..884b05a2 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2576,11 +2576,16 @@ int main(int argc, char **argv) #if !defined(NANO_TINY) && defined(ENABLE_NANORC) /* If whitespace wasn't specified, set its default value. */ - if (whitespace == NULL) { - whitespace = mallocstrcpy(NULL, ":."); - whitespace_len[0] = 1; - whitespace_len[1] = 1; - } + if (whitespace == NULL) + if (using_utf8()) { + whitespace = mallocstrcpy(NULL, "»·"); + whitespace_len[0] = 2; + whitespace_len[1] = 2; + } else { + whitespace = mallocstrcpy(NULL, ">."); + whitespace_len[0] = 1; + whitespace_len[1] = 1; + } #endif /* If tabsize wasn't specified, set its default value. */