nano

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

commit bb90de0eb4227e9643611ecd75ee18170b25176c
parent 157c7b1bc43f0b1c2d121bb21f3f8eab2a2e1f40
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sat,  4 Aug 2018 11:21:42 +0200

tweaks: rename a constant, to match what it actually means

Wrapping is concerned with columns, not with number of characters.

Diffstat:
Msrc/global.c | 6++----
Msrc/nano.h | 5++---
Msrc/rcfile.c | 2+-
3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/global.c b/src/global.c @@ -80,10 +80,8 @@ int shiftaltleft, shiftaltright, shiftaltup, shiftaltdown; #ifdef ENABLED_WRAPORJUSTIFY ssize_t fill = 0; /* The column where we will wrap lines. */ -ssize_t wrap_at = -CHARS_FROM_EOL; - /* The position where we will wrap lines. fill is equal to this - * if it's greater than zero, and equal to (COLS + this) if it - * isn't. */ +ssize_t wrap_at = -COLUMNS_FROM_EOL; + /* The column where we will wrap lines. */ #endif char *last_search = NULL; diff --git a/src/nano.h b/src/nano.h @@ -630,9 +630,8 @@ enum /* The maximum number of entries displayed in the main shortcut list. */ #define MAIN_VISIBLE (((COLS + 40) / 20) * 2) -/* The default number of characters from the end of the line where - * wrapping occurs. */ -#define CHARS_FROM_EOL 8 +/* The default number of columns from end of line where wrapping occurs. */ +#define COLUMNS_FROM_EOL 8 /* The default width of a tab in spaces. */ #define WIDTH_OF_TAB 8 diff --git a/src/rcfile.c b/src/rcfile.c @@ -1105,7 +1105,7 @@ void parse_rcfile(FILE *rcstream, bool syntax_only) if (!parse_num(option, &wrap_at)) { rcfile_error(N_("Requested fill size \"%s\" is invalid"), option); - wrap_at = -CHARS_FROM_EOL; + wrap_at = -COLUMNS_FROM_EOL; } else UNSET(NO_WRAP); free(option);