nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit c85dc05965a52ab5f29501a436c69cbaf79b907b
parent 3278f839c1e42f0d7ed129cb4989aa0c0057fad8
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Sun, 16 Mar 2014 13:19:41 +0000

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

Diffstat:
MChangeLog | 5+++++
Msrc/nano.c | 15++++++++++-----
2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,8 @@ +2014-03-14 Benno Schulenberg <bensberg@justemail.net> + * 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 <bensberg@justemail.net> * 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 @@ -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. */