a few last cosmetic reorderings and fixes
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1784 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
2c62b07d2b
commit
89bb93733a
11
src/global.c
11
src/global.c
|
@ -66,6 +66,12 @@ filestruct *cutbuffer = NULL; /* A place to store cut text */
|
|||
openfilestruct *open_files = NULL; /* The list of open files */
|
||||
#endif
|
||||
|
||||
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
|
||||
char *whitespace = NULL; /* Characters used when displaying
|
||||
the first characters of tabs and
|
||||
spaces. */
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
char *punct = NULL; /* Closing punctuation that can end
|
||||
sentences. */
|
||||
|
@ -78,11 +84,6 @@ char *quotestr = NULL; /* Quote string. The default value is
|
|||
|
||||
#ifndef NANO_SMALL
|
||||
char *backup_dir = NULL; /* Backup directory. */
|
||||
#ifdef ENABLE_NANORC
|
||||
char *whitespace = NULL; /* Characters used when displaying
|
||||
the first characters of tabs and
|
||||
spaces. */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
int resetstatuspos; /* Hack for resetting the status bar
|
||||
|
|
|
@ -1283,7 +1283,7 @@ int do_wrap(filestruct *inptr)
|
|||
* create the new wrap line. Finally, we clean up. */
|
||||
|
||||
/* Step 1, finding where to wrap. We are going to add a new-line
|
||||
* after a white-space character. In this step, we set wrap_loc as the
|
||||
* after a whitespace character. In this step, we set wrap_loc as the
|
||||
* location of this replacement.
|
||||
*
|
||||
* Where should we break the line? We need the last "legal wrap point"
|
||||
|
|
|
@ -46,6 +46,10 @@ extern int search_last_line;
|
|||
extern int search_offscreen;
|
||||
extern int currslen;
|
||||
|
||||
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
|
||||
extern char *whitespace;
|
||||
#endif
|
||||
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
extern char *punct;
|
||||
extern char *brackets;
|
||||
|
@ -54,9 +58,6 @@ extern char *quotestr;
|
|||
|
||||
#ifndef NANO_SMALL
|
||||
extern char *backup_dir;
|
||||
#ifdef ENABLE_NANORC
|
||||
extern char *whitespace;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern WINDOW *topwin, *edit, *bottomwin;
|
||||
|
|
29
src/rcfile.c
29
src/rcfile.c
|
@ -548,6 +548,9 @@ void parse_rcfile(FILE *rcstream)
|
|||
#ifndef DISABLE_WRAPJUSTIFY
|
||||
|| !strcasecmp(rcopts[i].name, "fill")
|
||||
#endif
|
||||
#ifndef NANO_SMALL
|
||||
|| !strcasecmp(rcopts[i].name, "whitespace")
|
||||
#endif
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
|| !strcasecmp(rcopts[i].name, "punct")
|
||||
|| !strcasecmp(rcopts[i].name, "brackets")
|
||||
|
@ -555,7 +558,6 @@ void parse_rcfile(FILE *rcstream)
|
|||
#endif
|
||||
#ifndef NANO_SMALL
|
||||
|| !strcasecmp(rcopts[i].name, "backupdir")
|
||||
|| !strcasecmp(rcopts[i].name, "whitespace")
|
||||
#endif
|
||||
#ifndef DISABLE_SPELLER
|
||||
|| !strcasecmp(rcopts[i].name, "speller")
|
||||
|
@ -594,6 +596,19 @@ void parse_rcfile(FILE *rcstream)
|
|||
wrap_at = j;
|
||||
} else
|
||||
#endif
|
||||
#ifndef NANO_SMALL
|
||||
if (!strcasecmp(rcopts[i].name, "whitespace")) {
|
||||
size_t ws_len;
|
||||
whitespace = mallocstrcpy(NULL, option);
|
||||
ws_len = strlen(whitespace);
|
||||
if (ws_len != 2 || (ws_len == 2 && (is_cntrl_char(whitespace[0]) || is_cntrl_char(whitespace[1])))) {
|
||||
rcfile_error(_("Two non-control characters required"));
|
||||
free(whitespace);
|
||||
whitespace = NULL;
|
||||
} else
|
||||
SET(WHITESPACE_DISPLAY);
|
||||
} else
|
||||
#endif
|
||||
#ifndef DISABLE_JUSTIFY
|
||||
if (!strcasecmp(rcopts[i].name, "punct")) {
|
||||
punct = mallocstrcpy(NULL, option);
|
||||
|
@ -616,18 +631,6 @@ void parse_rcfile(FILE *rcstream)
|
|||
if (!strcasecmp(rcopts[i].name, "backupdir"))
|
||||
backup_dir = mallocstrcpy(NULL, option);
|
||||
else
|
||||
|
||||
if (!strcasecmp(rcopts[i].name, "whitespace")) {
|
||||
size_t ws_len;
|
||||
whitespace = mallocstrcpy(NULL, option);
|
||||
ws_len = strlen(whitespace);
|
||||
if (ws_len != 2 || (ws_len == 2 && (is_cntrl_char(whitespace[0]) || is_cntrl_char(whitespace[1])))) {
|
||||
rcfile_error(_("Two non-control characters required"));
|
||||
free(whitespace);
|
||||
whitespace = NULL;
|
||||
} else
|
||||
SET(WHITESPACE_DISPLAY);
|
||||
} else
|
||||
#endif
|
||||
#ifndef DISABLE_SPELLER
|
||||
if (!strcasecmp(rcopts[i].name, "speller"))
|
||||
|
|
Loading…
Reference in New Issue